/* Each exhibit shares one WebGL installation with the hall. The canvas stays
   at the hall size during a walk, then resizes once for the reading spread. */
.spatial-edition body[data-gallery-station] {
  --exhibit-width:min(61vw, calc(100% - 21rem));
  --exhibit-height:100svh;
  --station-paper:#f5f3ed;
  --station-ink:#182e43;
  --station-muted:#465c6a;
  --station-blue:#244a83;
  background:var(--station-paper);
  color:var(--station-ink);
}
body[data-gallery-station="about"] {--station-image:url('./assets/gallery-walk/about.webp')}
body[data-gallery-station="research"] {--station-image:url('./assets/gallery-walk/research.webp')}
body[data-gallery-station="works"] {--station-image:url('./assets/gallery-walk/works.webp')}

.spatial-edition body[data-gallery-station] :is(.scene-home,#scene-labels) {
  inset:0 auto auto 0;
  position:fixed;
  width:100%;
  height:var(--stage-height);
}
.spatial-edition body[data-gallery-station]:is(:not(.gallery-travelling),.gallery-film-playing) :is(.scene-home,#scene-labels) {
  width:var(--exhibit-width);
  height:var(--exhibit-height);
  min-height:0;
}
.spatial-edition body[data-gallery-station]:not(.gallery-travelling):is(.scene-fallback,.spatial-context-lost,:not(.scene-ready)) .scene-home {
  background:#cbd1d7 var(--station-image) center center / cover no-repeat;
}
.spatial-edition body[data-gallery-station] #footer {display:none}
.spatial-edition body[data-gallery-station] #main {pointer-events:none}
.spatial-edition body[data-gallery-station] #scene-status {display:none}

