/* NAV (2026-11-15): the easy-navigation layer (nav-touch.js). Big touch targets (never under 44 px), the zoom column, Home, the doorway labels, the one-time hint.
   Loaded after walk.css and aria.css. Gentle mode / reduced motion: nothing here moves or fades (see the end of the file; nav-touch.js also adds the class nav-calm for ?reduce=1). */
:root { --nav-btn: 48px; --nav-zoom: 54px; --nav-accent: #e0a464; --nav-bottom: 76px; }

/* the page and the 3D view never zoom or scroll by themselves: the finger belongs to the 3D view */
html, body { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
#view, #controls, #zoombar, .nav-labels, .nav-hint, .nav-toast { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#list, #panel, .hud-drawer { touch-action: pan-y; }
#controls button, #zoombar button { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* ---- the zoom column: right edge, just above the Walk / Home row, where the thumb rests (the middle of the screen stays free for two-finger pinches). A tap = a step, holding = a steady glide. */
#zoombar { position: fixed; z-index: 9; right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--nav-bottom) + var(--nav-btn) + 14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
#zoombar button { width: var(--nav-zoom); height: var(--nav-zoom); min-height: var(--nav-zoom); padding: 0; justify-content: center; font-size: 30px; font-weight: 700; line-height: 1; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255, 240, 220, .3); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
#zoombar button:active { background: rgba(224, 164, 100, .35); border-color: var(--nav-accent); }

/* ---- the bottom row: Home, the Walk / Look around button (free roam adds it on touch screens), the turn buttons on wide screens */
#controls { right: max(12px, env(safe-area-inset-right)); gap: 8px; align-items: stretch; }
#controls button { min-height: var(--nav-btn); height: var(--nav-btn); }
#controls #tleft, #controls #tright { width: var(--nav-btn); font-size: 24px; }
#controls #home-btn, #controls #places-btn { width: auto; min-width: 62px; padding: 0 12px; justify-content: center; font-size: 16px; font-weight: 800; letter-spacing: .02em; background: var(--panel); border: 1px solid rgba(255, 240, 220, .3); }
#controls #places-btn { min-width: 76px; order: 0; } #controls button.fr-walk { order: 1; } #controls #home-btn { order: 2; } #controls #tleft { order: 3; } #controls #tright { order: 4; }   /* left to right: Go to, Walk / Look around, Home, turn left, turn right */
#controls #places-btn[aria-expanded="true"] { border-color: var(--nav-accent); background: rgba(224, 164, 100, .22); }
#controls button.fr-walk { width: auto; min-width: 116px; padding: 0 12px; justify-content: center; font-size: 16px; font-weight: 800; letter-spacing: .02em; color: #1a120a; background: var(--nav-accent); border: 2px solid #f6c88c; box-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
#controls button.fr-walk[aria-pressed="true"] { color: var(--ink); background: rgba(20, 18, 16, .92); border-color: var(--nav-accent); }
#controls button:active, #home-btn:active { filter: brightness(1.25); }

/* ---- the Go to list (the rooms and the hall's landmarks), the ring under the mouse and the goal marker */
.nav-places { position: fixed; z-index: 14; right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--nav-bottom) + var(--nav-btn) + 14px + env(safe-area-inset-bottom)); width: min(330px, calc(100vw - 24px)); max-height: min(72vh, calc(100vh - var(--nav-bottom) - var(--nav-btn) - 160px)); overflow: auto; overscroll-behavior: contain; padding: 10px 12px 12px; border-radius: 16px; background: rgba(22, 19, 16, .96); border: 1px solid rgba(255, 240, 220, .22); box-shadow: 0 8px 30px rgba(0, 0, 0, .6); touch-action: pan-y; }
.np-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.np-head h2 { margin: 0; font-size: 19px; }
.np-close { min-height: 44px; padding: 0 14px; }
.np-sec h3 { margin: 10px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.np-sec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.np-item { width: 100%; min-height: 48px; justify-content: flex-start; text-align: left; font-size: 17px; font-weight: 650; padding: 0 14px; }
.np-item[aria-current="page"] { border-color: var(--nav-accent); background: rgba(224, 164, 100, .18); }
.np-here { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--nav-accent); }
.nav-aim { position: fixed; z-index: 8; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid rgba(255, 226, 176, .92); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; }
.nav-goal { position: fixed; z-index: 8; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid var(--nav-accent); box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); pointer-events: none; }
.nav-goal::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--nav-accent); }

/* ---- the Menu button says Menu (nav-touch.js puts the word beside the three lines) */
.hud-burger.nav-labelled { width: auto; min-width: 44px; height: 44px; padding: 0 14px 0 12px; display: flex; flex-direction: row; align-items: center; gap: 10px; }
.hud-burger .nav-bars { display: grid; gap: 5px; width: 22px; height: auto; background: none; border-radius: 0; }
.hud-burger .nav-menu-word { width: auto; height: auto; background: none; border-radius: 0; font: 800 16px/1 system-ui, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .02em; color: var(--ink); }
#bar .tools { margin-right: 112px; }
body.nav-show .hud-burger.nav-labelled, body.hud-open .hud-burger.nav-labelled { width: 44px; padding: 0; justify-content: center; }   /* the drawer's Close button sits next to it: same small footprint as before while the drawer is open */
body.nav-show .hud-burger .nav-menu-word, body.hud-open .hud-burger .nav-menu-word { display: none; }   /* while a show runs the word goes too: the show's own pill sits at the top */

