/* EBG: native scroll changes chapters; horizontal input rotates the exhibition. */
#ebg { --ebg-mint:#8de8ac; pointer-events:none; }
.ebg-exhibition { position:absolute; inset:0; display:grid; grid-template-rows:clamp(180px,25svh,240px) minmax(0,1fr) auto; opacity:0; }
.ebg-brand { display:flex; align-items:flex-end; justify-content:center; margin:0; padding-bottom:28px; }
.ebg-logo { display:block; width:clamp(150px,16vw,220px); aspect-ratio:555.51 / 207.1; background:var(--ebg-mint); mask:url("../assets/graphic/ebg/ebg-logo.svg") center / contain no-repeat; mask-mode:alpha; }
.ebg-logo-float.adverso-levitation { display:block; width:auto; height:auto; }
.ebg-stage { position:relative; min-width:0; min-height:0; }
.ebg-gallery { position:absolute; inset:0; pointer-events:none; perspective-origin:50% 50%; overflow:clip; touch-action:pan-y pinch-zoom; user-select:none; -webkit-user-select:none; outline-offset:-8px; }
.ebg-space { position:absolute; inset:0; transform-style:preserve-3d; pointer-events:none; }
.ebg-panel { position:absolute; left:50%; top:50%; width:var(--ebg-panel-width); height:100%; display:flex; align-items:center; justify-content:center; padding:0; margin:0; border:0; background:none; transform-style:preserve-3d; backface-visibility:hidden; cursor:grab; }
.ebg-art-float.adverso-levitation { display:flex; align-items:center; justify-content:center; }
.ebg-panel img { display:block; width:auto; height:auto; max-width:100%; max-height:90%; object-fit:contain; pointer-events:none; filter:drop-shadow(0 20px 24px #0007); }
.ebg-gallery.is-dragging .ebg-panel { cursor:grabbing; }
.ebg-panel:focus-visible { outline:1px solid var(--ebg-mint); outline-offset:6px; }
.ebg-panel.is-loading::after { content:""; position:absolute; width:20px; height:20px; border:1px solid #8de8ac50; border-top-color:var(--ebg-mint); border-radius:50%; animation:ebg-load 1s linear infinite; }
.ebg-controls { position:absolute; inset:0; z-index:10; pointer-events:none; }
.ebg-controls button { position:absolute; top:50%; translate:0 -50%; width:64px; height:64px; padding:0; border:0; background:transparent; color:#dce6de; font:inherit; font-size:40px; text-shadow:0 1px 4px #000; cursor:pointer; pointer-events:auto; transition:color .18s; }
.ebg-controls .ebg-previous { left:24px; }
.ebg-controls .ebg-next { right:24px; }
.ebg-controls button:hover { color:var(--ebg-mint); }
.ebg-footer { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:20px; padding:12px clamp(20px,4vw,64px) max(112px,calc(env(safe-area-inset-bottom) + 92px)); }
.ebg-meta { grid-column:3; grid-row:1; justify-self:end; display:flex; flex-wrap:wrap; align-items:center; gap:12px; color:#b6c2b9; }
.ebg-caption { margin:0; font-size:12px; text-align:left; }
.ebg-count { font-size:12px; letter-spacing:.08em; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ebg-drag-hint { grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:center; gap:10px; color:#b8bcb7; font-size:11px; pointer-events:none; }
.ebg-drag-hint svg { width:28px; height:28px; flex:none; }
.ebg-all { grid-column:1; grid-row:1; justify-self:start; display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:48px; padding:10px 20px; border:1px solid #788d7c; border-radius:9999px; color:var(--ink); background:rgba(23,32,25,.9); font:inherit; font-size:13px; white-space:nowrap; cursor:pointer; pointer-events:auto; transition:background .16s ease,border-color .16s ease; }
.ebg-all:hover { background:#293c2e; border-color:var(--accent); }
.ebg-all:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.ebg-scroll-label { display:none; }
body[data-page="graphic"]:has(#ebg:not([hidden])) > .scroll-cue--fixed[data-ebg="true"] { display:flex; visibility:visible; pointer-events:auto; }
.scroll-cue--fixed[data-ebg="true"] > [data-i18n="scroll"] { display:none; }
.scroll-cue--fixed[data-ebg="true"] > .ebg-scroll-label { display:block; letter-spacing:normal; }
.design-hero:has(#ebg:not([hidden])) .hero-bottom { visibility:hidden; }
.ebg-viewer { overscroll-behavior:none; }
@keyframes ebg-load { to { rotate:360deg; } }
@media(max-width:700px) {
 .ebg-exhibition { grid-template-rows:clamp(210px,28svh,250px) minmax(0,1fr) auto; }
 .ebg-logo { width:150px; }
 .ebg-controls button { width:48px; height:48px; font-size:36px; }
 .ebg-controls .ebg-previous { left:6px; }
 .ebg-controls .ebg-next { right:6px; }
 .ebg-footer { grid-template-columns:1fr 1fr; justify-items:center; gap:10px; padding:10px 16px max(108px,calc(env(safe-area-inset-bottom) + 88px)); }
 .ebg-drag-hint { grid-column:1 / -1; grid-row:1; font-size:10px; }
 .ebg-all { grid-column:1; grid-row:2; justify-self:start; padding:8px 12px; font-size:11px; }
 .ebg-meta { grid-column:2; grid-row:2; justify-self:end; justify-content:flex-end; gap:8px; }
 .ebg-caption,.ebg-count { font-size:11px; }
}
@media(max-height:550px) and (min-width:701px) {
 .ebg-exhibition { grid-template-rows:100px minmax(0,1fr) auto; }
 .ebg-logo { width:110px; }
 .ebg-brand { padding-bottom:10px; }
 .ebg-footer { padding-top:6px; padding-bottom:90px; }
}
.graphic-static #ebg { min-height:100svh; }
@media(prefers-reduced-motion:reduce) { .ebg-controls button,.ebg-all { transition:none; } .ebg-panel.is-loading::after { animation:none; } }

/* Keep the gallery navigation together on the right, opposite the all-posts action. */
.ebg-navigation { grid-column:3; grid-row:1; justify-self:end; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.ebg-navigation .ebg-controls { position:static; display:flex; justify-content:flex-end; gap:8px; }
.ebg-navigation .ebg-controls button { position:static; translate:none; width:44px; height:44px; font-size:30px; }
.ebg-navigation .ebg-meta { justify-content:flex-end; }
@media(max-width:700px) { .ebg-navigation { grid-column:2; grid-row:2; } .ebg-navigation .ebg-meta { gap:4px; text-align:right; } .ebg-navigation .ebg-caption { text-align:right; } }
