/* Side Rides Guides — design mockup
   Warm Southern California, outdoorsy, editorial. */

:root {
  --bg: #F5EFE3;
  --bg-2: #EBE4D6;
  --paper: #FFFBF6;
  --ink: #1C2A28;
  --ink-soft: #4A5C59;
  --ink-faint: #7A8A86;
  --line: #DDD6C8;
  --line-strong: #C9C0B0;
  --forest: #28605D;
  --forest-2: #1C4845;
  --sage: #3E8D81;
  --sage-soft: #D5E8E4;
  --terra: #E05D34;
  --terra-dark: #C44C28;
  --terra-soft: #F8D9CF;
  --gold: #C4784A;
  --gold-soft: #F0E0C8;
  --brown: #5B3B28;
  --river: #64A792;
  --shadow: 0 18px 40px rgba(28, 42, 40, 0.12);
  --radius: 16px;
  --header-h: 80px;
  --serif: "Outfit", "Segoe UI", sans-serif;
  --display: "Outfit", "Segoe UI", sans-serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --max: 1180px;
  --coast: #E05D34;
  --mountains: #3E8D81;
  --rivers: #28605D;
  --parks: #5B3B28;
  --coast-to-crest: #64A792;
  --metro: #B86E40;
  --afar: #C45A46;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

/* Header
   ---------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(201 192 176 / 0.75);
}

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.logo__mark {
  width: 56px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
}

.logo__tag {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--terra {
  background: var(--terra);
  color: #fff;
}

.btn--terra:hover { background: var(--terra-dark); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 0.45);
}

.btn--ghost:hover { background: rgb(255 255 255 / 0.1); }

.btn--dark {
  background: var(--forest);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

/* Official YouTube one-tap subscribe — red for contrast and instant recognition */
.btn--subscribe {
  background: #FF0000;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  box-shadow: 0 8px 20px rgb(220 0 0 / 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, filter 0.16s ease;
  will-change: transform;
}

.btn--subscribe span { line-height: 1; }

.btn--subscribe .btn__yt {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
}

.btn--subscribe:hover,
.btn--subscribe:focus-visible {
  background: #e60000;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgb(200 0 0 / 0.45);
  outline: none;
}

.btn--subscribe:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.btn--subscribe:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 12px rgb(180 0 0 / 0.35);
  background: #cc0000;
}

.btn--subscribe-hero {
  padding: 0.72rem 1.15rem;
  font-size: 0.92rem;
  border-radius: 10px;
  flex: 0 0 auto;
  align-self: center;
}

.btn--subscribe-nav {
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  .btn--subscribe {
    transition: background-color 0.16s ease;
    will-change: auto;
  }
  .btn--subscribe:hover,
  .btn--subscribe:focus-visible,
  .btn--subscribe:active {
    transform: none;
  }
}

/* Hero
   ---------------------------------------- */
.hero {
  position: relative;
  min-height: 640px;
  height: calc(100vh - var(--header-h));
  max-height: 820px;
  overflow: hidden;
  color: #fff;
  background: var(--forest-2);
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.04);
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(16 28 27 / 0.82) 0%, rgb(16 28 27 / 0.45) 48%, rgb(16 28 27 / 0.18) 100%),
    linear-gradient(180deg, rgb(16 28 27 / 0.15) 0%, rgb(16 28 27 / 0.55) 100%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 72px;
}

.hero__content {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
}

.hero__title-row {
  display: flex;
  align-items: center;
  gap: 14px 20px;
  margin: 14px 0 16px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.95rem;
  color: rgb(255 255 255 / 0.82);
  margin-bottom: 16px;
}

.hero__meta span + span {
  position: relative;
}

.hero p {
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgb(255 255 255 / 0.88);
  max-width: 54ch;
  margin: 0 0 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__play {
  position: absolute;
  right: max(24px, calc((100% - var(--max)) / 2));
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  text-decoration: none;
}

/* Play button
   ---------------------------------------- */
.play {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 36px rgb(0 0 0 / 0.35);
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
}

.play::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.play--sm { width: 42px; height: 42px; }
.play--sm::after { border-width: 6px 0 6px 10px; margin-left: 3px; }

/* Player (thumbnail + overlay)
   ---------------------------------------- */
.player {
  position: relative;
  display: block;
  overflow: hidden;
  background: #1a1a16;
  text-decoration: none;
  color: #fff;
  isolation: isolate;
}

.player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.player__frame {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.player .play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  top: auto;
  transform: none;
  z-index: 2;
}

.player__time {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  background: rgb(16 16 12 / 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(16 28 27 / 0.12);
  z-index: 1;
  pointer-events: none;
}

/* Intro
   ---------------------------------------- */
.intro {
  padding: 88px 0 40px;
}

.intro__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: end;
}

.intro h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 52ch;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stats span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Sections
   ---------------------------------------- */
.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

/* Ride cards
   ---------------------------------------- */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 18px;
}