/* ---- big doorway labels (touch screens). They float over each door in view; a tap on one goes in. They never take a touch themselves. */
.nav-labels { position: fixed; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.nav-door { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: rgba(20, 18, 16, .86); border: 2px solid var(--nav-accent); color: #fff6ea; font: 800 17px/1.1 system-ui, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 2px 12px rgba(0, 0, 0, .55); transition: opacity .18s ease; will-change: transform, opacity; }
.nav-door.back { border-color: rgba(255, 246, 234, .6); }

/* ---- the one-time hint, the toast and the tap ring */
.nav-hint { position: fixed; z-index: 31; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(310px, calc(100vw - 48px)); padding: 16px 20px; border-radius: 18px; text-align: center; background: rgba(20, 18, 16, .9); border: 2px solid var(--nav-accent); box-shadow: 0 6px 28px rgba(0, 0, 0, .6); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.nav-hint.in { opacity: 1; } .nav-hint.gone { opacity: 0; }
.nav-hint p { margin: 5px 0; font: 700 19px/1.3 system-ui, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); }
.nav-toast { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-bottom) + var(--nav-btn) + 22px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 100px); padding: 11px 18px; border-radius: 999px; background: rgba(20, 18, 16, .92); border: 2px solid var(--nav-accent); color: #fff6ea; font: 700 16px/1.25 system-ui, "Segoe UI", Roboto, Arial, sans-serif; text-align: center; pointer-events: none; }
.nav-ring { position: fixed; z-index: 8; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; border: 3px solid var(--nav-accent); box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); pointer-events: none; }
.nav-ring.go { animation: nav-ring .65s ease-out both; }
@keyframes nav-ring { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }

/* ---- touch screens: every button at least 44 px, the room strip too */
@media (pointer: coarse) {
  #bar button, #bar .btn, #list button, #panel button, #panel .btn, .hud-drawer button, .hud-drawer .btn, .hud-drawer select, #settings select, #panel-close { min-height: 44px; }
  #panel-close { width: 44px; height: 44px; }
  #settings .check, .hud-drawer .check { min-height: 44px; }
  #settings input[type=checkbox], .hud-drawer input[type=checkbox] { width: 24px; height: 24px; }
}

/* ---- phone (the same breakpoint as walk.css) */
@media (max-width: 760px) {
  :root { --nav-bottom: 76px; }
  #controls { bottom: calc(var(--nav-bottom) + env(safe-area-inset-bottom)); }
  #controls #tleft, #controls #tright { display: none; }                 /* dragging looks round; the turn buttons stay on wider screens and the arrow keys always work */
  #list { transform: translateY(calc(100% - 72px)); }
  #list #rooms button { min-height: 44px; }
  .status { left: var(--gutter); right: auto; bottom: 140px; max-width: calc(100vw - 100px); }
}
@media (min-width: 761px) {
  :root { --nav-bottom: 54px; }
  #controls { bottom: var(--nav-bottom); }
  #zoombar { right: var(--gutter); }
  .status { right: 84px; bottom: 104px; }
  .nav-toast { bottom: calc(var(--nav-bottom) + var(--nav-btn) + 18px); }
}

/* ---- Gentle mode / reduced motion: nothing fades, nothing pulses (the page also sets nav-calm on <html> when its own ?reduce=1 switch is on) */
@media (prefers-reduced-motion: reduce) {
  .nav-hint, .nav-door { transition: none; animation: none; }
  .nav-ring, .nav-ring.go { animation: none; }
}
.nav-calm .nav-hint, .nav-calm .nav-door { transition: none; animation: none; }
.nav-calm .nav-ring, .nav-calm .nav-ring.go { animation: none; }

/* ---- the Go to list on a wide screen: rooms on the left, the hall's landmarks on the right, so all of it is in view without scrolling */
@media (min-width: 761px) {
  .nav-places { width: min(740px, calc(100vw - 32px)); display: grid; grid-template-columns: 1.8fr 1fr; column-gap: 18px; align-content: start; max-height: calc(100vh - var(--nav-bottom) - var(--nav-btn) - 76px); }
  .np-head { grid-column: 1 / -1; }
  .np-sec:first-of-type ul { grid-template-columns: 1fr 1fr; }   /* the rooms in two columns, the landmarks beside them */
  .np-item { font-size: 16px; flex-wrap: wrap; row-gap: 0; }
}
@media (min-width: 761px) and (pointer: fine) { .np-item { min-height: 44px; } }
