/* Theme: Topo
   Inspired by printed trail maps (USGS quads, National Geographic Trails Illustrated, CalTopo prints):
   paper tones, contour-brown ink, forest-green accents, serif headings, dashed "map legend" rules.
   Load after style.css. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=Public+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap");

:root {
  --bg: #efe8d6;
  --panel: #f8f3e6;
  --ink: #3a2d1f;
  --muted: #665743;
  --rule: #cfc2a3;
  --soft: #e6dcc2;
  --kim: #3a2d1f;
  --shea: #b5422b;
  --amber: #ab6a0e;
  --wx-amber: #c27a12;   /* weather chart + air quality keep the original colors */
  --wx-muted: #7a6a55;
  --abby: #6f4e9c;
  --paul: #2d6f8f;
  --crew: #2f6b3a;
  --cut: #8f2a1a;
  --warn: #a8321f;
  --ok: #2f6b3a;
  --night: #283228;
  --day: #e6c36a;
  --tile-filter: sepia(0.1) brightness(0.9) contrast(1.05) saturate(1.1);   /* the Esri topo tiles are mostly white: dim them slightly with a light warm tint; more sepia or saturate turns them yellow */
  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Public Sans", system-ui, sans-serif;
  --f-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --radius: 2px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161a15; --panel: #1e241c; --ink: #e9e0c9; --muted: #a39a82; --rule: #3a4234; --soft: #262d23;
    --kim: #e9e0c9; --shea: #f07a5e; --amber: #f0b04a; --wx-amber: #f0b04a; --wx-muted: #a39a82; --abby: #b99ae6; --paul: #6fb6d6;
    --crew: #7fc28a; --cut: #f0806a; --warn: #f0806a; --ok: #7fc28a; --night: #0c100b; --day: #c9a94c;
    --tile-filter: brightness(0.62) sepia(0.35) saturate(0.8) contrast(1.1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161a15; --panel: #1e241c; --ink: #e9e0c9; --muted: #a39a82; --rule: #3a4234; --soft: #262d23;
  --kim: #e9e0c9; --shea: #f07a5e; --amber: #f0b04a; --wx-amber: #f0b04a; --wx-muted: #a39a82; --abby: #b99ae6; --paul: #6fb6d6;
  --crew: #7fc28a; --cut: #f0806a; --warn: #f0806a; --ok: #7fc28a; --night: #0c100b; --day: #c9a94c;
  --tile-filter: brightness(0.62) sepia(0.35) saturate(0.8) contrast(1.1);
  color-scheme: dark;
}

/* Serif headings in sentence-ish case, like map titles */
h2, header h1, .panel h2, .card h2, .sec-head h2, .profile-head h2, .plan h2 {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.01em;
}
header h1 { font-size: clamp(36px, 5.4vw, 58px); }
header h1 span { font-style: italic; font-weight: 600; color: var(--crew); }
header { border-bottom: 0; padding-bottom: 14px; box-shadow: 0 2px 0 var(--ink), 0 5px 0 var(--bg), 0 6px 0 var(--ink); }

/* Map-legend style boxes: dashed inner rules, square corners */
.panel, .card, .profile, #map, .pitem, .step, .ck-tab, .relay-bar { border-radius: var(--radius); }
.card, .panel, .profile { border: 1px solid var(--ink); box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--rule); }
.legs li, .aid td { border-top-style: dashed; }
.stats, .tiles, .live-tiles { border-style: solid; border-color: var(--ink); }

.chip, .theme-btn, .mini, .inp, .pill { border-radius: var(--radius); }
.chip.on { background: var(--crew); border-color: var(--crew); color: var(--panel); }
.theme-btn { border-color: var(--ink); background: transparent; }
.theme-btn:hover { background: var(--soft); }

.pitem { background: var(--panel); }
.eyebrow { color: var(--crew); }
.relay-bar button { font-family: var(--f-body); }
.pcard b { text-transform: none; }

/* dark mode: the pacer colors are light, so the relay-bar labels go dark */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .relay-bar button { color: var(--bg); } }
:root[data-theme="dark"] .relay-bar button { color: var(--bg); }
