/* ClimbingWyoming.com — Modern Static Rebuild
   Focus: Free Climbing Guides · Western Wyoming · Responsive · No dynamic features */

:root {
  --bg: #f6f4f0;
  --bg-elevated: #ffffff;
  --bg-muted: #ebe7e0;
  --ink: #1a1f26;
  --ink-soft: #3d4a5c;
  --ink-faint: #4a5568; /* ≥4.5:1 on --bg for small text */
  --border: #ddd6cb;
  --accent: #1f5f7a;
  --accent-hover: #164a5f;
  --accent-soft: #e6f1f6;
  --warm: #c26a3a;
  --warm-soft: #f8ebe3;
  --granite: #5c6570;
  --hero-from: #0d1b2a;
  --hero-mid: #1b3a4b;
  --hero-to: #2d5a6b;
  --shadow-sm: 0 1px 2px rgba(26, 31, 38, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 31, 38, 0.08);
  --shadow-lg: 0 20px 48px rgba(26, 31, 38, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --max: 1120px;
  --header-h: 68px;
  --font-sans: "DM Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main grows so the footer sits at the bottom on short pages */
body > main {
  flex: 1 0 auto;
  min-width: 0;
  max-width: 100%;
}

::selection {
  background: rgba(31, 95, 122, 0.22);
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
.guide-card:focus-visible,
.supporter:focus-visible,
.gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Skip link: screen-reader only (not shown visually, including on focus) */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ensure skip target can receive focus without a heavy outline flash */
#main:focus {
  outline: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -0.025em; font-weight: 600; }
h2 { font-size: clamp(1.45rem, 2.5vw, 1.9rem); letter-spacing: -0.02em; font-weight: 600; }
h3 { font-size: 1.15rem; font-family: var(--font-sans); font-weight: 650; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2rem, 720px);
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 244, 240, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  background: rgba(246, 244, 240, 0.96);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

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

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Footer logos sit on dark navy — keep full color mark */
.site-footer .logo-mark {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 4px;
  box-sizing: border-box;
}

.logo-text span {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--bg-muted);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.2s var(--ease), opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1.15rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.25s var(--ease), opacity 0.2s ease, visibility 0.25s;
    gap: 0.2rem;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  /* Closed mobile menu must not stay in tab order (inert set in JS as well) */
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav a {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
  }
}

/* —— Hero (big-sky cinematic) —— */
.hero {
  position: relative;
  color: #fff;
  background: #0d1b2a;
  overflow: hidden;
  min-height: clamp(28rem, 72vh, 40rem);
  display: flex;
  align-items: flex-end;
  padding: clamp(4rem, 12vw, 7.5rem) 0 clamp(3.25rem, 8vw, 5rem);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Coomb’s Crossover: climber mid-left — prefer crop from the right */
  object-position: left 42%;
  display: block;
  transform: scale(1.02);
}

.hero-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-media picture .hero-photo {
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* Lighter wash so the photo reads; keep enough left/bottom tint for type */
  background:
    linear-gradient(
      105deg,
      rgba(8, 16, 24, 0.58) 0%,
      rgba(13, 27, 42, 0.38) 38%,
      rgba(13, 27, 42, 0.18) 68%,
      rgba(45, 90, 107, 0.08) 100%
    ),
    linear-gradient(
      180deg,
      rgba(8, 16, 24, 0.18) 0%,
      transparent 42%,
      rgba(8, 16, 24, 0.42) 100%
    ),
    radial-gradient(ellipse 70% 55% at 85% 18%, rgba(194, 106, 58, 0.1), transparent 55%);
  pointer-events: none;
}

.hero-range {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(28%, 11rem);
  pointer-events: none;
}

.hero-range svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: min(100% - 2rem, var(--max));
  width: 100%;
  min-width: 0; /* flex child of .hero: allow action buttons to wrap on small screens */
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 1rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--warm);
  border-radius: 1px;
}

.hero h1 {
  color: #fff;
  max-width: 14ch;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  font-size: clamp(2.15rem, 5.2vw, 3.35rem);
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: rgba(255, 255, 255, 0.94);
  max-width: 34ch;
  margin-bottom: 1.75rem;
  line-height: 1.55;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 100%;
}

@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
  }
}

.hero .btn-primary {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.hero .btn-ghost {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.06);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: #fff;
  color: var(--hero-from);
}

