/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5
   Genre: editorial · Tone: utilitarian travel field guide · Anchor: terracotta
   Macrostructure: Map / Diagram · theme: Almanac · nav: N9 · footer: Ft2 */
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; overflow-x: clip; background: var(--color-paper); color: var(--color-ink); }
body { font-family: var(--font-body); }
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: .2rem solid var(--color-route); outline-offset: .2rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }

.masthead { display: flex; align-items: start; justify-content: space-between; gap: var(--space-sm); padding: max(var(--space-sm), env(safe-area-inset-top)) var(--space-sm) var(--space-lg); }
.kicker { margin: 0 0 var(--space-2xs); color: var(--color-route); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
h1 { max-width: 8ch; font-size: clamp(2.7rem, 13vw, 6rem); line-height: .93; letter-spacing: -.055em; }
h2 { font-size: clamp(1.6rem, 6vw, 2.8rem); line-height: 1; }
.grid-toggle, .gallery-bar button { min-height: 2.75rem; border: 1px solid var(--color-ink); border-radius: 999px; background: transparent; padding: var(--space-2xs) var(--space-sm); white-space: nowrap; cursor: pointer; }
.grid-toggle:hover, .gallery-bar button:hover { background: var(--color-ink); color: var(--color-paper); }

.map-panel { position: relative; border-block: 1px solid var(--color-ink); background: radial-gradient(circle at 70% 22%, var(--color-paper-deep), transparent 38%); }
.map-copy { position: absolute; z-index: 2; top: var(--space-sm); left: var(--space-sm); width: min(18rem, 58vw); pointer-events: none; }
.map-copy p, .library-head p { margin: var(--space-2xs) 0 0; color: var(--color-muted); font-size: .8rem; line-height: 1.45; }
.map { min-height: min(72rem, 118vw); }
.map svg { display: block; width: 100%; height: auto; }
.route-line { fill: none; stroke: var(--color-route); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 15; }
.route-underlay { fill: none; stroke: var(--color-paper-deep); stroke-width: 23; stroke-linecap: round; stroke-linejoin: round; }
.route-stop { fill: var(--color-paper); stroke: var(--color-ink); stroke-width: 2; }
.route-label { font-family: var(--font-body); font-size: 17px; font-weight: 600; fill: var(--color-ink); }
.map-marker { cursor: pointer; }
.map-marker .marker-ring { fill: var(--color-route); stroke: var(--color-route-ink); stroke-width: 5; }
.map-marker:focus-visible { outline: none; }
.map-marker:focus-visible .marker-ring { stroke: var(--color-ink); stroke-width: 8; }
.map-marker:active .marker-ring { stroke-width: 3; }
.map-marker image { clip-path: circle(31px at center); }
.map-marker text { font-family: var(--font-body); font-size: 18px; font-weight: 700; fill: var(--color-ink); paint-order: stroke; stroke: var(--color-paper); stroke-width: 6; stroke-linejoin: round; }

.library { padding: var(--space-xl) var(--space-sm); }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-sm); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-ink); }
.location-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); width: 100%; min-height: 7rem; padding: var(--space-sm) 0; border: 0; border-bottom: 1px solid var(--color-paper-deep); background: transparent; text-align: left; cursor: pointer; }
.location-row:hover .location-name { color: var(--color-route); }
.location-row img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 50%; }
.location-name { display: block; font-family: var(--font-display); font-size: clamp(1.5rem, 6vw, 2.5rem); line-height: 1; }
.location-note { display: block; margin-top: var(--space-2xs); color: var(--color-muted); font-size: .75rem; }
.location-count { min-width: 3rem; color: var(--color-route); font-family: var(--font-display); font-size: 2rem; text-align: right; }
footer { padding: var(--space-sm); border-top: 1px solid var(--color-ink); color: var(--color-muted); font-size: .72rem; }
footer a, .gallery-meta a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
footer a:hover, .gallery-meta a:hover { color: var(--color-route); }
footer a:active, .gallery-meta a:active { color: var(--color-ink); }

.gallery { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-ink); color: var(--color-paper); }
.gallery::backdrop { background: var(--color-ink); }
.gallery[open] { display: grid; grid-template: auto minmax(0, 1fr) auto / 3.5rem minmax(0, 1fr) 3.5rem; }
.gallery-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: max(var(--space-sm), env(safe-area-inset-top)) var(--space-sm) var(--space-sm); }
.gallery-bar p, .gallery-bar strong { margin: 0; }
.gallery-bar p { color: var(--color-paper-deep); font-size: .72rem; }
.gallery-bar button { border-color: var(--color-paper); color: var(--color-paper); }
.gallery-bar button:hover { background: var(--color-paper); color: var(--color-ink); }
.viewer-stage { grid-column: 2; align-self: center; justify-self: center; position: relative; display: inline-grid; margin: 0; max-width: 100%; max-height: 100%; box-shadow: var(--shadow-lift); }
.viewer-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 11rem); width: auto; height: auto; }
.thirds-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.thirds-grid line { vector-effect: non-scaling-stroke; stroke: var(--color-grid); stroke-width: 1; }
body.grid-off .thirds-grid { display: none; }
.step { align-self: stretch; border: 0; background: transparent; color: var(--color-paper); font-family: var(--font-display); font-size: 3rem; cursor: pointer; }
.step:hover { color: var(--color-route); }
.gallery-meta { grid-column: 1 / -1; min-height: 3.5rem; padding: var(--space-xs) var(--space-sm) max(var(--space-xs), env(safe-area-inset-bottom)); color: var(--color-paper-deep); font-size: .72rem; text-align: center; }

@media (min-width: 52rem) {
  .masthead { padding-inline: var(--space-lg); }
  .map-copy { left: var(--space-lg); }
  .map { min-height: 46rem; }
  .library { padding-inline: var(--space-lg); }
  .location-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-xl); }
}
@media (max-width: 30rem) {
  .masthead { flex-direction: column; }
  .grid-toggle { align-self: flex-end; }
  .gallery[open] { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; }
  .location-row { grid-template-columns: 4rem minmax(0, 1fr) auto; }
  .location-row img { width: 4rem; height: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
