/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --ink:          #16332B;   /* deep forest — headers, footer, primary dark */
  --ink-soft:     #2C5245;
  --marigold:     #8FBF6F;   /* primary accent — leaf green, warmth against the dark forest */
  --clay:         #C98D3E;   /* secondary accent — warm amber, used sparingly for urgency/contrast */
  --paper:        #F8F9F4;   /* light background, faint green tint */
  --sand:         #E9EFE1;   /* alternate section background — pale sage */
  --text:         #1E2A22;
  --text-soft:    #55614F;
  --border:       #CBD8BE;

  --pink:         #F6D9DE;   /* pastel pink — used for highlighted call-out boxes */
  --pink-border:  #E7B8C2;
  --pink-text:    #7A3B49;   /* deep rose, for text/labels sitting on pink */

  --green-box:        #DCEBD9;   /* pastel green — used for the timeline description boxes */
  --green-box-border: #B9D3B2;

  --font-display: "Spectral", Georgia, serif;
  --font-body:    "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
  --radius: 4px;

  /* Spacing scale. rem is relative to the root font size, so all spacing
     grows or shrinks if the user changes their browser's text size. */
  --space-2xs: 0.25rem;  /*  4px */
  --space-xs:  0.5rem;   /*  8px */
  --space-sm:  0.75rem;  /* 12px */
  --space-md:  1rem;     /* 16px */
  --space-lg:  1.5rem;   /* 24px */
  --space-xl:  2rem;     /* 32px */
  --space-2xl: 3rem;     /* 48px */

  /* Fluid spacing. clamp(minimum, preferred, maximum): the vw value scales
     with the screen width, and the min/max keep it from getting too small
     on phones or too large on wide monitors. */
  --gutter:      clamp(1rem, 4vw, 1.5rem);     /* page side padding: 16px to 24px */
  --section-pad: clamp(3rem, 8vw, 4.5rem);     /* section top/bottom: 48px to 72px */
  --band-pad:    clamp(2.5rem, 6vw, 3.5rem);   /* dark bands (stats, footer): 40px to 56px */
  --grid-gap:    clamp(1.5rem, 4vw, 3rem);     /* between columns and cards: 24px to 48px */

  --header-height: 4.25rem;  /* 68px; used to keep anchor targets clear of the sticky header */
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* When a nav link jumps to a section, leave room for the sticky header
     so the section's heading isn't hidden underneath it. */
  scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;   /* em: the gap under a heading scales with that heading's size */
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; max-width: 62ch; color: var(--text); }  /* ch: keeps lines a readable length */
a { color: var(--ink); }

.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;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* ==========================================================================
   Layout: sections and the content wrapper
   Each has ONE job, set with side-specific properties so they can never
   overwrite each other:
     section -> vertical spacing (padding-block) and background
     .wrap   -> width limit and side padding (padding-inline)
   ========================================================================== */
section { padding-block: var(--section-pad); }

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-lede {
  color: var(--text-soft);
  max-width: 60ch;
  font-size: 1.05rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.625rem;   /* 13px 26px */
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink-soft); }

.btn-ghost {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  /* min-height instead of height: at least 68px, but it can grow if the
     logo ever wraps onto two lines instead of spilling out. */
  min-height: var(--header-height);
  padding-block: var(--space-xs);
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}

.primary-nav {
  display: flex;
  gap: var(--space-xl);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;    /* 40px tap target */
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Hero
   The section supplies vertical padding; .hero (on the inner .wrap)
   is only the grid.
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
}

/* Grid items default to min-width: auto and refuse to shrink below their
   content. Setting 0 lets the scrolling timeline stay inside the screen
   instead of pushing the column wider than a phone. */
.hero > * { min-width: 0; }

