/*
  Open the Gates — styles.css
  Mobile-first: we style phones first, then layer on bigger-screen
  styles using media queries. Units are rem, em, %, vw/vh and clamp()
  only — no pixels anywhere.
*/

/* ---------- Design tokens (CSS custom properties) ---------- */
:root {
  /* Colors */
  --ink: #14213d;          /* deep navy text */
  --paper: #ffffff;        /* white */
  --cream: #f6f3ec;        /* soft section background */
  --orange: #f26419;       /* brand orange (accents + buttons) */
  --lime: #8fc93a;         /* sporty green accent */
  --slate: #33415c;        /* muted text */

  /* Type sizes using clamp() so text scales smoothly between screens */
  --h1: clamp(2.2rem, 6vw, 4.2rem);
  --h2: clamp(1.6rem, 4vw, 2.6rem);
  --h3: clamp(1.15rem, 2.5vw, 1.4rem);
  --body: clamp(1rem, 1.4vw, 1.125rem);

  /* Consistent spacing */
  --space: clamp(3rem, 8vw, 6rem);  /* uses % of the viewport width */
}

/* ---------- Base / reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;   /* smooth scroll for anchor links */
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: var(--body);
}

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

a {
  color: inherit;   /* links pick up their parent color */
}

/* A heading style used across sections */
h1, h2 {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Tiny uppercase label above headings */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--orange);
  margin-bottom: 0.8rem;
}

h2 {
  font-size: var(--h2);
  margin-bottom: 1.5rem;
}

/* ---------- Header + navigation ---------- */
.site-header {
  position: sticky;          /* stays at the top while scrolling */
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
}

.header-inner {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* The brand name */
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo::before {
  /* a little orange "gate" dot to brand it — pure CSS, no image */
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.45em;
  background: var(--orange);
  border-radius: 50%;
}

/* Hamburger button — hidden by default on big screens, shown on small. */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

/* The three little bars inside the hamburger */
.bar {
  width: 1.6rem;
  height: 0.2rem;
  background: var(--paper);
  border-radius: 0.125rem;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* When the button is open (aria-expanded true), animate bars into an X */
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(0.5rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-0.5rem) rotate(-45deg); }

/* Navigation — hidden behind a slide on phones by default */
.primary-nav {
  display: none;                        /* collapsed on mobile */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ink);
}

/* When the nav has the "open" class (added by JS), show it */
.primary-nav.open {
  display: block;
}

.primary-nav ul {
  list-style: none;
  padding: 0 1.25rem 1.25rem;
}

.primary-nav li {
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.15);
}

.primary-nav a {
  display: block;
  padding: 0.9rem 0;
  text-decoration: none;
  font-weight: 600;
}

/* Orange "Take Action" pill inside the nav */
.primary-nav .nav-cta {
  margin-top: 0.6rem;
  text-align: center;
  background: var(--orange);
  border-radius: 999em;
  padding: 0.7rem 1rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 85vh;              /* most of the screen on mobile */
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--paper);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;             /* crop the photo to fill */
}

/* A translucent navy overlay so white text stays readable */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,33,61,0.92), rgba(20,33,61,0.25) 55%, rgba(20,33,61,0.1));
}

.hero-content {
  position: relative;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  width: 100%;
}

.hero h1 {
  font-size: var(--h1);
  max-width: 16em;
  margin-bottom: 1rem;
}

.hero-lede {
  max-width: 34em;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

/* A button — the main call to action */
.btn {
  display: inline-block;
  background: var(--orange);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  padding: 0.9rem 1.7rem;
  border-radius: 999em;
  box-shadow: 0 0.25rem 0.875rem rgba(242, 100, 25, 0.4);
  transition: transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-0.125rem);
}

.photo-credit {
  margin-top: 1.2rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* ---------- Generic section shell ---------- */
.section {
  padding: var(--space) 1.25rem;
}

/* Alternate backgrounds to separate sections */
.section-alt {
  background: var(--cream);
}

.section-cta {
  background: var(--ink);
  color: var(--paper);
}

.section-inner {
  max-width: 70rem;
  margin: 0 auto;
}

/* ----- The Issue ----- */
.issue-grid {
  display: grid;
  grid-template-columns: 1fr;   /* one column on mobile */
  gap: 1.5rem;
}

.issue-text p {
  margin-bottom: 1rem;
}

.issue-media img,
.barrier-media img,
.solution-media-row img,
.action-media img {
  border-radius: 1rem;
}

figcaption {
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 0.5rem;
  opacity: 0.85;
}

.section-cta figcaption {
  color: inherit;
}

/* ----- Statistics ----- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.stat {
  background: var(--paper);
  border: 0.125rem solid var(--ink);
  border-radius: 1rem;
  padding: 1.5rem;
}

.stat-number {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-detail {
  margin-bottom: 0.75rem;
}

.stat-source {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ----- Barriers ----- */
.barrier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.barrier {
  background: var(--cream);
  border-left: 0.3rem solid var(--orange);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.barrier h3 {
  font-size: var(--h3);
  margin-bottom: 0.5rem;
}

/* ----- Solutions ----- */
.solution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.solution {
  background: var(--paper);
  border: 0.125rem solid var(--lime);
  border-radius: 1rem;
  padding: 1.25rem;
}

.solution h3 {
  font-size: var(--h3);
  margin-bottom: 0.5rem;
  color: var(--orange);
}

.solution-media-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ----- Resources ----- */
.resources-intro {
  max-width: 34em;
  margin-bottom: 1.5rem;
}

.resource-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.resource-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.resource-col a {
  background: var(--cream);
  padding: 0.9rem 1rem;
  border-radius: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  border-left: 0.25rem solid var(--orange);
  transition: background 0.15s ease, transform 0.15s ease;
}

.resource-col a:hover {
  background: #ffe8da;
  transform: translateX(0.25rem);   /* subtle nudge on hover */
}

/* ----- Take Action ----- */
.action-media {
  margin-bottom: 2rem;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.action {
  background: rgba(255, 255, 255, 0.08);
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1.25rem;
}

.action h3 {
  font-size: var(--h3);
  color: var(--lime);
  margin-bottom: 0.5rem;
}

.callout {
  text-align: center;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0d1526;
  color: var(--paper);
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.25rem;
}

.footer-tagline {
  color: var(--lime);
  margin: 0.4rem 0 1rem;
}

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* =========================================================
   MEDIA QUERIES — bigger screens
   ========================================================= */

/* Tablets (portrait) and up */
@media (min-width: 40rem) {
  .stats-grid,
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .barrier-grid,
  .solution-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .solution-media-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .issue-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

/* Desktop — show the nav in a row and hide the hamburger */
@media (min-width: 60rem) {
  .nav-toggle {
    display: none;              /* no hamburger on desktop */
  }

  .primary-nav {
    display: block;             /* always visible */
    position: static;           /* part of the normal header flow */
    background: none;
  }

  .primary-nav ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
  }

  .primary-nav li {
    border-top: none;
  }

  .primary-nav a {
    padding: 0.4rem 0;
  }

  .primary-nav .nav-cta {
    margin-top: 0;
    padding: 0.6rem 1.3rem;
  }

  .hero {
    min-height: 92vh;
  }
}