.btn-primary:hover {
  background: var(--bg);
  color: var(--hero-from);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* —— Sections —— */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

/* Stacked sections without double padding (home route supplements, guides regions) */
.section--tight-top {
  padding-top: 0;
}

/* Homepage climbing-guides index: intro + region chips, then tight region grids */
.section.guides-intro {
  padding-bottom: 0.5rem;
}

.section.guides-intro .guide-filters {
  margin-bottom: 0;
}

/* Homepage note about the next guidebook */
.field-strip {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  min-width: 0;
  max-width: 100%;
}

.field-strip .section-header {
  margin-bottom: 0;
}

.field-strip .section-lead {
  max-width: 58ch;
}

/* Features band: elevated “mat” under cinematic hero */
.section.features {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: clamp(2.75rem, 5.5vw, 4rem) 0;
  position: relative;
  z-index: 1;
}

.section.features .feature-grid {
  gap: 1.75rem 2rem;
}

/* Featured guides: a bit more breathing room after elevated features */
.section.features + .section {
  padding-top: clamp(3.25rem, 6.5vw, 5.25rem);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-header h2 { margin: 0; }

.section-kicker {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.section-lead {
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0.4rem 0 0;
}

.link-all {
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  color: var(--accent);
  transition: color 0.15s ease, transform 0.15s var(--ease);
}

.link-all:hover {
  color: var(--accent-hover);
}

.link-all::after {
  content: " →";
  display: inline-block;
  transition: transform 0.15s var(--ease);
}

.link-all:hover::after {
  transform: translateX(3px);
}

/* —— Guide cards —— */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cfc6b8;
  color: inherit;
}

.guide-card:hover .card-media .placeholder,
.guide-card:hover .card-media img {
  transform: scale(1.03);
}

.card-media {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: var(--bg-muted);
}

.card-media img,
.card-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.card-media img {
  object-fit: cover;
  object-position: left center; /* default; override with --focus-* utilities */
  transition: transform 0.45s var(--ease);
}

.card-media--focus-center img,
.article-hero-media--focus-center img {
  object-position: center center;
}

.card-media--focus-right img,
.article-hero-media--focus-right img {
  object-position: right center;
}

.card-media picture {
  height: 100%;
}

.card-media picture img {
  height: 100%;
}

.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.45s var(--ease);
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(255, 255, 255, 0.1), transparent 55%),
    linear-gradient(155deg, var(--hero-mid) 0%, var(--hero-to) 55%, #1a3a48 100%);
}

/* Soft vignette instead of “Placeholder” labels */
.placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 16, 24, 0.28) 100%);
  pointer-events: none;
}

