/* Raconteur Road — Tracks page.
   Same literary-press palette as the coming-soon page. No tile-based basemap;
   the world is drawn as faint country outlines on paper. */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Newsreader-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Newsreader-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

:root {
  --paper: #fafaf8;
  --paper-warm: #f4f1ea;
  --ink: #1a1a1a;
  --rule: #d8d3c8;
  --pencil: #b8b0a0;
  --accent: #6b5d4f;
  --quiet: #4a4a4a;
  --amber: #a87a3c;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page header (top of /tracks/). Direct-child selector so the
   modal's <header class="modal-handle"> deep inside doesn't
   inherit position: fixed + top: 0 and yank itself out of the
   modal to the top of the page. */
body > header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  padding: 0 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  /* iOS Safari composites the MapLibre WebGL canvas over fixed overlays regardless
     of z-index, so the mobile hamburger dropdown opened *behind* the map. Promote the
     header (and its dropdown subtree) onto its own GPU layer so it paints above the canvas. */
  transform: translateZ(0);
}

.wordmark {
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  margin: 0;
}
.wordmark a {
  color: inherit;
  text-decoration: none;
}
.wordmark a:hover {
  color: var(--accent);
}

/* Top-right nav-links shared with /book/ and /journeys/ so the three
   surfaces all carry the same navigation. */
.nav-links {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
}
.nav-links a {
  color: var(--quiet);
  text-decoration: none;
  margin-left: 1rem;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
}
/* Belt-and-suspenders for the iOS map-canvas issue: give the mobile dropdown its own
   compositing layer too, so it sits above the WebGL canvas. */
body > header .nav-links { transform: translateZ(0); }

/* Mode toggle (sits at the top of .cat-panel below the header).
   Same visual language as the .cat-btn selector below it for
   consistency: mono labels, low-key chrome, active state inverts. */
.mode-toggle {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}
.mode-btn {
  flex: 1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--quiet);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 1px;
  text-align: center;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  color: var(--ink);
  background: var(--paper-warm);
  border-color: var(--rule);
}

#map {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: var(--paper);
}

/* Shown in place of the map when WebGL is unavailable (e.g. Windows-on-ARM GPU block-list). */
.map-fallback {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  text-align: center;
  color: var(--ink);
}
.map-fallback h2 { font-family: 'Newsreader', Georgia, serif; font-weight: 400; margin: 0 0 .8rem; }
.map-fallback p { line-height: 1.6; margin: 0 0 .8rem; }
.map-fallback a { color: inherit; }

/* MapLibre tweaks — keep it quiet. */
.maplibregl-canvas-container,
.maplibregl-canvas { background: var(--paper); }
.maplibregl-ctrl-attrib {
  background: rgba(250, 250, 248, 0.85) !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem !important;
  color: var(--quiet);
}
.maplibregl-ctrl-attrib a {
  color: var(--accent);
}
.maplibregl-ctrl-bottom-right { display: none; }  /* hide attribution to keep the aesthetic; will re-add a discreet credit elsewhere */

/* Category panel: selector + stats + heatmap legend stacked at the
   bottom-left of the map. Single container so the three children
   share width + alignment + a single backing panel. */
.cat-panel {
  position: fixed;
  left: 1.5rem;
  bottom: 1rem;
  /* Above the modal (z-index: 20) so the mode + category buttons
     remain clickable when the modal is open and stretched tall on
     mobile, where the modal can extend down over the cat-panel
     area. The cat-panel has a translucent paper background, so it
     reads as floating in front of the modal rather than colliding. */
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(250, 250, 248, 0.92);
  padding: 0.4rem 0.5rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 1px;
  min-width: 11rem;
}

/* Category selector. Acts as both filter and key. */
.categories {
  display: flex;
  gap: 0.2rem;
}
.cat-btn {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--quiet);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  border-radius: 1px;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.cat-btn:hover { color: var(--ink); }
.cat-btn.active {
  color: var(--ink);
  background: var(--paper-warm);
  border-color: var(--rule);
}
.cat-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 2px;
  flex-shrink: 0;
}
/* All swatches share the cycling gradient -- v68 uniform-style: every
   category renders in the same red->yellow palette. */
.cat-swatch-biking,
.cat-swatch-unimog,
.cat-swatch-other {
  background: linear-gradient(to right, #7a0c0c, #c5471d, #fc7404, #ffd60a);
}

/* Per-category stats: km totals + ride counts. Vertical when "All" is
   selected (3 lines), single line otherwise. updateStats() in tracks.js
   sets the content. */
.cat-stats {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--quiet);
  line-height: 1.5;
  white-space: pre-line;
  padding: 0.2rem 0.1rem;
  border-top: 1px solid var(--rule);
}
.cat-stats .stats-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.cat-stats .stats-label { color: var(--ink); }
.cat-stats .stats-value { color: var(--quiet); }

