/* Step inside Thornhaven: the Scrollcraft look (2026-10-30).
   Chrome, tokens and buttons come from ../maps.css. Every control here is at
   least 44px on a phone, and nothing on the map is too small to tap. */
:root { --glass: rgb(8 8 10 / .82); --app-h: calc(100svh - 100px); --aside: 360px; }
button { cursor: pointer; }
button:disabled { cursor: default; }

/* ---------------------------------------------------------------- layout */
/* on a desktop the panel is as tall as the painting needs and no taller, so the whole village shows */
.explorer { display: grid; grid-template-columns: var(--aside) minmax(0, 1fr); height: min(var(--app-h), calc((100vw - var(--aside)) * .5628)); min-height: 520px; border-top: 1px solid var(--line); }
aside { padding: 22px 28px 28px; border-right: 1px solid var(--line); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
        background: radial-gradient(120% 50% at 0% 0%, rgb(240 170 90 / .07), transparent 60%), var(--sc-canvas); }
aside .crumbs { margin: -6px 0 10px; }
aside .eyebrow { margin-top: 6px; }
aside h1 { margin: 10px 0 14px; font-size: clamp(44px, 1.6rem + 1.6vw, 58px); line-height: 1; }
aside h1 em { color: var(--honey-2); }
.intro { font-size: 15px; line-height: 1.55; color: var(--silver); font-weight: 300; margin: 0 0 22px; }
.read-label { display: block; font-size: 13px; font-weight: 500; color: var(--honey); margin: 0 0 8px; }
.select-wrap { position: relative; margin-bottom: 18px; }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid var(--silver); border-bottom: 1.5px solid var(--silver); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select { width: 100%; height: 48px; padding: 0 44px 0 18px; appearance: none; -webkit-appearance: none; background: var(--card-2); color: #fff; border: 0; border-radius: 9999px;
         box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; cursor: pointer; }