.gallery-station {
  display:grid;
  grid-template-columns:var(--exhibit-width) minmax(0,1fr);
  min-height:100svh;
  pointer-events:none;
}
.station-header {
  position:absolute;
  top:clamp(20px,3vh,38px);
  left:clamp(22px,3vw,58px);
  z-index:9;
}
.station-back {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  gap:.7em;
  color:var(--station-ink);
  font:500 .85rem/1.35 var(--sans);
  pointer-events:auto;
  text-shadow:0 1px 4px #fafaf4;
  text-decoration:none;
}
.station-back span {font-size:1.25em}
.station-paper {
  grid-column:2;
  display:grid;
  align-content:center;
  min-height:100svh;
  padding:clamp(90px,11svh,135px) clamp(26px,3.6vw,68px) clamp(40px,7svh,78px);
  border-left:1px solid #63778840;
  background:var(--station-paper);
  pointer-events:auto;
}
.station-writing {width:100%;max-width:32rem;margin-inline:auto;container-type:inline-size}
.station-kind,.station-date {
  margin:0;
  color:var(--station-muted);
  font:500 .77rem/1.6 var(--sans);
  letter-spacing:.055em;
}
.station-kind {
  display:flex;
  align-items:center;
  gap:.7rem;
  margin-bottom:1rem;
  color:var(--station-blue);
  text-transform:uppercase;
  letter-spacing:.115em;
}
.station-kind::before {content:"";width:1.5rem;height:1px;background:currentColor}
.station-writing h1,.station-writing h2 {
  margin:0;
  font-family:'Cormorant Garamond',Georgia,'Songti SC',SimSun,serif;
  font-weight:500;
  color:var(--station-ink);
}
.station-writing h1 {font-size:clamp(2.5rem,4vw,5.1rem);line-height:1.04;letter-spacing:-.035em;text-wrap:balance}
:lang(zh-CN) .station-writing h1 {font-size:clamp(1.9rem,2.6vw,3.1rem);line-height:1.3;letter-spacing:.005em}
:lang(zh-CN) .station-folio-title {word-break:keep-all}
.station-writing h1.station-folio-title:lang(en) {font-size:clamp(1.45rem,8.6cqi,2.9rem);line-height:1.12;text-wrap:wrap}
.station-writing h1 + .station-date {margin-top:1rem}
.station-writing h2 {font-size:clamp(1.55rem,2vw,2rem);line-height:1.1}
:lang(zh-CN) .station-writing h2 {font-size:1.35rem;line-height:1.45}
.station-intro,.station-note,.station-degree,.station-passage p {
  font:400 1rem/1.68 var(--sans);
  color:var(--station-muted);
}
.station-intro {margin:1.15rem 0 0}
.station-school-choice {
  display:flex;
  flex-wrap:wrap;
  gap:0 1.2rem;
  margin:1.35rem 0 1rem;
  border-bottom:1px solid #233e4d32;
}
.station-school-choice button {
  position:relative;
  min-height:44px;
  font:500 .9rem/1.3 var(--sans);
  color:var(--station-muted);
  white-space:nowrap;
}
.spatial-edition .gallery-pin {white-space:nowrap}
.station-school-choice button[aria-pressed=true] {color:var(--station-blue)}
.station-school-choice button[aria-pressed=true]::after {
  content:"";
  position:absolute;
  inset:auto 0 -1px;
  height:2px;
  background:var(--station-blue);
}
#station-education .station-date {margin-bottom:.5rem}
.station-degree {margin:.6rem 0 .25rem;color:var(--station-ink)}
.station-note {margin:0;font-size:.9rem}
.station-links {display:grid;justify-items:start;gap:.15rem;margin-top:1.15rem}
.station-action,.station-secondary,.station-crossing {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  gap:.9em;
  color:var(--station-ink);
  font:500 .88rem/1.4 var(--sans);
  text-decoration:none;
}
.station-action span:first-child {padding-block:.14em;border-bottom:1px solid #405e75}
.station-action span:last-child,.station-crossing span:last-child {color:var(--station-blue)}
.station-secondary {color:var(--station-muted);font-size:.83rem}
.station-passage {
  margin-top:clamp(1rem,3.75svh,2.7rem);
  border-top:1px solid #233e4d32;
  padding-top:.75rem;
}
.station-passage p {margin:0 0 .2rem;font-size:.85rem}
.station-crossing {color:var(--station-blue)}
.gallery-passage-film {
  position:fixed;inset:0 auto auto 0;width:100%;height:var(--stage-height,100svh);
  object-fit:fill;pointer-events:none;visibility:hidden;z-index:8;
}
body.gallery-film-playing .gallery-passage-film {visibility:visible}
.spatial-edition body.gallery-film-playing :is(.station-paper,.station-header,#scene-labels,.home-page) {
  visibility:hidden;pointer-events:none;
}
.gallery-station :is(a,button):focus-visible {outline:2px solid #315b99;outline-offset:3px}
.gallery-station a:hover {color:var(--station-blue);text-decoration:underline;text-underline-offset:.25rem}
.spatial-edition .gallery-travelling :is(.station-paper,.station-header,#scene-labels) {
  visibility:hidden;
  opacity:0;
  pointer-events:none;
}
@media (prefers-reduced-motion:no-preference) {
  .spatial-edition:not(.reduce-motion) .station-paper {transition:opacity .32s ease-out}
}
@media(max-width:760px) {
  body[data-gallery-station="about"] {--station-image:url('./assets/gallery-walk/about-tall.webp')}
  body[data-gallery-station="research"] {--station-image:url('./assets/gallery-walk/research-tall.webp')}
  body[data-gallery-station="works"] {--station-image:url('./assets/gallery-walk/works-tall.webp')}
  .spatial-edition body[data-gallery-station] {
    --exhibit-width:100%;
    --exhibit-height:max(205px,42svh);
  }
  .spatial-edition body[data-gallery-station] :is(.scene-home,#scene-labels) {position:absolute}
  .gallery-station {display:block;padding-top:var(--exhibit-height)}
  .station-header {top:16px;left:6vw}
  .station-paper {
    padding:clamp(24px,4.5svh,42px) max(6vw,22px) 2.4rem;
    min-height:calc(100svh - var(--exhibit-height));
    align-content:start;
    border-top:1px solid #63778840;
    border-left:0;
  }
  .station-writing {max-width:37rem}
  .station-writing h1 {font-size:clamp(2.2rem,6vw,3.05rem);line-height:1.06}
  :lang(zh-CN) .station-writing h1 {font-size:clamp(1.8rem,5.8vw,2.45rem)}
  .station-kind {margin-bottom:.6rem}
  .station-intro {margin-top:.8rem}
  .station-school-choice {margin:.75rem 0}
  .station-links {margin-top:.75rem}
}