.ride-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.ride-card .player {
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}

.ride-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 12px 0 6px;
}

.ride-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--terra-soft);
  color: var(--terra-dark);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Regions
   ---------------------------------------- */
.regions-intro {
  padding-top: 24px;
}

.region-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 8px;
}

.region-nav a {
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}

.region-nav a:hover,
.region-nav a:focus {
  border-color: var(--forest);
  color: var(--forest);
}

.region {
  padding: 36px 0 20px;
  border-top: 1px solid var(--line);
}

.region:first-of-type { border-top: 0; }

.region__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}

.region__head h3 {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.region__head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 62ch;
}

.region__count {
  color: var(--ink-faint);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Subscribe
   ---------------------------------------- */
.subscribe {
  padding: 28px 0 88px;
}

.subscribe__panel {
  background: var(--forest);
  color: #fff;
  border-radius: 24px;
  padding: 48px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgb(184 137 62 / 0.2), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgb(196 75 39 / 0.2), transparent 46%);
}

.subscribe__copy {
  display: flex;
  align-items: center;
  gap: 22px;
}

.subscribe__copy img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.35);
  object-fit: cover;
}

.subscribe h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.subscribe p {
  margin: 0;
  color: rgb(255 255 255 / 0.78);
  max-width: 48ch;
}

/* Footer
   ---------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--ink); text-decoration: none; }

/* Ride page
   ---------------------------------------- */
.crumb {
  padding: 22px 0 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb span { margin: 0 8px; color: var(--ink-faint); }

.ride-hero {
  padding: 8px 0 48px;
}

.ride-hero__player {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ride-hero__player .player { border-radius: 18px; }

.ride-title {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  align-items: end;
}

.ride-title h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.ride-title__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ink-soft);
  font-weight: 500;
}

.ride-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 36px 40px;
  padding: 12px 0 64px;
  align-items: start;
}

.prose h2 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.prose p {
  margin: 0 0 1em;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.prose p:last-child { margin-bottom: 0; }

.route-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.route-card__body { padding: 22px 22px 8px; }

.route-card h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.facts {
  display: grid;
  gap: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.facts dt,
.facts .label {
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 3px;
}

.facts .value { font-weight: 500; }

.tbd {
  color: var(--ink-faint);
  font-style: italic;
  font-weight: 400;
}

.map-ph {
  margin-top: 8px;
  background: linear-gradient(180deg, #dfe8dc 0%, #c9d6c4 100%);
  position: relative;
  min-height: 200px;
}

.map-ph svg {
  display: block;
  width: 100%;
  height: 200px;
}

.map-ph__label {
  padding: 14px 22px 0;
}

.map-ph__label strong {
  display: block;
  font-family: var(--display);
  font-size: 1.02rem;
}

.map-ph__label span {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.route-card__cta {
  padding: 16px 22px 22px;
}

.route-card__cta .btn { width: 100%; }

.related { padding: 0 0 40px; }

/* Responsive
   ---------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .intro__grid { grid-template-columns: 1fr; gap: 32px; }
  .ride-layout { grid-template-columns: 1fr; }
  .route-card { position: static; }
}

@media (max-width: 800px) {
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .nav-links { display: none; }
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    background: var(--forest-2);
  }
  .hero__media {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    flex: none;
  }
  .hero__media img { transform: none; object-position: center 45%; }
  .hero__shade {
    background: linear-gradient(180deg, transparent 50%, rgb(16 28 27 / 0.25) 100%);
  }
  .hero__play {
    display: grid;
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .hero .wrap {
    height: auto;
    align-items: stretch;
    padding: 24px 0 32px;
  }
  .hero__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 10px 0 12px;
  }
  .hero h1 { font-size: 2.05rem; margin: 0; }
  .hero p { margin-bottom: 20px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .subscribe__panel {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
  }
  .ride-title { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  :root { --header-h: 64px; }
  .logo__tag { display: none; }
  .hero { min-height: 0; }
  .hero .wrap { padding: 36px 0 32px; }
  .hero h1 { font-size: 1.85rem; }
  .hero__title-row { margin: 10px 0 14px; gap: 10px; }
  .btn--subscribe-hero { width: 100%; justify-content: center; }
  .hero p { font-size: 0.98rem; margin-bottom: 20px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .intro { padding: 52px 0 20px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stats strong { font-size: 1.45rem; }
  .subscribe__copy { flex-direction: column; align-items: flex-start; }
  .region__head { flex-direction: column; }
  .btn { padding: 0.68rem 1rem; }
}


/* Brand extras, map, badges, embeds
   ---------------------------------------- */
.logo:hover { color: var(--forest); }

.site-footer .logo {
  gap: 10px;
}
.site-footer .logo__mark {
  width: 44px;
  height: 36px;
}
.site-footer .logo__name { font-size: 0.92rem; }
.site-footer .logo__tag { display: none; }

.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--sage-soft);
  color: var(--forest-2);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.route-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  flex: 0 0 auto;
}

/* Intro pillars (replaces YouTube stats) */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 8px 0;
}
.pillars div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
}
.pillars strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 6px;
}
.pillars span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Ride map */
.map-section { padding: 24px 0 64px; }
.map-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px 12px;
  align-items: center;
}
.map-filters button {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
.map-filters button:hover { border-color: var(--forest); color: var(--forest); }
.map-filters button.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.map-filters button .count {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 2px;
}
#ride-map, .ride-map {
  width: 100%;
  height: 560px;
  background: #dce6e3;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 18px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgb(0 0 0 / 0.06);
}
.map-legend i[data-g="coast"] { background: var(--coast); }
.map-legend i[data-g="mountains"] { background: var(--mountains); }
.map-legend i[data-g="rivers"] { background: var(--rivers); }
.map-legend i[data-g="parks"] { background: var(--parks); }
.map-legend i[data-g="coast-to-crest"] { background: var(--coast-to-crest); }
.map-legend i[data-g="metro"] { background: var(--metro); }
.map-legend i[data-g="afar"] { background: var(--afar); }
.map-note {
  padding: 0 18px 14px;
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.map-note a { color: var(--forest); text-decoration: none; }

/* MapLibre popup */
.maplibregl-popup-content,
.srg-popup {
  background: var(--paper) !important;
  color: var(--ink);
  border-radius: 14px !important;
  padding: 0 !important;
  box-shadow: 0 16px 40px rgb(28 42 40 / 0.18) !important;
  overflow: hidden;
  width: 280px;
  font-family: var(--sans);
}
.maplibregl-popup-close-button {
  font-size: 18px;
  color: #fff;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.5);
  z-index: 2;
  padding: 4px 8px;
}
.srg-popup img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  display: block;
  background: #1a1a16;
}
.srg-popup__body { padding: 12px 14px 14px; }
.srg-popup__group {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 4px;
}
.srg-popup h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
}
.srg-popup p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.srg-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.srg-popup__actions a {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--terra);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.srg-popup .route-badge { margin-left: 0; }

