/* ============================================================================ tokens */

:root {
  color-scheme: light dark;
  --bg: #f5f3ec;
  --surface: #fffdf8;
  --ink: #1c2521;
  --ink-soft: #3b4741;
  --muted: #66736b;
  --line: #e2ded2;
  --accent: #2e6a4e;
  --accent-strong: #22553e;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(28 37 33 / 0.05), 0 8px 24px rgb(28 37 33 / 0.07);

  /* Mountain artwork; each section theme below repaints it. */
  --sky: #dce7df;
  --sun: #f2d9a2;
  --ridge-far: #b5c8b9;
  --ridge-mid: #7d9d87;
  --ridge-near: #3c6a4f;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --radius: 14px;
  --wrap: 72rem;
}

.theme-snow { --sky: #e1e9ef; --sun: #fbefd3; --ridge-far: #c3d1db; --ridge-mid: #91a8b9; --ridge-near: #4d6b82; }
.theme-coast { --sky: #d9e7e7; --sun: #f5daab; --ridge-far: #afcccd; --ridge-mid: #6c9ca0; --ridge-near: #2d6266; }
.theme-desert { --sky: #f0e4d2; --sun: #f0bf77; --ridge-far: #e0c49c; --ridge-mid: #c79a63; --ridge-near: #97683a; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --surface: #161e1a;
    --ink: #e5ebe7;
    --ink-soft: #c2cdc6;
    --muted: #94a59b;
    --line: #26322b;
    --accent: #7cc39c;
    --accent-strong: #9bd5b4;
    --on-accent: #0f1512;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.3);
    --sky: #15201b;
    --sun: #e6d4a3;
    --ridge-far: #22342a;
    --ridge-mid: #2e493a;
    --ridge-near: #3d6850;
  }
  .theme-snow { --sky: #141c23; --sun: #e7e0cb; --ridge-far: #233140; --ridge-mid: #33495d; --ridge-near: #4c6d88; }
  .theme-coast { --sky: #111e20; --sun: #e4d0a3; --ridge-far: #1e3436; --ridge-mid: #2a4f52; --ridge-near: #3a6f73; }
  .theme-desert { --sky: #211a13; --sun: #dfb272; --ridge-far: #392d21; --ridge-mid: #58422c; --ridge-near: #7d5a37; }
}

/* ============================================================================ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font-sans);
}
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; padding: 0.5rem 1rem; background: var(--surface); }

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.lede { margin: 0.5rem 0 0; max-width: 40ch; font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--ink-soft); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent); }

.ridge-sun { fill: var(--sun); }
.ridge-far { fill: var(--ridge-far); }
.ridge-mid { fill: var(--ridge-mid); }
.ridge-near { fill: var(--ridge-near); }

/* ============================================================================ header + footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--line); color: var(--ink); }
.site-nav a.is-section { box-shadow: inset 0 0 0 1px var(--line); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 0.2rem; padding-block: 0.55rem 0.35rem; }
  .site-nav { width: calc(100% + 1rem); margin-inline: -0.5rem; }
}

.site-footer { margin-top: 2rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; }
.footer-inner p { margin: 0; }
.site-footer a { color: inherit; }

/* ============================================================================ heroes */

.home-hero, .post-hero, .page-head { position: relative; overflow: hidden; background: var(--sky); border-bottom: 1px solid var(--line); }
.hero-art { position: absolute; inset: 0; }
.hero-art .ridge, .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-text { position: relative; padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(8rem, 17vw, 12rem); }
/* Fade the artwork behind the text so it stays readable over the ridges. */
.home-hero .hero-art::after,
.post-hero:not(.has-cover) .hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sky) 78%, transparent) 0%, color-mix(in srgb, var(--sky) 50%, transparent) 50%, transparent 82%);
}
@media (min-width: 760px) {
  .home-hero .hero-art::after,
  .post-hero:not(.has-cover) .hero-art::after {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--sky) 50%, transparent) 0%, transparent 70%),
      linear-gradient(90deg, color-mix(in srgb, var(--sky) 85%, transparent) 0%, color-mix(in srgb, var(--sky) 55%, transparent) 38%, color-mix(in srgb, var(--sky) 18%, transparent) 62%, transparent 88%);
  }
}

.home-hero h1 { margin: 0; font-size: clamp(2.8rem, 8vw, 5.2rem); }
.hero-note { margin: 1rem 0 0; max-width: 46ch; color: var(--ink-soft); font-weight: 500; }

