/* ==========================================================================
   Virtual tour player — "Frosted glass" theme
   The player look is neutral and the same for every tour. The client's
   colour (and optional logo) comes from `theme` in tour-data.js, which sets
   --accent / --accent-ink below at runtime.
   ========================================================================== */

/* Inter — SIL Open Font License (assets/fonts/OFL-LICENSE.txt) */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/inter-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/inter-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/inter-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/inter-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/inter-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  /* client theme (overridden from tour-data.js → theme) */
  --accent: #2f5d50;
  --accent-ink: #ffffff;

  /* player — neutral frosted glass */
  --ink: #141414;
  --ink-2: #4a4a4a;            /* secondary text, AA on glass */
  --glass: rgba(255, 255, 255, .74);
  --glass-strong: rgba(255, 255, 255, .92);
  --glass-edge: rgba(255, 255, 255, .65);
  --glass-hover: rgba(0, 0, 0, .06);
  --blur: blur(18px) saturate(1.4);
  --shadow: 0 6px 30px rgba(0, 0, 0, .18);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .28);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #1a1a1a; color: var(--ink); font-family: var(--font); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

.glass {
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

#tour { position: fixed; inset: 0; }
#pano { position: absolute; inset: 0; background: #1a1a1a; }
.pnlm-container { background: #1a1a1a !important; font-family: var(--font) !important; }
.pnlm-load-box { background: var(--glass-strong) !important; color: var(--ink) !important; border-radius: var(--radius) !important; font-family: var(--font) !important; }
.pnlm-lbar { border-color: var(--ink) !important; }
.pnlm-lbar-fill { background: var(--accent) !important; }
.pnlm-about-msg, .pnlm-panorama-info { display: none !important; }

/* ---------- Title lockup (opens "About the exhibition") ---------- */
.brand {
  position: absolute; z-index: 5; top: max(16px, env(safe-area-inset-top)); left: 16px;
  display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100% - 32px));
  padding: 10px 16px 10px 12px; border-radius: var(--radius); color: var(--ink);
  text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.brand:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(0,0,0,.24); }
.brand-logo { height: 40px; width: auto; max-width: 120px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; padding-left: 4px; }
.brand-title { font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; }
.brand-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.brand-more svg { width: 15px; height: 15px; }

/* ---------- First-run hint ---------- */
.hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500; white-space: nowrap; transition: opacity .6s ease; pointer-events: none;
}
.hint.gone { opacity: 0; }
.hint-icon { display: grid; place-items: center; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }

/* ---------- Bottom bar ---------- */
.bar {
  position: absolute; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; max-width: calc(100% - 24px);
}
.where { display: flex; flex-direction: column; align-items: center; min-width: 170px; padding: 0 8px; line-height: 1.2; }
.where-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.where-count { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sep { width: 1px; height: 26px; background: rgba(0,0,0,.14); margin: 0 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 999px; border: 0;
  background: transparent; cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap; transition: background .15s ease, transform .15s ease;
}
.btn.icon { width: 44px; padding: 0; }
.btn:hover { background: var(--glass-hover); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .35; cursor: default; background: transparent; }
.btn.solid { background: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { background: var(--accent); filter: brightness(1.08); }
#hs-toggle[aria-pressed="false"] svg { opacity: .45; }
.lang-btn { font-weight: 700; font-size: 13.5px; letter-spacing: .04em; }

/* ---------- Zoom buttons (bottom right) ---------- */
.zoombox {
  position: absolute; z-index: 5; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; padding: 5px; gap: 2px; border-radius: 26px;
}
.zoombox .btn svg { stroke-width: 2.2; }

body.hotspots-off .hs { opacity: 0; pointer-events: none; }

/* ---------- Hotspots ---------- */
.pnlm-hotspot-base.hs, .pnlm-hotspot-base.ed-pin { z-index: 2; }   /* above Pannellum's drag layer */
.hs { transition: opacity .25s ease; }
.hs-info, .hs-zoom { width: 40px; height: 40px; }
.hs-nav { width: 60px; height: 60px; }
.hs-btn {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer; border-radius: 50%;
}
.hs-btn::after {   /* soft pulse ring */
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85); opacity: 0;
  animation: ring 2.8s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.75); opacity: .9; } 70%,100% { transform: scale(1.35); opacity: 0; } }
