/* Project exhibits: large index preview, dominant inspection artifacts, EEG figure prominence,
   and loading/poster states. Loaded after polish.css. Only the hooks named here are styled. */

/* ---------- 1. Project index + large preview ---------- */
.exhibit-index{display:grid;grid-template-columns:minmax(15rem,5fr) minmax(0,7fr);gap:clamp(1rem,3vw,3rem);align-items:stretch;margin-top:clamp(1rem,3svh,2rem);min-height:0}
.exhibit-index .portal-index{display:flex!important;flex-direction:column;gap:.15rem;margin:0!important;min-width:0}
.exhibit-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem;border-top:1px solid rgba(127,140,134,.35);position:relative}
.exhibit-row:last-child{border-bottom:1px solid rgba(127,140,134,.35)}
.exhibit-row>a{display:block!important;padding:.55rem .25rem;min-height:44px;border-radius:4px}
.exhibit-row .portal-index-media{display:none!important}
.exhibit-row .portal-index-line{display:none!important}
.exhibit-row .portal-index-text{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.1rem 1rem}
.exhibit-row .portal-index-row{display:contents}
.exhibit-row .portal-index-row strong{font-family:var(--serif);font-weight:400;font-size:clamp(1.15rem,1.9vw,1.75rem);line-height:1.1;letter-spacing:-.01em}
.exhibit-row .portal-index-year{grid-column:2;grid-row:1;align-self:baseline;font-family:var(--mono);font-size:.8rem}
.exhibit-row .portal-index-field{grid-column:1/-1;font-family:var(--mono);font-size:.78rem;letter-spacing:.02em}
.exhibit-row.is-selected::before{content:"";position:absolute;left:-.9rem;top:.6rem;bottom:.6rem;width:3px;border-radius:2px;background:currentColor}
.exhibit-row.is-selected .portal-index-row strong{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.22em}
.exhibit-pick{min-width:44px;min-height:44px;padding:0 .7rem;border:1px solid rgba(127,140,134,.6);border-radius:999px;background:transparent;color:inherit;font:500 .78rem/1 var(--mono);letter-spacing:.04em;cursor:pointer}
.exhibit-pick[aria-pressed="true"]{background:currentColor}
.exhibit-pick[aria-pressed="true"] span{color:var(--deep,#0e211c)}
.exhibit-pick:focus-visible,.exhibit-row>a:focus-visible,.exhibit-preview-open:focus-visible{outline:2px solid currentColor;outline-offset:3px}

.exhibit-preview{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:.8rem;margin:0;min-height:0;min-width:0}
.exhibit-preview-frame{position:relative;min-height:12rem;border-radius:8px;overflow:hidden;background:rgba(127,140,134,.12)}
.exhibit-preview-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.exhibit-preview-img[hidden],.exhibit-preview-fallback[hidden]{display:none!important}
.exhibit-preview-fallback{position:absolute;inset:0;display:grid;place-content:center;padding:1.5rem;margin:0;text-align:center;font-size:1rem;line-height:1.45}
.exhibit-preview-fallback a{color:inherit;text-decoration:underline}
.exhibit-preview-text{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.25rem 1.25rem;align-items:end}
.exhibit-preview-meta{grid-column:1/-1;display:flex;gap:1rem;font-family:var(--mono);font-size:.78rem;opacity:.8}
.exhibit-preview-name{font-family:var(--serif);font-weight:400;font-size:clamp(1.4rem,2.4vw,2.2rem);line-height:1.05}
.exhibit-preview-line{grid-column:1;font-size:clamp(.98rem,1.2vw,1.12rem);line-height:1.4;max-width:52ch}
.portal .exhibit-preview-open{grid-column:2;grid-row:2/span 2;align-self:end;display:inline-flex;align-items:center;min-height:44px;padding:0 1.1rem;border-radius:999px;background:#10372f;color:#f1f6f2;text-decoration:none;white-space:nowrap}
.exhibit-index-on .jr-dive .exhibit-preview-open{background:#e4efe8;color:#0e211c}
.exhibit-pick[aria-pressed="true"]{background:#10372f;color:#f1f6f2}
.exhibit-pick[aria-pressed="true"] span{color:inherit}
.exhibit-index-on .jr-dive .exhibit-pick[aria-pressed="true"]{background:#e4efe8;color:#0e211c}
@media (prefers-reduced-motion:no-preference){
  .exhibit-preview-frame.is-in .exhibit-preview-img{animation:exhibit-fade .24s ease-out}
}
@keyframes exhibit-fade{from{opacity:.35}to{opacity:1}}

/* Inside the pinned opening: dark ground, fill the viewport between header and foot. */
.exhibit-index-on .jr-dive .jr-copy{top:clamp(4.2rem,9svh,6rem);bottom:calc(5svh + var(--bar,0px));display:flex;flex-direction:column}
.exhibit-index-on .jr-dive h2{font-size:clamp(2.4rem,min(6.5vw,10svh),7.5rem)!important;flex:none}
.exhibit-index-on .jr-dive .exhibit-index{flex:1 1 auto}
.exhibit-index-on .jr-dive .portal-opening-foot{flex:none;margin-top:clamp(.7rem,2svh,1.2rem)!important}
.exhibit-index-on .jr-dive .exhibit-index .portal-index{grid-template-columns:none!important;overflow:visible}
.exhibit-index-on .jr-dive .exhibit-row{border-color:rgba(228,239,232,.22)}
.exhibit-index-on .jr-dive .exhibit-preview{color:#e4efe8}
.exhibit-index-on .jr-dive .exhibit-preview-frame{background:rgba(228,239,232,.07)}
.exhibit-index-on .jr-dive .exhibit-preview-line{color:#c3d3cb}
.exhibit-index-on .jr-dive .exhibit-pick{border-color:rgba(228,239,232,.45);color:#e4efe8}

@media (max-width:800px){
  .exhibit-index{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:.7rem;margin-top:.7rem}
  .exhibit-row>a{padding:.3rem .2rem}
  .exhibit-row .portal-index-field{display:none}
  .exhibit-row .portal-index-row strong{font-size:1.08rem}
  .exhibit-row.is-selected::before{left:-.6rem}
  .exhibit-preview{display:flex;flex-direction:column;gap:.5rem}
  .exhibit-preview-frame{flex:0 1 auto;aspect-ratio:var(--preview-aspect,4/3);min-height:0}
  .exhibit-preview-text{flex:none;align-items:center}
  .exhibit-preview-name{font-size:1.2rem}
  .exhibit-preview-line{grid-column:1/-1;font-size:.95rem;line-height:1.35}
  .portal .exhibit-preview-open{grid-row:1;grid-column:2;align-self:center}
  .exhibit-preview-meta{display:none}
  .exhibit-index-on .jr-dive .jr-copy{top:4rem;bottom:calc(3svh + var(--bar,0px))}
  .exhibit-index-on .jr-dive h2{font-size:clamp(2rem,10vw,3rem)!important}
  .exhibit-index-on .jr-dive .portal-opening-foot p{display:none}
}
@media (max-width:800px) and (max-height:700px){
  .exhibit-preview-line{display:none}
  .exhibit-preview-text{grid-template-columns:minmax(0,1fr) auto;align-items:center}
  .exhibit-preview-open{grid-row:auto}
}
/* Short screens: keep the five names and the Open action; drop the image before the names. */
@media (max-height:560px){
  .exhibit-index{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .exhibit-index-on .jr-dive h2{font-size:clamp(1.8rem,9svh,2.6rem)!important}
  .exhibit-row .portal-index-field,.exhibit-preview-line,.exhibit-preview-meta{display:none}
  .exhibit-row>a{padding:.2rem}
}
@media (max-height:430px){.exhibit-preview-frame{display:none}.exhibit-preview{grid-template-rows:auto;align-content:center}}

/* ---------- 2. Model Morpher: the surface is the exhibit ---------- */
.has-journey .portal-morpher .jr-sheet{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.has-journey .portal-morpher .jr-sheet>.portal-surface{grid-column:1/-1;grid-row:1;margin:0 0 clamp(1.5rem,3vw,2.5rem);min-height:0;height:min(80svh,62vw);--rail:4.75rem;background:#eef2ef;border-radius:10px}
.has-journey .portal-morpher .jr-sheet>.portal-project-foot{grid-column:1;grid-row:2}
.has-journey .portal-morpher .jr-sheet>.portal-morpher-caption{grid-column:2;grid-row:2;margin-top:0}
.has-journey .portal-morpher .jr-sheet>.portal-film-details{grid-row:3}
.has-journey .portal-morpher .portal-surface canvas,
.has-journey .portal-morpher .portal-surface-poster{inset:0 0 var(--rail) 0;height:calc(100% - var(--rail));padding:2%}
.has-journey .portal-morpher .portal-surface canvas{padding:0}
.has-journey .portal-morpher .portal-surface-tools{left:clamp(.75rem,2vw,1.5rem);right:clamp(.75rem,2vw,1.5rem);bottom:.5rem;display:flex;align-items:end;justify-content:space-between;gap:.75rem 1.5rem;flex-wrap:wrap}
.has-journey .portal-morpher .portal-surface-tools[hidden]{display:none!important}
.has-journey .portal-morpher .portal-frame-pick{flex:0 1 26rem}
.has-journey .portal-morpher .portal-frame-pick button{min-height:48px;padding:.4rem .7rem}
.has-journey .portal-morpher .portal-frame-pick button span{font-size:1.05rem}
@media (max-width:800px){
  .has-journey .portal-morpher .jr-sheet>.portal-surface{height:auto;aspect-ratio:auto;min-height:min(34rem,82svh);margin-inline:-1rem;--rail:7.5rem}
  .has-journey .portal-morpher .portal-surface-tools{flex-direction:column;align-items:stretch;gap:.4rem}
  .has-journey .portal-morpher .portal-frame-pick{flex:none}
}

/* Explicit 3D load controls from portal.js */
.portal-inspect-controls{position:absolute;top:clamp(.6rem,1.5vw,1rem);left:clamp(.6rem,1.5vw,1rem);z-index:4;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;max-width:calc(100% - 1.2rem)}
.portal-inspect-controls[hidden],.portal-inspect-trigger[hidden],.portal-inspect-close[hidden],.portal-inspect-status[hidden]{display:none!important}
.portal-inspect-trigger,.portal-inspect-close{min-height:44px;min-width:44px;padding:0 1.1rem;border-radius:999px;font:600 .95rem/1 var(--sans,inherit);cursor:pointer}
.portal-inspect-trigger{border:1px solid #10372f;background:#10372f;color:#f1f6f2}
.portal-inspect-close{border:1px solid #879790;background:rgba(241,246,242,.92);color:#10372f}
.portal-inspect-trigger:disabled{opacity:.75;cursor:progress}
.portal-inspect-trigger:focus-visible,.portal-inspect-close:focus-visible{outline:2px solid #10372f;outline-offset:3px}
.portal-inspect-status{padding:.35rem .7rem;border-radius:6px;background:rgba(241,246,242,.92);color:#10372f;font-size:.9rem;line-height:1.35;max-width:32ch}
.portal-inspect-status:empty{display:none}
[data-surface-state="error"] .portal-inspect-status{background:#fbeee6;color:#7a2e12}
[data-surface-state="ready"] .portal-inspect-status{background:transparent;padding-inline:0}

/* ---------- 2b. Morphliner: the film is the exhibit, stills a compact rail ---------- */
.has-journey .morphliner-study .morphliner-workspace{max-width:none;margin-inline:calc(clamp(1.25rem,5vw,6rem) * -1);border:0;border-radius:0;background:#14191b;color:#dfe3dd;overflow:visible}
.has-journey .morphliner-study .morphliner-film{margin:0}
.has-journey .morphliner-study .morphliner-film video{width:100%;max-height:min(82svh,56.25vw);object-fit:contain;background:#0a0d0e}
.has-journey .morphliner-study .morphliner-film figcaption{padding:.6rem clamp(1.25rem,5vw,6rem) 0;color:#b9c1bb}
.has-journey .morphliner-study .morphliner-inspect{border-top:0;padding:.7rem clamp(1.25rem,5vw,6rem) 1rem;background:transparent}
.has-journey .morphliner-study .morphliner-inspect[hidden]{display:none!important}
.has-journey .morphliner-study .morphliner-filmstrip{flex:0 1 24rem;gap:.5rem}
.has-journey .morphliner-study .morphliner-filmstrip button{color:#c9d0cb;font-size:.88rem;gap:.3rem;padding-bottom:.4rem}
.has-journey .morphliner-study .morphliner-filmstrip img{border-color:#3a4447}
.has-journey .morphliner-study .morphliner-filmstrip button:hover{color:#fff;border-bottom-color:#5b6669}
.has-journey .morphliner-study .morphliner-filmstrip button[aria-pressed="true"]{color:#fff;border-bottom-color:#dce3a5}
.has-journey .morphliner-study .morphliner-filmstrip button[aria-pressed="true"] img{border-color:#dce3a5}
.has-journey .morphliner-study .morphliner-filmstrip button:focus-visible{outline:2px solid #dce3a5}
.has-journey .morphliner-study .morphliner-inspect-note{color:#b9c1bb;max-width:40ch}
@media (max-width:800px){
  .has-journey .morphliner-study .morphliner-workspace{margin-inline:-1.25rem}
  .has-journey .morphliner-study .morphliner-filmstrip{max-width:none;flex:none;gap:.4rem}
  .has-journey .morphliner-study .morphliner-filmstrip button{min-width:0;font-size:.82rem}
}

/* ---------- 3. EEG: the team figure dominates the stage ---------- */
.jr-eeg .portal-eeg-figure img{padding:0}
@media (min-width:801px){
  .jr-eeg .jr-pin{grid-template-columns:minmax(14rem,3.6fr) minmax(0,9.4fr);gap:clamp(1.25rem,2.4vw,2.5rem);padding-inline:clamp(1.25rem,3.5vw,4rem)}
  .has-journey .portal-eeg .portal-title{font-size:clamp(2.2rem,3.4vw,4rem)}
  .has-journey .portal-eeg .portal-eeg-question{font-size:clamp(1.1rem,1.5vw,1.45rem);line-height:1.25}
  .jr-eeg .jr-limit{font-size:.95rem;line-height:1.4;max-width:38ch}
  .jr-eeg .portal-eeg-figure{justify-self:center;width:min(100%,calc((100svh - 14rem) * 1720 / 980))}
}
/* Sheet: an unchanged second copy of the source figure, with the decision controls beneath it.
   The controls sit in their own columns and are not stretched to the plot's time axis. */
.exhibit-eeg-source{display:none}
.has-journey .portal-eeg .exhibit-eeg-source{display:block;grid-column:1/-1;margin:0 0 clamp(1.25rem,2.5vw,2rem);background:#fff;border-radius:8px;overflow:hidden}
.exhibit-eeg-source img{display:block;width:100%;height:auto;max-height:78svh;object-fit:contain;padding:clamp(.5rem,1.2vw,1.2rem)}
.exhibit-eeg-source figcaption{padding:.6rem clamp(.8rem,1.5vw,1.2rem) .8rem;font-size:.92rem;line-height:1.4;color:#40544d}
.has-journey .portal-eeg .portal-eeg-body{max-width:none;display:grid;grid-template-columns:minmax(0,auto) minmax(0,1.2fr) minmax(0,1fr);gap:1rem clamp(1.5rem,3vw,3rem);align-items:start}
.has-journey .portal-eeg .portal-window-pick{grid-column:1;margin:0;flex-direction:column;justify-content:start}
.has-journey .portal-eeg .portal-protocol{grid-column:2}
.has-journey .portal-eeg .portal-window-note{grid-column:2}
.has-journey .portal-eeg .portal-eeg-body>.portal-limit{grid-column:3;grid-row:2/span 2;margin:0}
@media (max-width:800px){
  .has-journey .portal-eeg .portal-eeg-body{grid-template-columns:minmax(0,1fr)}
  .has-journey .portal-eeg .portal-eeg-body>*{grid-column:1!important;grid-row:auto!important}
  .has-journey .portal-eeg .exhibit-eeg-source{margin-inline:-.5rem}
  .has-journey .portal-eeg .portal-window-pick{flex-direction:row;flex-wrap:wrap}
}

/* ---------- 4. Film poster / loading / retry (journey film worker) ---------- */
.jr-film-wrap{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.jr-morpher .jr-film-wrap{z-index:3}
.jr-film-wrap>.jr-film{position:absolute;inset:0;width:100%;height:100%}
.jr-film-wrap:not([data-state="ready"])>.jr-film{visibility:hidden}
.jr-film-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.jr-morphliner .jr-film-poster{object-fit:cover}
.jr-film-wrap[data-state="ready"]>.jr-film-poster,.jr-film-wrap[data-state="ready"]>.jr-film-status{display:none!important}
.jr-film-status{position:absolute;right:clamp(1rem,4vw,4rem);top:clamp(4.4rem,10svh,6rem);display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem;max-width:min(24rem,calc(100% - 2rem));padding:.5rem .8rem;border-radius:8px;background:rgba(14,33,28,.78);color:#eef3ef;font-size:.9rem;line-height:1.35;pointer-events:auto}
.jr-film-retry{min-height:44px;min-width:44px;padding:0 1rem;border:1px solid #eef3ef;border-radius:999px;background:transparent;color:inherit;font:600 .9rem/1 var(--sans,inherit);cursor:pointer}
.jr-film-details{color:inherit;text-decoration:underline;min-height:44px;display:inline-flex;align-items:center}
.jr-film-retry:focus-visible,.jr-film-details:focus-visible{outline:2px solid #eef3ef;outline-offset:2px}
.jr-film-wrap [hidden],.jr-film-status[hidden],.jr-film-retry[hidden],.jr-film-details[hidden],.jr-film-poster[hidden]{display:none!important}
@media (max-width:800px){
  .jr-slot>.jr-film-wrap{position:relative;inset:auto;width:100%;height:100%}
  .jr-slot .jr-film-status{top:auto;right:auto;left:.5rem;bottom:.5rem;max-width:calc(100% - 1rem)}
}
@media print{.jr-film-wrap,.jr-film-status{display:none}}