.post-hero h1 { margin: 0; max-width: 24ch; font-size: clamp(2rem, 5.5vw, 3.5rem); }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0; margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.post-meta span:not(:last-child)::after { content: "·"; margin: 0 0.7rem; color: var(--muted); }

.has-cover .hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.05) 70%); }
.has-cover .hero-text { padding: clamp(10rem, 26vw, 18rem) 0 clamp(2rem, 5vw, 3.5rem); }
.has-cover h1, .has-cover .eyebrow, .has-cover .post-meta, .has-cover .post-meta span::after { color: #fff; }

.page-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.page-head h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.6rem); }
.page-head .button { margin-top: 1rem; }

/* ============================================================================ trip cards */

.trips { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.section-head p { margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--sky); }
.card-art .ridge, .card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem 1.2rem; }
.card-eyebrow { margin: 0; font-size: 0.74rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card-title { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.card-location { margin: 0; color: var(--muted); font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: auto 0 0; padding: 0.6rem 0 0; list-style: none; }
.chips li {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ridge-near) 15%, transparent);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.feature { padding-top: clamp(2.5rem, 6vw, 4rem); }
.feature-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.feature-card:hover { color: inherit; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.feature-art { position: relative; min-height: 15rem; background: var(--sky); }
.feature-art .ridge, .feature-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-text { display: flex; flex-direction: column; justify-content: center; gap: 0.75rem; padding: clamp(1.5rem, 4vw, 2.75rem); }
.feature-text h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.feature-text p { margin: 0; color: var(--ink-soft); }
.feature-text .eyebrow { margin: 0; }
.feature-text .button { align-self: flex-start; margin-top: 0.5rem; }
@media (min-width: 820px) { .feature-card { grid-template-columns: 1.1fr 1fr; } }

/* ============================================================================ post */

.post-body { display: grid; gap: 2.5rem; padding-block: clamp(2rem, 5vw, 3.5rem); }
.post-main { min-width: 0; max-width: 44rem; }
.post-body:not(.has-aside) .post-main { margin-inline: auto; }
.post-aside { display: grid; gap: 1rem; }

@media (min-width: 980px) {
  .post-body.has-aside { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; column-gap: 3.5rem; }
  .post-aside { position: sticky; top: 5.5rem; }
}
/* On narrow screens the facts come before the story; the map and series list after it. */
@media (max-width: 979px) {
  .post-aside { display: contents; }
  .facts-card { order: -1; }
}

.prose { color: var(--ink-soft); font-size: 1.125rem; line-height: 1.75; overflow-wrap: break-word; }
.prose > * { margin: 0 0 1.15em; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 2em 0 0.6em; color: var(--ink); }
.prose > h3:first-child { margin-top: 0; }
.prose h3 { font-size: 1.5rem; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.inline-photo, .inline-video { margin: 2rem 0; }
.inline-photo img, .inline-video video { width: 100%; border-radius: var(--radius); background: var(--line); }

.post-section { margin-top: 3rem; }
.post-section h2, .gallery-section h2 { margin: 0 0 1rem; font-size: 1.6rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.facts-card, .map-card, .series-card {
  padding: 1.2rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card-heading { margin: 0 0 0.8rem; color: var(--muted); font-family: var(--font-sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; }
.facts dd { margin: 0.1rem 0 0; color: var(--ink); font-weight: 650; line-height: 1.3; }
.facts + .card-heading { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.routes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.2rem 0 0; }
@media (min-width: 560px) and (max-width: 979px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.map-card iframe { width: 100%; height: 18rem; border: 0; border-radius: 10px; background: var(--line); }

.series-card ol { display: grid; gap: 0.15rem; margin: 0; padding: 0; list-style: none; counter-reset: part; }
.series-card li { counter-increment: part; }
.series-card a { display: flex; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 8px; color: var(--ink-soft); font-size: 0.93rem; line-height: 1.35; text-decoration: none; }
.series-card a::before {
  content: counter(part);
  display: grid;
  flex: none;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}
.series-card a:hover { background: var(--bg); color: var(--ink); }
.series-card a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.series-card a[aria-current="page"]::before { background: var(--on-accent); color: var(--accent); }

.gallery-section { padding-bottom: 2.5rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.gallery a { display: block; overflow: hidden; border-radius: 10px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.gallery a:hover img { transform: scale(1.03); }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); }
.pager a {
  flex: 1 1 18rem;
  max-width: 30rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--ink); }
.pager .next { margin-left: auto; text-align: right; }
.pager small { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.76rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; }
.pager span { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; line-height: 1.25; }

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