/* Cluster counts */
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--forest); }

/* Video + Komoot embeds */
.video-embed, .komoot-embed {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1a1a16;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.video-embed { aspect-ratio: 16 / 9; }
.komoot-embed { height: 640px; background: var(--bg-2); }
.video-embed iframe,
.komoot-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.route-block { padding: 0 0 48px; }
.route-block__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.route-block__head h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.route-block__head p { margin: 0; color: var(--ink-soft); }

#route-mini-map {
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.subscribe__copy .logo-badge {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: var(--bg);
  padding: 8px;
  object-fit: contain;
  border: 0;
}

#map, #latest, #regions, #about { scroll-margin-top: calc(var(--header-h) + 12px); }

@media (max-width: 800px) {
  :root { --header-h: 108px; }
  .site-header { height: auto; }
  .site-header .wrap {
    flex-wrap: wrap;
    row-gap: 0;
    padding: 10px 0 8px;
  }
  .nav { display: contents; }
  .nav .btn { margin-left: auto; }
  .nav-links {
    display: flex;
    width: 100%;
    order: 3;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0 2px;
    -webkit-overflow-scrolling: touch;
  }
  .pillars { grid-template-columns: 1fr; }
  #ride-map, .ride-map { height: 420px; }
  .komoot-embed { height: 520px; }
  .logo__mark { width: 48px; height: 40px; }
}
@media (max-width: 520px) {
  .logo__tag { display: none; }
  .map-filters { padding: 12px 12px 8px; }
  .srg-popup { width: 240px; }
}

/* YouTube click-to-load facade (same look as the embed, no auto-load) */
.video-facade {
  position: relative;
  cursor: pointer;
}
.video-facade__btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #1a1a16;
  cursor: pointer;
  border-radius: inherit;
}
.video-facade__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-facade .play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.video-facade:hover .play {
  transform: translate(-50%, -50%) scale(1.06);
}
.video-facade.is-playing .video-facade__btn { display: none; }

/* Stack Komoot + GPX actions without changing button style */
.route-card__cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gpx-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.gpx-note a { color: var(--forest); }

