/* Rider site. Colors come from settings (--c-*), set inline in the page head. */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/files/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter/files/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: var(--c-primary);
  --secondary: var(--c-secondary);
  --accent: var(--c-accent);
  --bg: var(--c-bg);
  --text: var(--c-text);
  --on-primary: #f6f1e4;
  --on-accent: #2a2019;
  --surface: color-mix(in srgb, var(--bg) 55%, #fff);
  --line: color-mix(in srgb, var(--text) 16%, transparent);
  --muted: color-mix(in srgb, var(--text) 68%, var(--bg));
  --link: var(--primary);
  --grain: 0.07;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
  color-scheme: light dark;
}

/* Night forest: follows the phone's setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a14;
    --text: #f2ebda;
    --primary: color-mix(in srgb, var(--c-primary) 45%, #bfd9b0);
    --secondary: color-mix(in srgb, var(--c-secondary) 80%, #fff);
    --on-primary: #10190f;
    --surface: #1a251d;
    --line: rgba(242, 235, 218, 0.16);
    --muted: #b8b4a4;
    --link: #a9cf93;
    --grain: 0.05;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .18 0 0 0 0 .12 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font: 1.125rem/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); }
h2 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: 0.6rem 1rem; z-index: 50; }
.skip:focus { left: 0; }
.wrap { width: min(100% - 2rem, 44rem); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; color: var(--muted); }
.eyebrow { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; font-weight: 600; }
.eyebrow a { color: inherit; }
.lede { font-size: 1.2rem; }
.intro { padding-top: 1.5rem; }

.preview-bar { background: var(--accent); color: var(--on-accent); text-align: center; font-weight: 600; padding: 0.4rem 1rem; font-size: 0.95rem; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1rem;
  width: min(100%, 52rem); margin-inline: auto;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.langs { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.langs a { min-width: 3rem; min-height: 2.75rem; display: grid; place-items: center; font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--text); }
.langs a[aria-current] { background: var(--primary); color: var(--on-primary); }

/* buttons and cards */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.55rem 1.2rem;
  border: 2px solid var(--primary); border-radius: 999px;
  background: transparent; color: var(--primary);
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-small { min-height: 2.75rem; padding: 0.3rem 1rem; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 1rem 1.2rem; }
.cards { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.cards a.card { display: block; height: 100%; color: inherit; text-decoration: none; overflow: hidden; }
.cards a.card:hover { border-color: var(--secondary); }
.card-body { display: grid; gap: 0.25rem; padding: 1rem 1.2rem; }
.card-body strong { font-family: var(--serif); font-size: 1.3rem; }
.city-art { display: block; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--secondary) 35%, var(--bg)) center / cover; color: var(--secondary); position: relative; overflow: hidden; }
.city-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contours { width: 100%; height: 100%; display: block; }
.empty { display: grid; overflow: hidden; }
.empty .contours { height: 9rem; color: var(--secondary); background: color-mix(in srgb, var(--secondary) 18%, var(--bg)); }
.empty-body { padding: 1.2rem 1.4rem 0.6rem; }
.divider { display: block; width: 9rem; margin: 1.5rem auto; color: var(--secondary); }

/* trail marker badge */
.badge { display: block; flex: none; }
.badge-sm { width: 2.5rem; height: 2.5rem; }
.badge-md { width: 3.25rem; height: 3.25rem; }
.badge-lg { width: 4rem; height: 4rem; }

