/* Restored road trip pages. System fonts only, so nothing is fetched from a font CDN. */
:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --panel: #fffdf9;
  --ink: #1c1d20;
  --muted: #5b6068;
  --faint: #8a8f96;
  --rule: #e3dfd6;
  --accent: #b83b0b;
  --accent-soft: #fbe9df;
  --chip: #f0ece4;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --panel: #17191c;
    --ink: #ebe8e2;
    --muted: #a7acb3;
    --faint: #7c8289;
    --rule: #2b2f34;
    --accent: #ff9153;
    --accent-soft: #3a2418;
    --chip: #22262a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 16px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Layout: panel on the left, map on the right. Stacked below 760px. */
.app {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "head map" "details map";
  height: 100vh;
  height: 100dvh;
}
.head { grid-area: head; background: var(--panel); border-right: 1px solid var(--rule); padding: 20px 22px 14px; }
.details { grid-area: details; background: var(--panel); border-right: 1px solid var(--rule); overflow-y: auto; padding: 0 22px 20px; }
.map-wrap { grid-area: map; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.eyebrow a { color: inherit; text-decoration: none; }
h1 { font: 600 24px/1.2 var(--serif); margin: 0 0 10px; text-wrap: balance; }
.restored {
  margin: 0; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: var(--muted);
  background: var(--chip); border-radius: 6px;
}

h2 {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); margin: 20px 0 8px;
}

.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0 0; }
.totals div { min-width: 0; }
.totals dt { font-size: 12px; color: var(--muted); }
.totals dd { margin: 0; font: 600 20px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.totals dd small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
  font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn small { font-size: 11.5px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.open-in { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.open-in span { display: inline-block; min-width: 92px; }
.open-in a { margin-right: 8px; white-space: nowrap; }

.stop-list { list-style: none; margin: 0; padding: 0; }
.stop-list li { margin: 0; }
.stop-list button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 28px 1fr; gap: 10px;
  width: 100%; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; cursor: pointer;
}
.stop-list button:hover { background: var(--chip); }
.stop-list button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stop-list .is-active button { background: var(--accent-soft); }
.num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--panel);
  font: 600 12px/24px var(--sans); text-align: center; font-variant-numeric: tabular-nums; margin-top: 1px;
}
.stop-name { font-weight: 550; display: block; }
.stop-leg { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stop-via { display: block; font-size: 12.5px; color: var(--muted); font-style: italic; }
.stop-via::before, .pop-via::before {
  content: ""; display: inline-block; width: 14px; border-top: 2.5px dotted var(--accent); vertical-align: middle; margin-right: 5px;
}
.stop-leg.flight::before { content: ""; display: inline-block; width: 14px; border-top: 2px dashed var(--accent); vertical-align: middle; margin-right: 5px; }

.foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--faint); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--muted); }