/* Heatmap density legend. Gradient bar + low/high labels. The bar's
   background is set by updateLegend() in tracks.js to match the
   currently-selected category's color stops. */
.heatmap-legend {
  border-top: 1px solid var(--rule);
  padding-top: 0.35rem;
}
.legend-bar {
  height: 6px;
  width: 100%;
  border-radius: 1px;
  background: linear-gradient(to right, #7a0c0c, #c5471d, #fc7404, #ffd60a);
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  color: var(--quiet);
  margin-top: 0.15rem;
}

/* Content modal: a floating card pinned to top-right by default and
   draggable by the handle bar. No full-viewport backdrop -- the map
   stays fully visible and interactive while the modal is open so the
   reader can see where the pebble they're viewing actually sits. */
.modal {
  position: fixed;
  top: calc(var(--header-h) + 0.75rem);
  right: 1rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - var(--header-h) - 1.5rem);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 20;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.modal[aria-hidden="false"] { display: flex; }
/* Drag bar: darker than the photo + paper body below it so the handle
   reads as a distinct grabbable region, not as a margin. Ink fill,
   paper-warm content. */
.modal-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.1rem;
  padding: 0 0.6rem;
  background: var(--ink);
  color: var(--paper-warm);
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.modal-handle-grip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--paper-warm);
}
.modal-handle-grip svg { display: block; }
.modal-handle-text {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--paper-warm);
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--paper-warm);
  cursor: pointer;
  padding: 0 0.35rem;
}
.modal-close:hover { color: var(--paper); }
.modal-thumb {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--rule);
}
.modal-body {
  padding: 0.7rem 0.9rem 0.9rem;
  overflow: auto;
  flex: 1;
}
.modal-title {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.modal-meta {
  margin: 0 0 0.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  color: var(--quiet);
}
.modal-caption {
  margin: 0 0 0.8rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--quiet);
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.modal-link {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--paper);
  background: var(--ink);
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--ink);
  border-radius: 1px;
  text-decoration: none;
  transition: opacity 0.12s;
}
.modal-link:hover { opacity: 0.85; }
.modal-link-secondary {
  background: transparent;
  color: var(--ink);
}

/* Prev / next navigation row at the bottom of the modal. Splits the
   width 50/50 so the row reads as a single segmented control. The
   arrow keys nav the modal too (keyboard handler in tracks.js). */
.modal-nav {
  display: flex;
  border-top: 1px solid var(--rule);
  margin-top: 0.2rem;
}
.modal-nav-btn {
  flex: 1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--quiet);
  background: var(--paper);
  border: none;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.modal-nav-btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--paper-warm);
}
.modal-nav-btn:disabled {
  color: var(--pencil);
  cursor: not-allowed;
  opacity: 0.55;
}
.modal-nav-btn:first-child { text-align: left;  border-right: 1px solid var(--rule); }
.modal-nav-btn:last-child  { text-align: right; }

/* Trip pill: shows the currently-active trip below the cat-panel
   when ?trip=<id> is set, or after a user clicks a journey-card
   link. The × clears the trip and returns the map to its full
   un-filtered state. */