/* overview */
.progress { font-weight: 600; color: var(--primary); min-height: 1.6em; }
.stations { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.6rem; }
.station-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; min-height: 4.5rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.station-row:hover { border-color: var(--secondary); }
.row-text { display: grid; flex: 1; line-height: 1.35; }
.row-text strong { font-family: var(--serif); font-size: 1.15rem; }
.row-text .muted { font-size: 0.95rem; }
.heard-mark { color: var(--primary); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
[data-station-id].is-heard .station-row { border-color: var(--secondary); }

/* station page */
.station-head { display: flex; align-items: center; gap: 0.9rem; padding-block: 0.5rem 0.9rem; }
.station-count { margin: 0; font-weight: 600; font-size: 1.05rem; color: var(--muted); }
.hero {
  margin: 0 auto; position: relative; width: min(100%, 48rem);
  aspect-ratio: 3 / 2; max-height: 32vh; min-height: 10rem; overflow: hidden;
  background: color-mix(in srgb, var(--secondary) 40%, var(--bg)) center / cover;
}
@media (min-width: 52rem) { .hero { border-radius: var(--radius); } }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero figcaption { position: absolute; inset: auto 0 0 0; padding: 3rem 1rem 0.9rem; background: linear-gradient(to top, rgba(18, 24, 18, 0.82), rgba(18, 24, 18, 0)); color: #fff; }
.hero h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2.3rem); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.hero:not(:has(img)) { aspect-ratio: auto; min-height: 7rem; background: color-mix(in srgb, var(--primary) 85%, #000); }
.hero:not(:has(img)) figcaption { position: static; background: none; padding: 2rem 1rem 1rem; width: min(100%, 44rem); margin-inline: auto; }
.station .lede { margin-top: 0.5rem; }
.softline { margin: 1rem 0 0; }
.note { padding: 0.7rem 1rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; font-size: 1rem; }

.player { margin: 1rem 0 1.5rem; }
.player audio { width: 100%; }
.pl[hidden] + .safety { margin-top: 0.5rem; }
.pl-main { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 6vw, 2.2rem); margin-top: 0.25rem; }
.play-big {
  width: 6rem; height: 6rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.play-big svg { width: 3rem; height: 3rem; }
.play-big:active { transform: scale(0.97); }
.pl-skip { position: relative; width: 3.5rem; height: 3.5rem; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.pl-skip svg { width: 2.6rem; height: 2.6rem; grid-area: 1 / 1; }
.pl-skip span { grid-area: 1 / 1; font-size: 0.7rem; font-weight: 700; padding-top: 0.15rem; }
.pl-seek { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }
.pl-seek .time { font-variant-numeric: tabular-nums; font-size: 0.95rem; min-width: 3.4rem; color: var(--muted); }
.pl-seek .time:last-child { text-align: right; min-width: 5.5rem; }
.pl-extra { display: flex; justify-content: flex-end; margin-top: 0.25rem; }
input[type='range'] { flex: 1; min-width: 0; height: 2.75rem; background: none; accent-color: var(--accent); cursor: pointer; }
.safety { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: var(--muted); margin: 0.75rem 0 0; }
.safety svg { width: 1.2rem; height: 1.2rem; flex: none; }
.softline { display: grid; gap: 0.6rem; padding: 0.8rem 1rem; background: var(--surface); border: 1.5px dashed var(--secondary); border-radius: var(--radius); margin: 0 0 1rem; }
.softline-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.block { margin: 2rem 0; }
.block h2 { font-size: 1.25rem; }
.block p { max-width: 38em; }
.map-open { display: block; width: 100%; padding: 0; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; background: color-mix(in srgb, var(--secondary) 25%, var(--bg)) center / cover; cursor: zoom-in; margin-bottom: 1rem; }
.map-open img { display: block; width: 100%; height: auto; }
.transcript summary { cursor: pointer; font-weight: 600; min-height: 3rem; display: flex; align-items: center; color: var(--link); }
.prose p, .transcript .prose { line-height: 1.8; }
.prose h2 { margin-top: 1.5rem; }

.route { display: grid; gap: 0.75rem; margin: 2rem 0; }
.route-card { display: grid; gap: 0.3rem; padding: 0.9rem 1.1rem; text-decoration: none; color: inherit; min-height: 4rem; }
.route-card.next { border-color: var(--secondary); }
.route-card .eyebrow { margin: 0; }
.route-row { display: flex; align-items: center; gap: 0.8rem; }
.route-row strong { font-family: var(--serif); font-size: 1.15rem; }

/* zoomable map */
.zoom { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #111; color: #fff; }
.zoom::backdrop { background: #000; }
.zoom[open] { display: flex; flex-direction: column; }
.zoom-bar { display: flex; gap: 0.5rem; padding: 0.6rem; background: #1d1d1d; }
.zoom-bar button { min-width: 3rem; min-height: 3rem; border: 1.5px solid #666; border-radius: 12px; background: #2b2b2b; color: #fff; font: 600 1.1rem var(--sans); cursor: pointer; }
.zoom-close { margin-left: auto; padding-inline: 1rem; }
.zoom-view { flex: 1; overflow: hidden; position: relative; touch-action: none; cursor: grab; }
.zoom-view img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }

.foot { text-align: center; padding: 0 1rem 2.5rem; margin-top: 2rem; }
.foot p { margin: 0 0 0.4rem; }

@media (prefers-reduced-motion: no-preference) {
  .station-row, .btn, .card { transition: border-color 0.2s, background-color 0.2s; }
  .play-big { transition: transform 0.15s; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