.placeholder svg {
  width: 58%;
  max-width: 180px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.placeholder-ice {
  background:
    radial-gradient(ellipse 70% 50% at 60% 15%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(145deg, #1a3a52, #3d7a9a 55%, #8eb8c9);
}

.placeholder-granite {
  background:
    radial-gradient(ellipse 70% 50% at 60% 15%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(145deg, #3d4248, #6b7280 50%, #9ca3af);
}

.placeholder-forest {
  background:
    radial-gradient(ellipse 70% 50% at 60% 15%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(160deg, #1e3a2f, #3d6b4f 50%, #6b8f71);
}

.placeholder-dusk {
  background:
    radial-gradient(ellipse 70% 50% at 70% 10%, rgba(255, 220, 180, 0.15), transparent 50%),
    linear-gradient(145deg, #2a1f3d, #5c3d6b 45%, #c26a3a);
}

.placeholder-warm {
  background:
    radial-gradient(ellipse 70% 50% at 60% 15%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(145deg, #6b4c3b, #a67c52 50%, #c9a66b);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.25rem 1.35rem;
  gap: 0.5rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-warm {
  background: var(--warm-soft);
  color: var(--warm);
}

.tag-muted {
  background: var(--bg-muted);
  color: var(--ink); /* stronger contrast on muted chips */
}

.card-body h3 {
  margin: 0;
  font-size: 1.15rem;
  transition: color 0.15s ease;
}

.guide-card:hover h3 {
  color: var(--accent);
}

.card-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.card-footer .read {
  font-weight: 600;
  color: var(--accent);
  transition: transform 0.15s var(--ease);
}

.guide-card:hover .card-footer .read {
  transform: translateX(2px);
}

/* —— Feature strip —— */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.feature:hover {
  background: rgba(230, 241, 246, 0.45);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}

.feature:hover .feature-icon {
  transform: translateY(-2px);
  background: #d9ebf3;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  margin-bottom: 0.35rem;
}

.feature p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.feature cite,
.hero-lead cite,
.footer-blurb cite {
  font-style: italic;
  font-family: var(--font-serif);
}

/* —— Page hero (inner pages) —— */
/* Historic USGS topo (public domain) — static; no motion */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.25rem, 5vw, 3.25rem) 0 2rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-muted);
}

/* Historic USGS pair: Grand Teton 1899 + Fremont Peak 1906 (static, no motion) */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/images/topo/western-wyoming-historic.jpg");
  background-repeat: no-repeat;
  background-position: center 38%;
  background-size: cover;
  /* Slightly higher contrast so contour lines read as real map paper */
  opacity: 0.62;
  filter: contrast(1.24) saturate(0.9) brightness(0.96);
}

/* Soft wash + left-weighted veil so titles stay sharp over denser contours */
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 90% 115% at 16% 38%,
      rgba(246, 244, 240, 0.8) 0%,
      rgba(246, 244, 240, 0.34) 52%,
      rgba(246, 244, 240, 0.44) 100%
    ),
    linear-gradient(
      180deg,
      rgba(246, 244, 240, 0.38) 0%,
      rgba(246, 244, 240, 0.46) 48%,
      rgba(246, 244, 240, 0.68) 100%
    );
}

.page-hero > .container {
  position: relative;
  z-index: 1;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  text-shadow: 0 1px 0 rgba(246, 244, 240, 0.7);
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb span[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.breadcrumb span[aria-hidden] { opacity: 0.5; }

.page-hero h1 {
  margin-bottom: 0.5rem;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(246, 244, 240, 0.85);
}

.page-hero .lead {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 55ch;
  margin: 0;
  text-shadow: 0 1px 0 rgba(246, 244, 240, 0.75);
}

/* Meta chips under breadcrumb (guide pages) */
.page-hero .card-meta {
  margin-bottom: 0.75rem;
}

/* Tags stay legible over the map field */
.page-hero .tag {
  background: rgba(230, 241, 246, 0.92);
  box-shadow: 0 1px 0 rgba(246, 244, 240, 0.6);
}

.page-hero .tag-muted {
  background: rgba(246, 244, 240, 0.9);
  color: var(--ink);
}

/* —— Article —— */
.article {
  padding: 2.5rem 0 4rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-aside {
    order: -1;
  }
  /* Sticky download panel is awkward above the fold on small screens */
  .download-card {
    position: static;
  }
}

.prose {
  font-size: 1.05rem;
  max-width: 68ch;
}

.prose > *:first-child { margin-top: 0; }

.prose h2 {
  margin-top: 2.25rem;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.45rem;
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.05rem;
}

.prose ul, .prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1.15em;
}

.prose li { margin-bottom: 0.4em; }

.prose li::marker { color: var(--accent); }

.prose strong { font-weight: 650; }

.article-hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
  aspect-ratio: 21 / 9;
  min-height: 180px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--bg-muted);
}

.article-hero-media .placeholder {
  min-height: 180px;
}

.article-hero-media picture,
.article-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.article-hero-media img {
  object-fit: cover;
  object-position: left center;
}

.beta-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.beta-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-list li:hover {
  border-color: #cfc6b8;
  box-shadow: var(--shadow-sm);
}

.beta-list li strong {
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.beta-list li p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 0 rgba(26, 31, 38, 0.04);
}

.callout.warning {
  background: #fef6e8;
  border-left-color: var(--warm);
}

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

.callout h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.callout.warning h3 { color: var(--warm); }

/* Back link at end of guide prose */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.back-link:hover {
  color: var(--accent-hover);
}

.prose-cta {
  margin-top: 1.75rem;
  margin-bottom: 0;
}

.muted-note {
  margin-top: 2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Download card — product-style sticky panel */
.download-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  border-top: 3px solid var(--accent);
  transition: box-shadow 0.2s var(--ease);
}

.download-card:hover {
  box-shadow: var(--shadow-lg);
}

.download-card h2 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}

.download-card .meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
  line-height: 1.45;
}

.download-card .btn {
  width: 100%;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 8px rgba(31, 95, 122, 0.22);
}

.download-card .btn-outline {
  box-shadow: none;
}

.download-card .btn + .btn {
  margin-top: 0.45rem;
}

.download-card .fine-print {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 1rem;
}

.download-card .aside-tags {
  margin-top: 0.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.download-card .aside-tags:empty {
  display: none;
}

/* Guides index filters */
.guide-filters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 1.75rem;
  padding: 0.85rem 0 0;
}

/* On historic topo page-heroes, sit filters in a frosted panel */
.page-hero .guide-filters {
  margin: 1.25rem 0 0;
  padding: 0.95rem 1.05rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(221, 214, 203, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guide-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.guide-filters-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 0.25rem;
  min-width: 3.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.filter-chip:hover,
button.filter-chip:hover {
  color: var(--ink);
  border-color: #cfc6b8;
  background: #fff;
}

.filter-chip.is-active,
.filter-chip[aria-current="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(31, 95, 122, 0.2);
}

.filter-chip.is-active:hover,
.filter-chip[aria-current="true"]:hover {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.guide-section {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.guide-section .section-header {
  margin-bottom: 1.35rem;
}

.guide-section .section-header h2 {
  letter-spacing: -0.02em;
}

.guide-section.is-dimmed .guide-card:not(.is-match) {
  opacity: 0.28;
  pointer-events: none;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.guide-filters-empty {
  display: none;
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.guide-filters-empty.is-visible {
  display: block;
}

.guide-filters-empty[hidden] {
  display: none !important;
}

.aside-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

/* —— Photo gallery —— */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.75rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  text-align: left;
}

.gallery-item .placeholder {
  transition: transform 0.3s var(--ease);
}

.gallery-item:hover .placeholder {
  transform: scale(1.04);
}

.gallery-item figcaption,
.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.65rem 0.55rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 15, 20, 0.92);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  max-width: min(90vw, 800px);
  width: 100%;
  text-align: center;
}

.lightbox-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* —— About —— */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
}

.supporter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* About sidebar: friends & supporters panel */
.about-aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.friends-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--warm);
}

.friends-panel h2 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.friends-panel > .meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
  line-height: 1.45;
}

.supporter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.supporter-stack .supporter {
  display: block;
}

.supporter {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.supporter-stack .supporter {
  background: var(--bg);
  padding: 0.9rem 1rem;
}

.supporter:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.supporter h3 {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
}

.supporter p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .about-aside {
    position: static;
  }
}

/* —— Footer —— */
.site-footer {
  background: var(--hero-from);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

/* Compact bar used on individual guide pages */
.site-footer--compact {
  padding: 1.25rem 0;
}

.footer-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-compact-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.footer-compact-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-compact-nav a:hover,
.footer-compact-nav a:focus-visible {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

.site-footer .logo {
  color: #fff;
  margin-bottom: 0.75rem;
}

.site-footer .logo:hover { color: #fff; }

.site-footer .logo-text span { color: rgba(255, 255, 255, 0.5); }

.footer-blurb {
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 32ch;
  margin: 0;
}

.footer-col h3 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li { margin-bottom: 0.45rem; }

.footer-col a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  text-underline-offset: 0.15em;
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.62);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-bottom a:hover,
.footer-bottom a:focus-visible {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.disclaimer-bar {
  background: #0a1219;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  padding: 0.85rem 0;
  text-align: center;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.disclaimer-bar .container {
  max-width: 720px;
}

/* Soft divider between footer and disclaimer */
.site-footer + .disclaimer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* —— Scroll to top ——
   Injected by main.js; only visible when page scrolls and user is down-page.
   Fixed corner placement, clear of content flow (no layout shift). */
.scroll-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 90; /* below sticky header (100) and lightbox (200) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(26, 31, 38, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 0.2s var(--ease),
    visibility 0.2s var(--ease),
    transform 0.2s var(--ease),
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: #fff;
  color: var(--accent-hover);
  border-color: rgba(31, 95, 122, 0.28);
  box-shadow: var(--shadow-lg);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.scroll-top svg {
  display: block;
}

/* —— Utility —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible focus ring for cards that are links */
.guide-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-center { text-align: center; }

.mt-0 { margin-top: 0; }

.stack-sm > * + * { margin-top: 0.75rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .guide-card:hover,
  .guide-card:hover .card-media .placeholder,
  .guide-card:hover .card-media img,
  .gallery-item:hover .placeholder {
    transform: none;
  }
  .hero-photo {
    transform: none;
  }
  .guide-card:hover .card-footer .read {
    transform: none;
  }
  .feature:hover .feature-icon {
    transform: none;
  }
  .beta-list li:hover {
    box-shadow: none;
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-actions, .download-card .btn {
    /* keep download info printable */
  }
  .site-header, .nav-toggle, .lightbox, .disclaimer-bar, .scroll-top {
    display: none !important;
  }
  .hero {
    background: #fff !important;
    color: #000 !important;
    padding: 1rem 0;
    min-height: 0;
    display: block;
  }
  .hero-media { display: none !important; }
  .hero h1, .hero-lead { color: #000 !important; text-shadow: none !important; }
  .page-hero::before,
  .page-hero::after {
    display: none !important;
  }
  .page-hero {
    background: #fff !important;
  }
  body { background: #fff; }
  .guide-card { break-inside: avoid; }
}