.trip-pill {
  position: fixed;
  left: 1.5rem;
  bottom: 0.5rem;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.35rem 0.5rem 0.35rem 0.7rem;
  border-radius: 1px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  max-width: calc(100vw - 3rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.trip-pill[aria-hidden="false"] { display: inline-flex; }
.trip-pill-label { color: var(--pencil); }
.trip-pill-title { color: var(--paper); }
.trip-pill-clear {
  background: transparent;
  border: none;
  color: var(--pencil);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
}
.trip-pill-clear:hover { color: var(--paper); }
/* When trip pill is shown, lift the cat-panel above it so they don't overlap. */
body:has(.trip-pill[aria-hidden="false"]) .cat-panel {
  bottom: calc(1rem + 2.4rem);
}

/* Content-mode visibility helpers. The .heatmap-legend hides when
   the map is in Content mode (no heatmap rendering, nothing to
   legend). setMode() in tracks.js toggles body.mode-content. */
body.mode-content .heatmap-legend { display: none; }

/* Tiny build-version stamp in bottom-right. Visible-at-a-glance so
   the phone can confirm which deploy actually loaded after a cache
   bust, without needing devtools. Low opacity, no pointer events. */
.version-stamp {
  position: fixed;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 4;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--quiet);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  background: rgba(250, 250, 248, 0.7);
  padding: 0.15rem 0.4rem;
  border-radius: 1px;
}

/* Mobile. */
@media (max-width: 600px) {
  :root { --header-h: 52px; }
  body > header { padding: 0 0.75rem; height: 52px; }
  .wordmark { font-size: 1rem; }
  .mode-btn { font-size: 0.62rem; padding: 0.25rem 0.5rem; }
  .cat-panel {
    left: 0.5rem;
    bottom: 0.5rem;
    padding: 0.3rem 0.4rem 0.4rem;
    gap: 0.3rem;
    min-width: 10rem;
  }
  .cat-btn { font-size: 0.62rem; padding: 0.2rem 0.35rem; }
  .cat-stats { font-size: 0.62rem; }
  .legend-labels { font-size: 0.58rem; }
  .modal-dialog { margin: 2vh auto; max-height: 96vh; }
  .modal-title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* ===================================================================
   Journey explorer — entry overlay + docked viewer + filmstrip.
   Map stays the backdrop; the viewer docks over its right edge.
   =================================================================== */

/* --- entry overlay --- */
.explore {
  position: fixed;
  /* Sit below the site header so the wordmark + nav (The book / Tracks /
     The science) stay visible and clickable — a consistent way back. */
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 16, 14, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.explore[hidden] { display: none; }
.explore-card {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-radius: 6px;
  padding: 2rem 2rem 1.4rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.explore-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--pencil); margin: 0 0 0.4rem;
}
.explore-title { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: 1.9rem; margin: 0 0 0.4rem; line-height: 1.15; }
.explore-sub { color: var(--quiet); margin: 0 0 1.2rem; font-size: 0.98rem; }
.explore-form { display: flex; gap: 0.5rem; margin: 0 0 0.4rem; }
.explore-input {
  flex: 1; min-width: 0; padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule); border-radius: 3px;
  font-size: 1rem; font-family: inherit; color: var(--ink); background: #fff;
}
.explore-input:focus { outline: none; border-color: var(--amber); }
.explore-go {
  padding: 0 1.1rem; border: none; border-radius: 3px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85rem;
}
.explore-go:hover { background: var(--amber); }
.explore-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.72rem;
  padding: 0.35rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--amber); color: var(--ink); }
.explore-or {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--pencil);
  margin: 1.3rem 0 0.7rem;
}
.explore-trips { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.trip-card {
  text-align: left; padding: 0.7rem 0.85rem; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--paper); cursor: pointer; transition: all 0.15s;
}
.trip-card:hover { border-color: var(--amber); background: var(--paper-warm); }
.trip-card-title { display: block; font-family: 'Newsreader', Georgia, serif; font-size: 1.02rem; color: var(--ink); }
.trip-card-meta { display: block; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.66rem; color: var(--pencil); margin-top: 0.15rem; }
.explore-browse {
  display: block; width: 100%; margin-top: 1.1rem; cursor: pointer; text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.78rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 0.55rem 0.95rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.explore-browse:hover { border-color: var(--amber); color: var(--amber); background: rgba(0, 0, 0, 0.02); }

/* --- docked journey viewer --- */
.journey {
  position: fixed;
  top: var(--header-h); right: 0; bottom: 0;
  width: min(46vw, 560px);
  z-index: 50;
  background: var(--paper);
  box-shadow: -10px 0 44px rgba(0, 0, 0, 0.20);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.journey[hidden] { display: none; }
.journey-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.journey-kicker { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pencil); margin: 0 0 0.15rem; }
.journey-name { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: 1.3rem; margin: 0; line-height: 1.15; }
.journey-head-actions { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.journey-count { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.72rem; color: var(--pencil); white-space: nowrap; }
.journey-x { background: none; border: none; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--quiet); }
.journey-x:hover { color: var(--ink); }
.journey-photo-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.journey-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.journey-cap { padding: 1.1rem 1.3rem 0.5rem; }
.journey-meta { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); margin: 0 0 0.4rem; }
.journey-title { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: 1.5rem; margin: 0 0 0.5rem; line-height: 1.2; }
.journey-passage { font-size: 1.02rem; line-height: 1.7; color: var(--ink); margin: 0 0 0.8rem; }
.journey-aphorism { font-style: italic; color: var(--quiet); border-left: 2px solid rgba(168, 122, 60, 0.5); padding-left: 0.7rem; margin: 0 0 1rem; }
.journey-nav {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  padding: 0.7rem; border-top: 1px solid var(--rule);
  position: sticky; bottom: 0; background: var(--paper);
}
.journey-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: all 0.15s; }
.journey-btn:hover { border-color: var(--amber); color: var(--amber); }
.journey-play { font-size: 0.8rem; }