/* Map chrome */
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl button.fit-route { display: grid; place-items: center; color: #333; }
.maplibregl-popup-content { font: 13px/1.4 var(--sans); padding: 10px 28px 10px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.pop-title { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: baseline; color: #1c1d20; }
.pop-num { color: #b83b0b; font-variant-numeric: tabular-nums; }
.pop-leg { margin-top: 4px; color: #50555c; }
.pop-via { margin-top: 4px; color: #50555c; font-style: italic; }
.maplibregl-popup-close-button { font-size: 18px; width: 24px; height: 24px; }
.map-error { display: grid; place-items: center; padding: 24px; color: var(--muted); text-align: center; }
@media (prefers-color-scheme: dark) {
  .maplibregl-popup-content { background: #22262a; color: var(--ink); }
  .pop-title { color: var(--ink); }
  .pop-num { color: var(--accent); }
  .pop-leg, .pop-via { color: var(--muted); }
  .maplibregl-popup-close-button { color: var(--ink); }
  .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #22262a; }
  .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #22262a; }
  .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #22262a; }
  .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #22262a; }
}

/* Stacked layout for phones and narrow blog iframes. */
@media (max-width: 760px) {
  .app { display: block; height: auto; }
  .head { border-right: 0; padding: 16px 16px 12px; }
  h1 { font-size: 21px; }
  .map-wrap { height: 62vh; min-height: 320px; max-height: 640px; border-block: 1px solid var(--rule); }
  .details { border-right: 0; overflow: visible; padding: 0 16px 24px; }
  .totals dd { font-size: 18px; }
}

/* ?embed=1: map only, with a small title card and a link to the full page. */
.embed-card { display: none; }
html.embed .app { display: block; height: 100vh; height: 100dvh; }
html.embed .head, html.embed .details { display: none; }
html.embed .map-wrap { height: 100%; max-height: none; min-height: 0; border: 0; }
html.embed .embed-card {
  display: block; position: absolute; z-index: 2; top: 10px; left: 10px; max-width: min(360px, calc(100% - 70px));
  background: color-mix(in srgb, var(--panel) 94%, transparent); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 12px; font-size: 12.5px; line-height: 1.4;
}
.embed-card strong { display: block; font: 600 14px/1.25 var(--serif); color: var(--ink); }
.embed-card .meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.embed-card a { font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
  html.embed .embed-card { padding: 6px 10px; }
  .embed-card strong { font-size: 13px; }
  .embed-card .meta, .embed-card br { display: none; }
}

/* Animated pages (archive-site/src/animation-app.js, animation-page.js). */
.anim-blurb { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.anim-controls { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.anim-controls .btn { padding: 6px 10px; font-size: 15px; line-height: 1; cursor: pointer; }
.anim-controls .anim-play { min-width: 64px; font-size: 13px; font-weight: 600; }
.anim-slider { flex: 1; min-width: 0; accent-color: var(--accent); }
.anim-counter {
  margin: 0 0 14px; font: 600 15px/1.3 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink);
}
.anim-stop-list { max-height: 220px; overflow-y: auto; }
.anim-stop-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 5px 0; }

/* Archive index page (build/archive/index.html). */
body.ix { height: auto; }
.ix-page { max-width: 880px; margin: 0 auto; padding: 36px 24px 48px; }
.ix-head h1 { font: 600 34px/1.15 var(--serif); margin: 0 0 12px; }
.ix-lede { font: 19px/1.5 var(--serif); margin: 0 0 18px; max-width: 42em; }
.ix-intro { font-size: 15px; color: var(--muted); max-width: 44em; }
.ix-intro p { margin: 0 0 10px; }
.ix-intro strong { color: var(--ink); font-weight: 600; }
.ix-summary { margin: 16px 0 0; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ix-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.ix-nav a {
  font-size: 13px; text-decoration: none; color: var(--ink); background: var(--chip);
  padding: 4px 10px; border-radius: 999px;
}
.ix-nav a:hover { color: var(--accent); }
.ix-group { margin-top: 36px; }
.ix-group h2 {
  font: 600 22px/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink);
  margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.ix-count { font: 500 13px/1 var(--sans); color: var(--faint); margin-left: 6px; font-variant-numeric: tabular-nums; }
.ix-blurb { margin: 8px 0 4px; font-size: 14px; color: var(--muted); }
.ix-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.ix-item { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.ix-link { font-weight: 600; font-size: 16px; text-decoration: none; }
.ix-link:hover { text-decoration: underline; }
.ix-title { display: block; font-size: 13px; color: var(--muted); font-style: italic; margin-top: 1px; }
.ix-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ix-note { display: block; font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.ix-capitols a { display: grid; grid-template-columns: 6.5em 1fr 1fr; gap: 8px; }
.ix-capitols {
  list-style: none; margin: 10px 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); column-gap: 20px;
}
.ix-capitols a {
  padding: 6px 10px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--muted);
  font-size: 13px; font-variant-numeric: tabular-nums; align-items: baseline;
}
.ix-capitols a:hover { background: var(--chip); }
.ix-capitols strong { color: var(--accent); font-size: 15px; }
.ix-capitols strong::after { content: " capitols"; font-size: 12px; font-weight: 400; color: var(--faint); }
.ix-empty { color: var(--muted); }
.ix-foot { margin-top: 44px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--faint); }
.ix-foot p { margin: 0 0 6px; }
.ix-foot a { color: var(--muted); }
@media (max-width: 560px) {
  .ix-page { padding: 24px 16px 36px; }
  .ix-head h1 { font-size: 27px; }
  .ix-lede { font-size: 17px; }
  .ix-list { grid-template-columns: 1fr; }
}