.hs-info .hs-btn, .hs-zoom .hs-btn {
  background: rgba(255,255,255,.92); color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 4px 14px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.hs-info .hs-btn:hover, .hs-zoom .hs-btn:hover,
.hs-info .hs-btn:focus-visible, .hs-zoom .hs-btn:focus-visible { transform: scale(1.12); background: var(--accent); color: var(--accent-ink); }
.hs-info svg, .hs-zoom svg { width: 20px; height: 20px; stroke-width: 2.6; }
.hs-nav .hs-btn {
  color: var(--ink); background: rgba(255,255,255,.55); border: 2px solid #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,.28);
  transition: transform .15s ease, background .15s ease;
}
.hs-nav .hs-btn:hover, .hs-nav .hs-btn:focus-visible { background: rgba(255,255,255,.9); transform: scale(1.08); }
.hs-nav svg { width: 26px; height: 26px; stroke-width: 2.4; }
.hs-tip {
  position: absolute; left: 50%; bottom: calc(100% + 28px); transform: translate(-50%, 4px);
  background: var(--glass-strong); color: var(--ink); white-space: nowrap;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  font: 600 13.5px/1.2 var(--font); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.hs-nav .hs-tip { bottom: calc(100% + 36px); }
.hs-btn:hover .hs-tip, .hs-btn:focus-visible .hs-tip { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Dialogs (shared) ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(15, 15, 15, .4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog[open] { animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.close { background: var(--glass-hover); }

/* Explore */
.sheet {
  width: min(940px, calc(100% - 24px)); max-height: min(82vh, 780px); overflow: auto;
  background: rgba(250,250,249,.9); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge); border-radius: 22px; box-shadow: var(--shadow-lg);
}
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 22px; background: rgba(250,250,249,.92); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.sheet h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.stops { list-style: none; margin: 0; padding: 4px 18px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stop {
  display: block; width: 100%; text-align: left; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stop:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06); }
.stop img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e8e8e6; }
.stop span { display: flex; gap: 8px; padding: 10px 12px 12px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.stop b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.stop[aria-current="true"] { box-shadow: 0 0 0 3px var(--accent); }
.stop[aria-current="true"] b { color: var(--accent); }

/* Artwork / text info */
.panel {
  width: min(1040px, calc(100% - 24px)); max-height: calc(100% - 32px); overflow: hidden;
  background: rgba(255,255,255,.95); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: 24px; box-shadow: var(--shadow-lg);
}
.panel[open] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.close.floating { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.85); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.close.floating:hover { background: #fff; }
.info-figure { margin: 0; display: grid; place-items: center; min-height: 0; padding: 28px; background: #efefed; }
.info-figure img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; display: block; box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.info-body { padding: 40px 36px 32px; overflow: auto; max-height: calc(100vh - 32px); }
.info-artist { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.info-title { outline: none; margin: 0 0 16px; font-size: clamp(26px, 3vw, 34px); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.info-orig { margin: -8px 0 16px; font-size: 14px; color: var(--ink-2); }
.info-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; padding: 14px 0; border-block: 1px solid rgba(0,0,0,.1); font-size: 14.5px; }
.info-meta dt { color: var(--ink-2); }
.info-meta dd { margin: 0; }
.info-h3 { margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.info-desc { font-size: 16px; line-height: 1.65; }
.info-desc p { margin: 0 0 1em; }
.info-desc a { color: var(--accent); }
.info-credit { font-size: 13.5px; color: var(--ink-2); margin: 16px 0 0; }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.poem { white-space: pre-line; font-size: 17px; line-height: 1.6; }
.panel.no-image { width: min(640px, calc(100% - 24px)); }
.panel.no-image[open] { display: block; overflow: auto; }
.panel.no-image .info-body { max-height: none; overflow: visible; padding-top: 48px; }

/* Zoom detail — dark surround so the artwork reads true; glass controls */
.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; background: #121212; overflow: hidden; color: #fff; }
.zoom::backdrop { background: #121212; }
.zoom-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.zoom-stage.dragging { cursor: grabbing; }
.zoom-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; will-change: transform; }
.zoom-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 14px 30px 20px; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
.zoom-top > * { pointer-events: auto; }
.zoom-caption { display: flex; flex-direction: column; gap: 3px; padding-top: 8px; }
.zoom-title { font-weight: 700; font-size: 18px; }
.zoom-cap { font-size: 13.5px; color: rgba(255,255,255,.75); }
.zoom .close { background: rgba(255,255,255,.88); color: var(--ink); }
.zoom-tools { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; color: var(--ink); }
.z-level { min-width: 56px; text-align: center; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- Welcome / language chooser ---------- */
.welcome {
  width: min(540px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: clamp(26px, 6vw, 40px) clamp(22px, 5vw, 38px) clamp(24px, 5vw, 34px);
  border-radius: 26px; background: rgba(255,255,255,.8); box-shadow: var(--shadow-lg);
}
.welcome::backdrop { background: rgba(15,15,15,.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.welcome.leaving { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .28s ease, transform .28s ease; }
.welcome-logo { display: block; height: 52px; width: auto; max-width: 200px; object-fit: contain; margin-bottom: 18px; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.06); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.welcome-kicker svg { width: 16px; height: 16px; }
.welcome-title { margin: 0; font-size: clamp(28px, 6vw, 38px); font-weight: 700; line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.welcome-lines { margin: 12px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.welcome-lines span { display: block; }
.welcome-meta { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(0,0,0,.1); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.welcome-prompt { margin: 22px 0 10px; font-size: 14.5px; font-weight: 600; }
.welcome-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 18px; border-radius: 16px; cursor: pointer; text-align: left;
  border: 1px solid rgba(0,0,0,.1); background: #fff; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.choice:hover, .choice:focus-visible { transform: translateY(-2px); background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.choice-main { font-size: 19px; font-weight: 700; }
.choice-sub { font-size: 13px; opacity: .75; }
@media (max-width: 420px) { .welcome-choices { grid-template-columns: 1fr; } }

.fatal { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; margin: 0; background: #f4f4f2; color: var(--ink); z-index: 99; line-height: 1.5; }
.fatal code { background: rgba(0,0,0,.07); padding: 2px 6px; border-radius: 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .brand { left: 12px; top: max(12px, env(safe-area-inset-top)); padding: 8px 12px 8px 10px; max-width: calc(100% - 24px); }
  .brand-logo { height: 32px; }
  .brand-title { font-size: 14px; }
  .brand-more { font-size: 12px; }
  .bar { bottom: max(12px, env(safe-area-inset-bottom)); gap: 0; left: 12px; right: 12px; transform: none; max-width: none; justify-content: space-between; border-radius: 22px; }
  .btn-label { display: none; }
  #menu-btn { width: 44px; padding: 0; }
  #fs-btn { display: none; }
  .where { min-width: 0; flex: 1; overflow: hidden; align-items: stretch; text-align: center; }
  .where-title { max-width: 100%; font-size: 14px; }
  .zoombox { right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px); }
  .hint { white-space: normal; width: max-content; max-width: calc(100% - 40px); font-size: 14px; border-radius: 18px; }
  .panel[open] { display: block; overflow: auto; }
  .info-figure { padding: 18px; }
  .info-figure img { max-height: 52vh; }
  .info-body { padding: 24px 20px 26px; max-height: none; overflow: visible; }
  .hs-nav { width: 54px; height: 54px; }
  .hs-info, .hs-zoom { width: 38px; height: 38px; }
}
@media (pointer: coarse) { .hs-tip { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hs-btn::after, .hint-icon { animation: none; }
  dialog[open] { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: rgba(255,255,255,.97); --glass-strong: #fff; }
}