.hero-lede {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 52ch;
  background: var(--pink);
  border: 1px solid var(--pink-border);
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-lg);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.hero-timeline {
  border-left: 2px solid var(--border);
  padding-left: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline-item p {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: var(--space-xs) 0 0;   /* 8px between the year label and its box */
  background: var(--green-box);
  border: 1px solid var(--green-box-border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--pink-text);
  background: var(--pink);
  border: 1px solid var(--pink-border);
  border-radius: var(--radius);
  padding: 0.2rem var(--space-md);
}

/* ==========================================================================
   Stat band
   ========================================================================== */
.stat-band {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--band-pad);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--grid-gap);
}

.stat {
  border-top: 2px solid var(--marigold);
  padding-top: var(--space-md);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 500;
  color: var(--marigold);
}

.stat-label {
  font-size: 0.92rem;
  color: #C9D6C2;
  max-width: 34ch;
}

.stat-source {
  font-size: 0.8rem;
  color: #8CA283;
  margin: var(--space-xl) 0 0;
}

/* ==========================================================================
   Issue section
   ========================================================================== */
.issue-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
}

.pull-quote {
  background: var(--sand);
  border-left: 3px solid var(--clay);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: var(--radius);
}

.pull-quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink);
}

/* ==========================================================================
   Stories
   ========================================================================== */
.stories { background: var(--sand); }

.story-links {
  display: grid;
  gap: 1px;   /* 1px gaps show the border color through, drawing hairline dividers */
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: var(--space-xl);
  border-radius: var(--radius);
  overflow: hidden;
}

.story-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--paper);
  padding: var(--space-lg);
  text-decoration: none;
  transition: background 0.15s ease;
}
.story-link:hover { background: #F3EEE3; }

.story-org {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 1.05rem;
}

.story-desc {
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ==========================================================================
   Take action
   ========================================================================== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.625rem);
}

.action-card p { font-size: 0.94rem; color: var(--text-soft); }

.action-card a {
  display: inline-block;
  margin-top: var(--space-xs);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--clay);
  text-decoration: none;
}
.action-card a:hover { text-decoration: underline; }

/* ==========================================================================
   FAQ / accordion
   ========================================================================== */
.faq { background: var(--sand); }

.accordion {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.accordion-item { border-bottom: 1px solid var(--border); }

.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1.25rem var(--space-2xs);
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.accordion-trigger::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--clay);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-trigger[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.accordion-panel p {
  padding: 0 var(--space-2xs) 1.25rem;
  color: var(--text-soft);
  max-width: 68ch;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: #C7CEDC;
  padding-block: var(--band-pad) var(--space-lg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--grid-gap);
}

.logo-light { color: var(--paper); }

.footer-about p {
  font-size: 0.9rem;
  color: #AAB9A2;
  margin-top: var(--space-sm);
}

.footer-links, .footer-sources {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a, .footer-sources a {
  color: #C9D6C2;
  text-decoration: none;
  font-size: 0.92rem;
}
.footer-links a:hover, .footer-sources a:hover { color: var(--marigold); }

.footer-heading {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #8CA283;
  margin-bottom: var(--space-2xs);
}

.footer-fine {
  font-size: 0.78rem;
  color: #71836A;
  margin: var(--space-2xl) 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #2F4A3D;
  max-width: none;
}

@media (width < 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-timeline {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--border);
    padding-top: var(--space-lg);
    flex-direction: row;
    overflow-x: auto;
    gap: var(--space-lg);
    padding-bottom: var(--space-xs);   /* room for the horizontal scrollbar */
  }
  .timeline-item { min-width: 200px; }

  .issue-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (width < 720px) {
  .primary-nav {
    position: absolute;
    top: 100%;   /* directly under the header, whatever its height */
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .primary-nav.open { max-height: 320px; }
  .primary-nav a {
    padding: var(--space-md) var(--gutter);
    border-top: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }

  /* .stat-grid and .action-grid use repeat(auto-fit, minmax(...)), so they
     collapse to one column on their own when a card can't fit at its
     minimum width, without needing a breakpoint here. */
  .footer-inner { grid-template-columns: 1fr; }
}

@media (width < 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav-toggle-bar,
  .story-link,
  .accordion-trigger::after,
  .accordion-panel,
  .primary-nav {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}