/* --- filmstrip (desktop) --- */
.journey-strip {
  /* left edge clears the bottom-left cat-panel so they don't overlap */
  position: fixed; bottom: 0; left: 20rem; right: min(46vw, 560px);
  z-index: 45; display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 10px 10px;
  background: linear-gradient(to top, rgba(18, 16, 14, 0.55), transparent);
}

/* Primary action at the top of the bottom-left panel: reopen the menu.
   Lives inside .cat-panel, so it's right where the eye already goes and
   it disappears behind the explore overlay (lower z-index) when open. */
.explore-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.2rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.explore-open:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.explore-open-icon { color: var(--amber); }
.explore-open:hover .explore-open-icon { color: var(--ink); }
.journey-strip[hidden] { display: none; }
.strip-thumb {
  flex: none; width: 64px; height: 44px; border-radius: 2px; object-fit: cover;
  cursor: pointer; opacity: 0.55; border: 2px solid transparent; transition: opacity 0.15s, border-color 0.15s;
}
.strip-thumb:hover { opacity: 0.85; }
.strip-thumb.active { opacity: 1; border-color: var(--amber); }

/* --- fullscreen photo --- */
.bigphoto { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 2vh; background: rgba(18, 16, 14, 0.95); cursor: zoom-out; }
.bigphoto[hidden] { display: none; }
.bigphoto img { max-width: 100%; max-height: 96vh; object-fit: contain; border-radius: 2px; }

/* --- mobile: panel becomes a bottom sheet, map keeps the top --- */
@media (max-width: 700px) {
  .journey { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 64vh; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25); }
  .journey-strip { display: none !important; }
  .explore-trips { grid-template-columns: 1fr; }
  .explore-card { padding: 1.5rem 1.2rem 1.1rem; }
  .explore-title { font-size: 1.6rem; }
}

/* "Read the chapter" link in the journey panel (section journeys only). */
.journey-read {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.42rem 0.8rem;
  background: var(--ink); color: var(--paper);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem; text-decoration: none; white-space: nowrap;
  transition: background 0.15s;
}
.journey-read:hover { background: var(--amber); }
.journey-read[hidden] { display: none; }

/* Generated/loaded intro line under the journey name. */
.journey-intro {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--quiet);
  margin: 0.3rem 0 0;
  line-height: 1.4;
}
.journey-intro[hidden] { display: none; }

/* Explore form busy state while the LLM curator is thinking. */
.explore-go:disabled, .explore-input:disabled { opacity: 0.55; cursor: progress; }

/* Chapters list in the explore overlay: all 10 sections as quick targets. */
.explore-card { max-height: 88vh; overflow-y: auto; }
.explore-chapters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.chapter-chip {
  display: flex; align-items: baseline; gap: 0.5rem;
  text-align: left;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.92rem; color: var(--ink); cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chapter-chip:hover { background: var(--paper-warm); border-color: var(--amber); }
.chapter-chip-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem; color: var(--pencil); flex: none;
}

/* "Powered by Claude" under the prompt (only the free-text box uses Claude). */
.explore-powered {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.4rem;
  margin: 0 0 0.85rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem; color: var(--quiet); text-decoration: none;
}
.explore-powered:hover { color: var(--ink); }
.claude-mark { flex: none; }

/* "Learn more" reference links at the foot of the journey viewer. */
.journey-links { padding: 0.7rem 1.3rem 0.7rem; margin-top: 0.2rem; border-top: 1px solid var(--rule); }
.journey-links[hidden] { display: none; }
.journey-links-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--pencil); margin: 0 0 0.4rem;
}
.journey-links a {
  display: inline-block; margin: 0 0.7rem 0.3rem 0;
  font-size: 0.88rem; color: var(--amber); text-decoration: none;
}
.journey-links a:hover { text-decoration: underline; }

/* Narrative context line under the category stats (the road-life framing). */
.cat-stats .stats-context {
  margin-top: 0.4rem; padding-top: 0.35rem;
  border-top: 1px dotted var(--rule);
  font-family: 'Newsreader', Georgia, serif; font-style: italic;
  font-size: 0.74rem; color: var(--quiet); white-space: normal; line-height: 1.4;
}

/* "Trace the roads" route-link chips in the explore overlay. They switch the
   map to a track category's GPS lines/heatmap (a route view, not a journey). */
.explore-roads { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.road-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.42rem 0.95rem; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.road-chip:hover { background: var(--amber); border-color: var(--amber); color: var(--paper); }

/* Video stops in the journey viewer + fullscreen play in place like photos. */
.journey-photo[hidden] { display: none; }
.bigphoto video { max-width: 100%; max-height: 96vh; object-fit: contain; border-radius: 2px; }
.bigphoto img[hidden], .bigphoto video[hidden] { display: none; }