select:hover { box-shadow: inset 0 0 0 1px #777a88; }
#place-list { display: flex; flex-direction: column; }
.place-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%; min-height: 50px; padding: 10px 6px;
              background: none; border: 0; border-top: 1px solid var(--line); color: #fff; font: 400 22px/1.15 var(--sc-font-display); transition: color 160ms, padding 200ms var(--ease); }
.place-link:last-child { border-bottom: 1px solid var(--line); }
.place-link small { font: 500 12px/1.2 var(--sc-font-text); color: var(--honey); white-space: nowrap; }
.place-link:hover, .place-link.selected { color: var(--honey-2); padding-left: 12px; }
.place-link.locked { color: var(--mute); }
.place-link.locked small { color: var(--dim); }
.guide-foot { font-size: 13px; line-height: 1.7; color: var(--dim); margin: 20px 0 0; }

/* ---------------------------------------------------------------- map */
.map-panel { position: relative; min-width: 0; overflow: hidden; background: #070a14; }
.viewport { overflow: auto; cursor: grab; scrollbar-width: none; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.viewport::-webkit-scrollbar { display: none; }
.viewport.dragging { cursor: grabbing; user-select: none; }
#map-viewport { height: 100%; }
.map-canvas { position: relative; width: 100%; margin: 0 auto; }
.map-canvas > img { width: 100%; display: block; height: auto; user-select: none; -webkit-user-drag: none; }
#buildings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.place-g { cursor: pointer; }
.building-hit { fill: transparent; stroke: transparent; stroke-width: 5; transition: fill .2s, stroke .2s; }
.place-g.hover .building-hit, .building-hit:focus, .building-hit.active { fill: #ffe5a52e; stroke: #ffe5a5; outline: none; filter: drop-shadow(0 0 8px #efc67e); }
.building-hit.active { fill: #ffe5a514; stroke-width: 3; }
.label-hit { fill: transparent; }
.label-dot { fill: #F2C46E; stroke: #08080a; stroke-width: 4; filter: drop-shadow(0 0 6px #f2c46eaa); }
.map-label { fill: #fff6e3; stroke: #08080a; stroke-width: 6; paint-order: stroke; stroke-linejoin: round; font-family: "Inter", system-ui, sans-serif; font-weight: 500; font-size: 29px; }
.place-g.hover .map-label, .place-g.active .map-label { fill: #F0C27E; }
.place-g.locked .label-dot { fill: #6b6e7a; filter: none; }
.place-g.locked .map-label { fill: #b9bbc5; }

.chip { position: absolute; left: 18px; top: 18px; height: 44px; padding: 0 18px; border: 0; border-radius: 9999px; background: var(--glass); color: #fff; font-size: 14px; font-weight: 500;
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -10px #000; }
.chip:hover { box-shadow: inset 0 0 0 1px #777a88; }
.map-note { position: absolute; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 44px; border-radius: 9999px; background: var(--glass);
            -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; color: var(--silver); pointer-events: none; max-width: calc(100% - 250px); }
#map-caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lamp-dot { width: 7px; height: 7px; flex: none; background: #F2C46E; border-radius: 50%; box-shadow: 0 0 12px 3px rgb(242 196 110 / .6); }
.zoom-controls { display: flex; align-items: center; height: 44px; border-radius: 9999px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
                 box-shadow: inset 0 0 0 1px var(--line-2); }
.map-panel > .zoom-controls { position: absolute; right: 18px; bottom: 18px; }
.zoom-controls button { height: 44px; min-width: 44px; background: transparent; color: #fff; border: 0; padding: 0 14px; font-size: 13px; font-weight: 500; }
.zoom-controls button:first-child, .zoom-controls button:last-child { font-size: 20px; }
.zoom-controls button:hover:not(:disabled) { background: rgb(255 255 255 / .08); }
.zoom-controls button:disabled { opacity: .35; }
.guide-hidden .explorer { grid-template-columns: 1fr; --aside: 0px; }
.guide-hidden aside { display: none; }

/* ---------------------------------------------------------------- dialogs */
dialog { color: var(--sc-ink); border: 0; border-radius: 16px; padding: 0; background: #0e0f12; box-shadow: 0 0 0 1px var(--line-2), 0 40px 120px -20px #000; }
dialog::backdrop { background: rgb(4 5 8 / .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog h2 { font-size: clamp(32px, 1.4rem + 1.4vw, 44px); line-height: 1.04; margin: 6px 0 14px; }
.close-icon { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--glass); color: #fff; font-size: 26px; line-height: 1; z-index: 5;
              box-shadow: inset 0 0 0 1px var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.close-icon:hover { background: #fff; color: #08080a; }
#place-dialog { width: min(900px, calc(100% - 32px)); max-height: 90dvh; overflow: auto; }
#place-dialog[open] { display: grid; grid-template-columns: 42% 58%; }
.detail-image { min-height: 460px; background-color: #070a14; background-repeat: no-repeat; background-size: 600% auto; }
.detail-body { padding: 40px 36px 32px; }
.detail-body > p { color: var(--silver); line-height: 1.6; font-size: 15px; font-weight: 300; }
blockquote { margin: 22px 0; padding-left: 18px; border-left: 1px solid var(--honey); }
blockquote p { margin: 0 0 8px; font: italic 20px/1.4 var(--sc-font-display); color: var(--cream); }
cite { font: 12px/1.5 var(--sc-font-text); font-style: normal; color: var(--mute); }
.gold-button { width: 100%; height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 22px; border: 0; border-radius: 9999px;
               background: #fff; color: #08080a; font-size: 15px; font-weight: 500; text-align: left; transition: background 180ms; }
.gold-button:hover { background: #e9e6df; }
.gold-button.unlock { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--honey); }
.gold-button.unlock:hover { background: rgb(227 174 98 / .12); }
.gold-button.open-air { background: transparent; color: var(--silver); box-shadow: inset 0 0 0 1px var(--line-2); }
.gold-button.open-air:hover { box-shadow: inset 0 0 0 1px #777a88; }
.exterior-button { display: flex; align-items: center; width: 100%; height: 50px; margin: 0 0 12px; padding: 0 22px; border: 0; border-radius: 9999px; color: #fff; background: transparent;
                   box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; font-weight: 500; text-align: left; }
.exterior-button:hover { box-shadow: inset 0 0 0 1px #777a88; }
.exterior-button[hidden] { display: none; }
#place-dialog.has-exterior[open] { grid-template-columns: 1fr; }
#place-dialog.has-exterior .detail-image { height: 300px; min-height: 0; }
#place-dialog.has-exterior .detail-body { padding: 26px 34px 30px; }
#place-dialog.has-exterior blockquote { margin: 16px 0; }

/* interior */
#interior-dialog { width: calc(100% - 32px); max-width: 1600px; height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
#interior-dialog[open] { display: flex; flex-direction: column; }
.interior-header { position: relative; display: flex; align-items: center; gap: 24px; padding: 16px 72px 16px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.interior-header h2 { font-size: clamp(24px, 1rem + 1vw, 32px); margin: 2px 0 0; }
.interior-titles { min-width: 0; }
.back-button { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 9999px; background: #fff; color: #08080a; font-size: 15px; font-weight: 500; white-space: nowrap;
               box-shadow: 0 10px 24px -10px #000; flex: none; }
.back-button:hover { background: #e9e6df; }
.back-button .exit-ico { font-size: 18px; line-height: 1; }
#interior-close { top: 50%; transform: translateY(-50%); right: 16px; width: 48px; height: 48px; }
.room-viewport { min-height: 0; flex: 1; background: #070a14; }
.room-canvas { position: relative; height: 100%; width: max-content; min-width: 0; margin: 0 auto; }
.room-canvas > img { display: block; height: 100%; width: auto; max-width: none; min-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
#room-hotspots { position: absolute; inset: 0; }
.room-hotspot { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(8 8 10 / .72); color: #F2C46E; font-size: 22px; line-height: 1;
                box-shadow: inset 0 0 0 2px #F2C46E, 0 0 22px 2px rgb(242 196 110 / .45); animation: breathe 2.8s ease-in-out infinite; }
.room-hotspot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.room-hotspot:hover, .room-hotspot:focus-visible, .room-hotspot.on { background: #F2C46E; color: #08080a; animation: none; }
@keyframes breathe { 50% { box-shadow: inset 0 0 0 2px #F2C46E, 0 0 30px 8px rgb(242 196 110 / .6); } }
.interior-footer { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid var(--line); flex-shrink: 0; }
.room-look-controls { display: flex; gap: 8px; align-items: center; }
.room-look-controls > button { height: 44px; padding: 0 16px; border: 0; border-radius: 9999px; background: transparent; color: #fff; font-size: 14px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; }
.room-look-controls > button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #777a88; }
.room-look-controls > button:disabled { opacity: .35; }
.room-nav { display: flex; align-items: center; gap: 10px; }
.room-nav button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 16px; }
.room-nav button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #777a88; }
.room-nav button:disabled { opacity: .25; }
.room-nav button[hidden] { display: none; }
#room-count { font-size: 13px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.room-nav .exit-end { width: auto; border-radius: 9999px; padding: 0 20px; background: #fff; color: #08080a; box-shadow: none; font-weight: 500; font-size: 14px; white-space: nowrap; }
.room-nav .exit-end:hover { background: #e9e6df; }
.room-note { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(470px, calc(100% - 28px)); padding: 22px 52px 22px 24px; border-radius: 14px;
             background: rgb(14 15 18 / .96); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px rgb(227 174 98 / .5), 0 30px 60px -20px #000; }
.room-note h3 { font-size: 28px; line-height: 1.05; margin: 0 0 10px; }
.room-note p { font: italic 19px/1.45 var(--sc-font-display); color: var(--cream); margin: 0 0 10px; }
.room-note > button { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: #fff; font-size: 24px; }
.room-note > button:hover { background: rgb(255 255 255 / .08); }
.room-note[hidden] { display: none; }
.detail-menu { max-height: calc(100% - 190px); overflow: auto; }
#detail-list { display: flex; flex-direction: column; }
#detail-list > button { text-align: left; min-height: 46px; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: #fff; font-size: 15px; }
#detail-list > button:hover { color: var(--honey-2); }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 1100px) {
  :root { --aside: 300px; }
  aside { padding: 20px 22px; }
  .interior-footer { flex-wrap: wrap; }
  .room-look-controls { flex: 1 0 100%; justify-content: center; }
  .room-note { bottom: 140px; }
}
/* ---------------------------------------------------------------- phones: the guide stacks above a tall map */
@media (max-width: 760px) {
  .explorer { display: block; height: auto; min-height: 0; }
  aside { border-right: 0; overflow: visible; padding: 14px var(--pad) 14px; }
  aside h1 { font-size: 42px; margin-bottom: 10px; }
  aside h1 br { display: none; }
  aside h1 em { margin-left: 8px; }
  .intro { margin-bottom: 16px; }
  #place-list { flex-direction: row; overflow-x: auto; gap: 8px; padding: 2px var(--pad) 6px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; scroll-snap-type: x proximity; }
  #place-list::-webkit-scrollbar { display: none; }
  .place-link { width: auto; flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 9999px; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 14px/1 var(--sc-font-text); white-space: nowrap; scroll-snap-align: start; }
  .place-link:last-child { border-bottom: 0; }
  .place-link:hover, .place-link.selected { padding-left: 16px; color: #08080a; background: #fff; }
  .place-link small { display: none; }
  .place-link.locked { box-shadow: inset 0 0 0 1px var(--line); }
  .guide-foot { display: none; }
  .map-panel { height: 64svh; min-height: 420px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  #guide-toggle { display: none; }
  .map-note { left: 10px; bottom: 10px; max-width: calc(100% - 200px); padding: 0 14px; font-size: 12px; }
  .map-panel > .zoom-controls { right: 10px; bottom: 10px; }
  .zoom-controls button { padding: 0 12px; }
  #place-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  #place-dialog[open] { display: block; }
  .detail-image { min-height: 0; height: 220px; background-size: 460% auto; }
  #place-dialog.has-exterior .detail-image { height: 210px; }
  .detail-body, #place-dialog.has-exterior .detail-body { padding: 22px 20px 24px; }
  #interior-dialog { width: 100%; height: 100dvh; max-height: 100dvh; max-width: 100%; border-radius: 0; margin: 0; }
  .interior-header { padding: 10px 64px 10px 10px; gap: 12px; }
  .back-button { height: 44px; padding: 0 16px; font-size: 14px; }
  .interior-header h2 { font-size: 21px; }
  .interior-header .eyebrow { font-size: 12px; }
  #interior-close { right: 10px; width: 44px; height: 44px; }
  .interior-footer { padding: 10px; gap: 8px; justify-content: space-between; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .room-look-controls { justify-content: space-between; }
  .room-look-controls > button { padding: 0 12px; }
  .interior-footer .zoom-controls button { padding: 0 10px; }
  .room-note { bottom: 150px; max-height: calc(100% - 250px); overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