/* Prominent top-of-page GPX actions */
.ride-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 4px 0 16px;
}
.btn--gpx {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.gpx-alt {
  position: relative;
}
.gpx-alt > summary {
  list-style: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  transition: transform 0.15s ease, background 0.15s ease;
}
.gpx-alt > summary::-webkit-details-marker { display: none; }
.gpx-alt > summary::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.gpx-alt[open] > summary {
  background: var(--bg-2);
}
.gpx-alt__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.gpx-alt__menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}
.gpx-alt__menu a:hover {
  background: var(--bg-2);
  color: var(--forest-2);
}

.gpx-badge {
  display: inline-flex;
  align-items: center;
  background: var(--terra-soft);
  color: var(--terra-dark);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.srg-popup__actions a.srg-popup__gpx {
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--line-strong);
}

@media (max-width: 800px) {
  .ride-actions { margin: 2px 0 12px; }
  .gpx-alt > summary { padding: 0.68rem 1rem; }
}

/* Route Library
   ---------------------------------------- */
.route-library {
  padding-top: 28px;
  padding-bottom: 64px;
}

#routes,
[id^="routes-"] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.route-library .section-head {
  align-items: flex-end;
  flex-wrap: wrap;
}

.route-lib__jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.route-lib__jump a {
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 550;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
}

.route-lib__jump a span {
  color: var(--ink-soft);
  font-weight: 500;
}

.route-lib__jump a:hover,
.route-lib__jump a:focus-visible {
  border-color: var(--forest);
  color: var(--forest-2);
  outline: none;
}

.route-lib__tools {
  margin: 0 0 16px;
}

.route-lib__toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--forest);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.route-lib__toggle:hover,
.route-lib__toggle:focus-visible {
  color: var(--forest-2);
}

.route-lib {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.route-lib__group {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
}

.route-lib__group > summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--sage-soft) 55%, var(--paper));
  border-bottom: 1px solid transparent;
  font-weight: 650;
  color: var(--forest-2);
}

.route-lib__group > summary::-webkit-details-marker { display: none; }

.route-lib__group > summary::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--forest);
  border-bottom: 2px solid var(--forest);
  transform: rotate(-45deg);
  margin-right: 2px;
  flex: 0 0 auto;
  transition: transform 0.15s ease;
  position: relative;
  top: -1px;
}

.route-lib__group[open] > summary {
  border-bottom-color: var(--line);
}

.route-lib__group[open] > summary::before {
  transform: rotate(45deg);
  top: -2px;
}

.route-lib__region {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.route-lib__count {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.route-lib__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.route-lib__ride {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

.route-lib__ride:first-child { border-top: 0; }

.route-lib__ride:nth-child(even) {
  background: color-mix(in srgb, var(--bg-2) 55%, var(--paper));
}

.route-lib__ride-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.route-lib__name {
  text-decoration: none;
  color: var(--forest-2);
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
}

.route-lib__name:hover,
.route-lib__name:focus-visible {
  color: var(--terra-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.route-lib__facts {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 550;
  white-space: nowrap;
}

.route-lib__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.route-lib__gpx,
.route-lib__komoot,
.route-lib__guide {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.route-lib__gpx {
  background: var(--terra-soft);
  color: var(--terra-dark);
}

.route-lib__komoot {
  background: var(--sage-soft);
  color: var(--forest-2);
}

.route-lib__guide {
  background: var(--gold-soft);
  color: var(--brown);
}

.route-lib__gpx:hover,
.route-lib__komoot:hover,
.route-lib__guide:hover,
.route-lib__gpx:focus-visible,
.route-lib__komoot:focus-visible,
.route-lib__guide:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.route-lib__ride--multi {
  grid-template-columns: 1fr;
  align-items: start;
}

.route-lib__routes {
  list-style: none;
  margin: 0;
  padding: 0 0 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-lib__route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 4px 0 4px 12px;
  border-left: 3px solid var(--line-strong);
}

.route-lib__routename {
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink);
  min-width: 0;
}

@media (max-width: 800px) {
  .route-library .section-head {
    align-items: stretch;
  }
  .route-library .section-head .btn {
    width: 100%;
  }
  .route-lib__ride {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    gap: 8px;
  }
  .route-lib__actions {
    justify-content: flex-start;
  }
  .route-lib__group > summary {
    padding: 12px 14px;
  }
  .route-lib__route {
    grid-template-columns: 1fr;
    gap: 4px 8px;
    padding-left: 10px;
  }
  .route-lib__facts {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .route-lib__jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .route-lib__jump a {
    flex: 0 0 auto;
  }
}

.map-fallback { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: #fff7e6; border: 1px solid #e8d3a6; font-size: .95rem; }
.map-fallback[hidden] { display: none; }
.ride-map.is-unsupported { display: none; }
.route-lib__tip { margin: 8px 0 0; font-size: .92rem; opacity: .85; }
