/* ============================================================
   Rooted in Forsyth — shared styles (used by every page)
   Change colors here once and every page updates.

   Accessibility rules we follow (WCAG 2.2 level AA):
   - Text contrast at least 4.5 : 1 (we checked every color pair below)
   - Borders of inputs/buttons at least 3 : 1 against the background
   - Visible yellow focus outline for keyboard users
   - Animations turn off for people who ask for "reduced motion"
   - Works in Windows High Contrast mode (see the end of this file)
   ============================================================ */

:root {
  /* Greens: community and growth */
  --green-deep:  #163D29;  /* darkest: banner gradients, footer            */
  --green-dark:  #24543A;  /* header, headings, buttons (8.7 : 1 vs white) */
  --green-mid:   #4F8A5B;  /* decoration only (too light for small text)   */
  --link:        #3B7047;  /* links: 5.8 : 1 on white, passes AA           */
  --green-light: #E7F1E6;  /* tinted backgrounds                           */
  --green-pale:  #F5F9F4;  /* soft panels                                  */

  /* Sun: highlight + keyboard focus */
  --sun:      #F2C14E;
  --sun-pale: #FDF3D7;

  --text:  #1D2B22;        /* body text: 12.7 : 1 on light green           */
  --muted: #4A5D50;        /* secondary text: 7 : 1 on white               */
  --white: #FFFFFF;        /* always white: text on dark green, the logo tile */
  --ink: #1D2B22;          /* always dark: text on yellow or white pills, even in dark mode */

  /* Colors that switch in dark mode (see "Dark mode" at the end of this file) */
  --page: #FFFFFF;         /* page background */
  --surface: #FFFFFF;      /* cards, panels, inputs */
  --heading: #24543A;      /* headings and green text on light backgrounds */
  --border: #D8E8D8;       /* decorative card edges                        */
  --input-border: #6E8F75; /* form borders: 3.6 : 1, passes the 3 : 1 rule */

  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(22, 61, 41, 0.08);
  --shadow-lg: 0 14px 34px rgba(22, 61, 41, 0.16);
  --max-width: 1140px;
}

* { box-sizing: border-box; }

/* Anything with the "hidden" attribute stays hidden, even if a class gives it a display value
   (for example the "Try again" button, which is also a .btn) */
[hidden] { display: none !important; }

/* Always reserve space for the scrollbar so the logo never shifts between pages */
html { scrollbar-gutter: stable; scroll-behavior: smooth; }

/* Sticky footer: the page is a column and <main> stretches to fill it,
   so the footer always sits at the bottom, even on short pages */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Atkinson Hyperlegible", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.6;
}
main { flex: 1; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
img { max-width: 100%; }

/* Visible keyboard focus (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--green-deep);  /* dark ring so yellow shows on light AND dark backgrounds */
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Hides text visually but keeps it for screen readers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Lets keyboard users jump past the menu */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--sun); color: var(--ink);
  padding: 8px 12px; border-radius: 6px; z-index: 30; font-weight: 700; }
.skip-link:focus { left: 8px; }


/* ---------- Header + navigation (same on every page) ---------- */
.site-header {
  background: var(--green-dark); color: var(--white);
  border-bottom: 4px solid var(--sun);             /* sun-colored accent line */
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px;
}
.logo { color: var(--white); text-decoration: none; display: flex; align-items: center; }
.nav-links { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  color: var(--white); text-decoration: none; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; display: inline-block;  /* big tap targets */
  transition: background-color 0.2s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }
/* Current page = yellow pill with dark text (8.8 : 1) */
.nav-links a[aria-current="page"] { background: var(--sun); color: var(--ink); }

/* Right side of the header: the Dark mode switch (and the Menu button on phones) */
.header-actions { display: flex; align-items: center; gap: 10px; }
#main-nav { margin-left: auto; }   /* keeps the menu next to the Dark mode button, on the right */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--white); font: inherit; font-weight: 700; font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.14); }
.theme-toggle[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--ink); }   /* on = yellow, like the current page */

/* Phone menu button (three lines + the word "Menu"). Hidden on bigger screens. */
.menu-button {
  display: none; align-items: center; gap: 10px;
  background: transparent; color: var(--white); font: inherit; font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.menu-button:hover { background: rgba(255, 255, 255, 0.14); }
/* The three lines: one span, plus a line above (::before) and below (::after) */
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; width: 18px; height: 2px; background: var(--white); border-radius: 2px; position: relative;
}
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }

@media (max-width: 900px) {
  /* Phones and tablets: logo on the left, Dark mode + Menu buttons on the right, menu drops down underneath */
  .has-menu-button .site-header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .has-menu-button .menu-button { display: inline-flex; padding: 8px 12px; gap: 8px; }
  .has-menu-button #main-nav { display: none; width: 100%; order: 3; }   /* the open menu drops below the logo and buttons */
  .has-menu-button #main-nav.is-open { display: block; }
  .has-menu-button .nav-links { flex-direction: column; gap: 4px; padding-bottom: 6px; }
  .has-menu-button .nav-links a { display: block; padding: 12px 16px; }
  .header-actions { gap: 6px; }
  .theme-toggle { padding: 8px 10px; }
  .theme-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* icon only on phones; screen readers still hear "Dark mode" */
}
/* Medium screens: the Dark mode button shows just its icon so the full menu fits on one row */
@media (max-width: 1100px) {
  .theme-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-toggle { padding: 8px 10px; }
}
@media (max-width: 360px) {
  .logo img { height: 34px; }   /* very small phones: a slightly smaller logo and an icon-only Menu button keep the header on one row */
  .menu-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* On bigger screens the header stays at the top while you scroll */
@media (min-width: 901px) {
  .site-header { position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
  html { scroll-padding-top: 96px; }  /* so #links don't hide under the header */
}


/* ---------- Banners at the top of each page ----------
   Dark green gradient + a soft "sun glow" + our hills drawing at the bottom.
   .hero is the big one on Home; .page-intro is the shorter one on other pages. */
.hero, .page-intro {
  position: relative;
  color: var(--white);
  background:
    url("images/hills.svg") center bottom / max(100%, 1200px) auto no-repeat,
    radial-gradient(circle at 88% 12%, rgba(242, 193, 78, 0.30), transparent 32%)  /* 0.30 keeps white text above 4.5 : 1 even on the glow */,
    linear-gradient(135deg, var(--green-deep) 0%, var(--green-dark) 55%, #2F6B47 100%);
}
.hero h1, .hero h2, .page-intro h1, .page-intro h2 { color: var(--white); }
.hero p, .page-intro p { color: #E8F2EA; }   /* 5.6 : 1 or better on every part of the gradient */

.page-intro { padding: 48px 0 110px; }
.page-intro h1 { margin: 0 0 8px; font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1.15; }
.page-intro p { margin: 0; max-width: 62ch; font-size: 1.15rem; }

.hero { padding: 64px 0 150px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1.25fr 0.75fr; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 0 0 14px; line-height: 1.1; }
.hero p { font-size: 1.2rem; max-width: 56ch; }
.highlight { color: var(--sun); }   /* 5.2 : 1 on green, and the text is large */
.eyebrow-light {
  display: inline-block; background: rgba(255, 255, 255, 0.12); color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px;
  padding: 4px 14px; font-size: 0.95rem; font-weight: 700; margin-bottom: 16px;
}

/* The little checklist "preview" on the Home page (decoration, hidden from screen readers) */
.preview-card {
  background: var(--white); color: var(--ink); border-radius: var(--radius-lg);   /* a picture of the checklist: stays light */
  padding: 22px; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3); rotate: 2deg;
  position: relative;
}
.preview-card h2 { color: var(--green-dark); font-size: 1.1rem; margin: 0 0 12px; }
.preview-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.preview-item:last-of-type { border-bottom: 0; }
.preview-check {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--input-border);
  display: grid; place-items: center; flex-shrink: 0; font-size: 0.8rem; font-weight: 700;
}
.preview-item.is-done .preview-check { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.preview-item.is-done span:last-child { text-decoration: line-through; color: var(--muted); }
.preview-card .progress-bar { margin-top: 14px; background: #E7F1E6; }   /* stays light: it is a picture of the checklist */
.preview-badge {
  position: absolute; top: -16px; right: -12px; background: var(--sun); color: var(--ink);
  font-weight: 700; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-lg);
  transform: rotate(-4deg);
}


/* ---------- Stats strip that overlaps the bottom of the Home banner ---------- */
.stats {
  position: relative; z-index: 1; margin-top: -80px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: 10px;
}
.stat { text-align: center; padding: 16px 10px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-number { display: block; font-size: 2.4rem; font-weight: 700; color: var(--heading); line-height: 1.1; }
.stat-label { color: var(--muted); font-weight: 700; }


/* ---------- Page sections ---------- */
section { padding: 48px 0; }
h1, h2, h3 { color: var(--heading); line-height: 1.25; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin: 4px 0 8px; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.1rem; }
.eyebrow { color: var(--link); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; }

/* Light green section with a faint dot pattern */
.section-tint {
  background-color: var(--green-pale);
  background-image: radial-gradient(rgba(36, 84, 58, 0.09) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.panel { background: var(--green-pale); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-dark); color: var(--white);
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--green-dark); font: inherit; font-weight: 700; cursor: pointer;
  transition: translate 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.btn:hover { background: var(--link); border-color: var(--link); color: var(--white);
  translate: 0 -2px; box-shadow: var(--shadow-lg); }
.btn-outline { background: var(--surface); color: var(--heading); }
.btn-outline:hover { background: var(--green-light); color: var(--heading); }
/* For dark banners: a yellow main button and a see-through second button */
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #FFD873; border-color: #FFD873; color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--white); color: var(--white); }
.btn-ghost:hover { background: var(--white); border-color: var(--white); color: var(--green-dark); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }


/* ---------- Grids used across pages ---------- */
/* Up to 3 per row: 6 cards make two even rows of 3 (no half-empty row) */
.grid-3 { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }   /* tablets and up: 3 across */

/* "How it works" step cards */
.feature {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: translate 0.2s, box-shadow 0.2s;
}
.feature:hover { translate: 0 -4px; box-shadow: var(--shadow-lg); }
.feature h3 { margin: 14px 0 6px; font-size: 1.3rem; }
.feature a { font-weight: 700; display: inline-block; padding: 6px 0; }  /* taller = easier to tap */
.feature-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-size: 2rem; background: linear-gradient(135deg, var(--green-light), #CFE6CF);
}
.step-number {
  position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sun); color: var(--ink); font-weight: 700;
}

/* "Good to know" fact cards */
.fact {
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--sun);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.fact-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.fact strong { display: block; color: var(--heading); font-size: 1.25rem; margin-bottom: 4px; }

/* Dark "call to action" panel (story teaser on Home) */
.cta-panel {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  border-radius: var(--radius-lg); padding: 34px; color: var(--white);
  background:
    radial-gradient(circle at 95% 10%, rgba(242, 193, 78, 0.35), transparent 35%),
    linear-gradient(135deg, var(--green-deep), var(--green-dark));
  box-shadow: var(--shadow-lg);
}
.cta-panel h2 { color: var(--white); margin: 0 0 6px; }
.cta-panel p { color: #E8F2EA; margin: 0; max-width: 60ch; }
.cta-panel > div { flex: 1; min-width: 240px; }
.cta-panel img { width: 96px; height: 96px; border-radius: 22px; background: var(--white); padding: 10px; }


/* ---------- Checklist ---------- */
.questions { box-shadow: var(--shadow-sm); }
.questions h2 { margin-top: 0; }
.questions-hint { margin: -6px 0 14px; color: var(--muted); }
/* Each group of questions: a plain box with a bold title (legend) */
.questions fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.questions fieldset:last-of-type { margin-bottom: 0; }
.questions legend { font-weight: 700; color: var(--heading); padding: 0; margin-bottom: 8px; font-size: 1.05rem; }
.legend-note { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
/* Every group uses the same 2 columns, so all question tiles are the same size */
.question-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.questions label { min-height: 86px; }   /* every tile the same height, even across groups (fits 2 lines) */
/* Each question looks like a big clickable tile */
.questions label {
  display: flex; gap: 12px; align-items: center; font-size: 1.05rem; font-weight: 700;
  background: var(--surface); border: 2px solid var(--input-border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.questions label:hover { border-color: var(--heading); }
.questions label:has(input:checked) { background: var(--green-light); border-color: var(--heading); }
.question-emoji { font-size: 1.5rem; }
.questions input, .task input { width: 24px; height: 24px; accent-color: var(--green-dark); flex-shrink: 0; cursor: pointer; }

.progress-wrap {
  margin: 28px 0; padding: 20px 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.progress-wrap p { margin: 10px 0 0; font-weight: 700; }
.progress-bar { height: 20px; background: var(--green-light); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; border-radius: 999px; transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--green-mid), var(--green-dark));
}
.all-done {
  background: var(--sun-pale); border: 2px solid var(--sun); border-radius: var(--radius);
  padding: 14px 18px; font-weight: 700; margin: 0 0 24px;
}

/* Timeline: a line down the left side, with a numbered circle for each stage
   (First week, First month, First 3 months). The circle turns into a yellow check when that stage is done. */
#task-list { position: relative; padding-left: 56px; }
#task-list::before {
  content: ""; position: absolute; left: 19px; top: 10px; bottom: 10px;
  width: 4px; border-radius: 2px; background: #B9D3BB;
}
.task-group h2 { position: relative; }
.stage-dot {
  position: absolute; left: -56px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-dark); color: var(--white); font-size: 1.1rem;
  box-shadow: 0 0 0 5px var(--page);   /* ring in the page color, so the line looks like it passes behind */
}
.stage-done .stage-dot { background: var(--sun); color: var(--ink); }
/* Red badge for tasks with a legal deadline (8.6 : 1 contrast) */
.deadline {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  background: #FDE8E8; color: #8B1E1E; font-weight: 700; font-size: 0.82rem;
  padding: 2px 10px; border-radius: 999px;
}
.task.done .deadline { background: var(--green-light); color: var(--muted); }
.task-detail { max-width: 75ch; }   /* shorter lines are easier to read */

.task-group { margin-bottom: 30px; }
.task-group h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.group-count {
  font-size: 0.9rem; background: var(--green-light); color: var(--heading);
  padding: 3px 12px; border-radius: 999px;
}
.task {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  border: 1px solid var(--border); border-left: 6px solid var(--green-mid);
  border-radius: var(--radius); margin-bottom: 12px; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: background-color 0.2s, box-shadow 0.2s;
}
.task:hover { box-shadow: var(--shadow-lg); }
.task input { margin-top: 3px; }
.task.done { background: var(--green-pale); border-left-color: var(--sun); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.task-detail { display: block; margin-top: 4px; }


/* ---------- Explore + Connect: search, filter, cards ---------- */
.controls {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 16px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  position: relative; z-index: 1; margin-top: -86px;   /* overlaps the hills, like the Home stats */
}
.controls input, .controls select, .form-field input, .form-field select, .form-field textarea {
  font: inherit; padding: 11px 14px; border: 2px solid var(--input-border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.controls input { flex: 1; min-width: 220px; padding-left: 42px;
  /* magnifying glass drawn with CSS gradients would be messy, so we use a tiny inline SVG */
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A5D50' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") 14px center no-repeat;
}

.data-status { font-size: 0.95rem; color: var(--heading); background: var(--green-light); font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; }
.data-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green-mid); }
.data-status:empty { display: none; }
/* The status row always keeps room for the "Try again" button, so the cards
   below don't jump down when the button appears (layout shift) */
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 54px; }
.status-row .btn { padding: 6px 16px; }   /* compact, so it fits beside the message on phones */

.card-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
/* Before the script fills in the cards, hold the space so the footer doesn't jump down (layout shift) */
.card-grid:empty { min-height: 100vh; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: translate 0.2s, box-shadow 0.2s;
}
.card:hover { translate: 0 -4px; box-shadow: var(--shadow-lg); }
.card-media {
  height: 160px; display: flex; align-items: center; justify-content: center; font-size: 3.6rem;
  overflow: hidden; background: linear-gradient(135deg, var(--green-light), #CFE6CF);
}
/* Our category illustrations: shown whole (not cropped), with a soft shadow */
.card-media img.card-art { width: 78%; height: 88%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-media img { transform: scale(1.05); }

/* A different soft color behind each category's icon (decoration only, no text on it) */
.card[data-category="Key offices"] .card-media        { background: linear-gradient(135deg, #FDF3D7, #F7DD9A); }
.card[data-category="Parks"] .card-media              { background: linear-gradient(135deg, #DDF0DA, #A9D7A4); }
.card[data-category="Libraries"] .card-media          { background: linear-gradient(135deg, #E4ECFA, #B9CDF0); }
.card[data-category="Health"] .card-media             { background: linear-gradient(135deg, #FCE4E4, #F3B9B9); }
.card[data-category="Groceries"] .card-media          { background: linear-gradient(135deg, #FFF0DC, #F9CE95); }
.card[data-category="Schools"] .card-media            { background: linear-gradient(135deg, #EDE6F7, #CDBDEB); }
.card[data-category="Events"] .card-media             { background: linear-gradient(135deg, #FDF3D7, #F2C14E); }
.card[data-category="Arts & culture"] .card-media     { background: linear-gradient(135deg, #F8E3F0, #E6B5D5); }
.card[data-category="Sports & recreation"] .card-media { background: linear-gradient(135deg, #DDF0DA, #9FD0B0); }
.card[data-category="Learning"] .card-media           { background: linear-gradient(135deg, #E4ECFA, #A9C3EE); }
.card[data-category="Volunteering"] .card-media       { background: linear-gradient(135deg, #FFE9E0, #F6BFA6); }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 10px 0 6px; font-size: 1.2rem; }
.card-body p { margin: 0 0 10px; }
.card-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.card-links a {
  font-weight: 700; text-decoration: none; padding: 7px 14px; border-radius: 999px;
  border: 2px solid var(--input-border); color: var(--heading);
}
.card-links a:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.tag { align-self: flex-start; background: var(--green-light); color: var(--heading);
  padding: 3px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; }
.muted { color: var(--muted); font-style: italic; }

.after-cards { margin-top: 28px; }


/* ---------- Explore: county map ---------- */
.map-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; margin: 8px 0 22px;
}
.map-text h2 { margin: 0 0 6px; }
.map-text p { margin: 0 0 14px; }
.place-map svg { display: block; width: 100%; height: auto; max-height: 460px; }
.map-county { fill: var(--green-pale); stroke: var(--green-dark); stroke-width: 2.5; stroke-linejoin: round; }
.map-city { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-dasharray: 4 3; }
.map-label { font: 700 16px "Atkinson Hyperlegible", Arial, sans-serif; fill: var(--text); }
.map-dot { stroke: var(--surface); stroke-width: 1.5; cursor: pointer; transition: r 0.15s; }
.map-dot:hover { r: 9; }
/* Legend buttons double as category filters */
.map-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.legend-button {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: 0.92rem;
  padding: 6px 12px; border-radius: 999px; border: 2px solid var(--input-border);
  background: var(--surface); color: var(--heading); cursor: pointer;
}
.legend-button:hover { border-color: var(--heading); }
.legend-button[aria-pressed="true"] { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--input-border); }
/* A card the visitor jumped to from the map gets a yellow outline for 2 seconds */
.card.is-highlighted { outline: 4px solid var(--sun); outline-offset: 3px; }
@media (max-width: 800px) { .map-panel { grid-template-columns: 1fr; } }

/* ---------- Our Story ---------- */
/* Our Story banner: our logo tree as a big faint watermark on the right */
.story-banner {
  overflow: hidden;
  /* same banner as other pages, but with the plain hills (no small trees) */
  background:
    url("images/hills-plain.svg") center bottom / max(100%, 1200px) auto no-repeat,
    radial-gradient(circle at 88% 12%, rgba(242, 193, 78, 0.30), transparent 32%),
    linear-gradient(135deg, var(--green-deep) 0%, var(--green-dark) 55%, #2F6B47 100%);
}
.story-banner::before {
  content: ""; position: absolute; right: 5%; top: -30px; width: 265px; height: 330px;   /* big, with sun, treetop, and trunk all showing */
  background: url("images/tree-watermark.svg") center / contain no-repeat;
}
.story-banner .container { position: relative; }   /* keeps the text above the tree */
.story-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.story-block {
  background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--green-mid);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); font-size: 1.05rem;
}
.story-block:nth-child(2) { border-top-color: var(--sun); }
.story-block:nth-child(3) { border-top-color: var(--green-dark); }
.story-block h2 { margin: 10px 0 8px; font-size: 1.4rem; }


/* ---------- Suggestion form ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* two equal columns */
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 700; }
.form-error { color: #9B1C1C; font-weight: 700; }
.form-success { background: var(--green-light); border-left: 4px solid var(--green-mid); padding: 12px 16px; border-radius: 6px; }


/* ---------- Sources ----------
   One panel per type of source. Inside, each source is an MLA 9 citation in a list,
   with a small "Used for" note saying where the site uses it.
   Each type gets its own accent color (--accent) on the panel's top edge and icon. */
.source-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0 8px; }
.source-nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--input-border); background: var(--surface); color: var(--heading);
  font-weight: 700; text-decoration: none;
}
.source-nav a:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }

.source-section {
  --accent: var(--green-mid);
  margin-top: 28px; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--accent);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.source-section-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 24px; background: var(--green-pale); border-bottom: 1px solid var(--border);
}
.source-section-head h2 { margin: 0; font-size: 1.35rem; }
.source-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--surface); box-shadow: inset 0 -4px 0 var(--accent);
}
.source-count { background: var(--green-light); color: var(--heading); font-weight: 700;
  padding: 3px 12px; border-radius: 999px; font-size: 0.9rem; }

.source-list { list-style: none; margin: 0; padding: 0; }
/* Each citation uses a "hanging indent" like an MLA Works Cited page:
   the first line starts at the edge, the lines under it are pushed in. */
.citation { padding: 14px 24px; transition: background-color 0.2s; }
.citation + .citation { border-top: 1px solid var(--border); }
.citation:hover { background: var(--green-pale); }
.cite { margin: 0; padding-left: 2em; text-indent: -2em; }
.cite a { overflow-wrap: anywhere; }      /* long links wrap instead of running off the screen */
.cite-use { margin: 4px 0 0; padding-left: 2em; color: var(--muted); font-size: 0.92rem; }
.source-note { max-width: 70ch; margin: 28px auto 0; text-align: center; color: var(--muted); }

/* Phones: a little less padding */
@media (max-width: 600px) {
  .question-grid { grid-template-columns: 1fr; }   /* one tile per row on phones */
  .questions { padding: 18px; }
  .questions label { padding: 12px 12px; gap: 8px; font-size: 1rem; min-height: 80px; }   /* same height for every tile */
  .question-emoji { font-size: 1.2rem; }
  #task-list { padding-left: 44px; }
  #task-list::before { left: 14px; }
  .stage-dot { left: -44px; width: 32px; height: 32px; font-size: 0.95rem; }
  .citation, .source-section-head { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Footer (same on every page) ---------- */
.site-footer { background: var(--green-deep); color: var(--white); padding: 40px 0 20px;
  border-top: 6px solid var(--sun); }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--sun); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h2 { color: var(--sun); font-size: 1.05rem; margin: 0 0 8px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.25); margin-top: 24px; padding-top: 14px; font-size: 0.9rem; }


/* ---------- Logo ---------- */
.logo img { height: 50px; width: auto; display: block; }
.footer-logo { height: 48px; width: auto; display: block; margin-bottom: 10px; }


/* ---------- Tablet and phone layouts ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .preview-card { max-width: 420px; rotate: none; }
}
@media (max-width: 600px) {
  .story-banner::before { width: 210px; height: 260px; right: -30px; top: -45px; }
  .site-header .container { flex-direction: column; align-items: flex-start; }   /* without the menu button (no JavaScript) */
  .nav-links a { padding: 8px 12px; }
  .hero { padding: 40px 0 120px; }
  .page-intro { padding: 36px 0 100px; }
  .logo img { height: 42px; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
  .cta-panel { padding: 24px; }
}


/* ---------- Gentle animations (only if the visitor hasn't asked for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Banner text and preview card float in when the page opens */
  .hero-grid > *, .page-intro .container { animation: rise-in 0.7s ease both; }
  .hero-grid > *:nth-child(2) { animation-delay: 0.15s; }
  .preview-badge { animation: bob 3s ease-in-out infinite; }

  /* Cards slide up as they scroll into view. Browsers that don't support this
     simply show the cards normally, so nothing is ever hidden. */
  @supports (animation-timeline: view()) {
    .feature, .fact, .card, .task, .story-block, .source-section, .stat {
      animation: slide-up linear both;   /* slide only, no fading, so text never looks low-contrast */
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { transform: translateY(24px); } to { transform: none; } }
@keyframes bob { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-6px); } }

/* Reduced motion: also stop hover lifts and smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .btn:hover, .feature:hover, .card:hover { translate: none; }
  .card:hover .card-media img { transform: none; }
}


/* ---------- Windows High Contrast / forced colors ----------
   The system replaces our colors, so we make sure shapes still have edges. */
@media (forced-colors: active) {
  .progress-fill { background: Highlight; }
  .card, .feature, .fact, .task, .stats, .controls, .preview-card { border: 1px solid CanvasText; }
  .nav-links a[aria-current="page"] { border: 2px solid CanvasText; }
}


/* No-results message on Explore and Connect: a picture, a sentence, and a Clear search button */
.empty-message { grid-column: 1 / -1; text-align: center; padding: 28px 16px; }
.empty-message img { width: 180px; height: auto; }
.empty-message p { margin: 8px 0 16px; }

/* Back to top: a round button in the bottom corner. It's invisible (and skipped by the
   Tab key) until script.js adds "is-visible" after you scroll down. */
.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 15;
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  background: var(--green-dark); color: var(--white); font-weight: 700; text-decoration: none;
  box-shadow: var(--shadow-lg); border: 2px solid var(--white);
  visibility: hidden; opacity: 0; translate: 0 12px; transition: opacity 0.2s, translate 0.2s, visibility 0.2s;
}
.back-to-top.is-visible { visibility: visible; opacity: 1; translate: 0 0; }
.back-to-top:hover { background: var(--link); color: var(--white); }

/* Suggestion form: picture + intro on top, numbered "what happens next" steps */
.suggest-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.suggest-head img { width: 170px; height: auto; flex-shrink: 0; }
.suggest-head > div { flex: 1; min-width: 260px; }
.suggest-head h2 { margin-top: 0; }
.suggest-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: step; }
.suggest-steps li {
  counter-increment: step; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 0.92rem;
}
.suggest-steps li::before { content: counter(step) "."; color: var(--heading); }
.form-note { color: var(--muted); margin: 14px 0 10px; }
.required { color: #9B1C1C; font-weight: 700; }
/* Clearer fields: taller boxes and a green edge on the one you're typing in */
.form-field input, .form-field select, .form-field textarea { min-height: 48px; }
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--heading); }

@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; translate: none; } }

/* ---------- Dark mode ----------
   Turned on by <html data-theme="dark">. A small script in each page's <head> sets it from the
   visitor's saved choice (the Dark mode button in the header), or else from the device setting.
   Most of the site changes just by swapping the color variables below;
   the few rules after them fix things that need a different look in the dark.
   Every text color here was checked for at least 4.5 : 1 contrast. */
:root[data-theme="dark"] {
  --page: #0F1A13;         /* page background                       */
  --surface: #17261D;      /* cards and panels                      */
  --green-pale: #1B2E22;   /* soft panels                           */
  --green-light: #23402E;  /* chips and tags                        */
  --text: #E4EDE6;         /* body text                             */
  --muted: #AFC2B4;        /* secondary text                        */
  --heading: #A6DAB1;      /* headings and green text               */
  --link: #93D3A2;         /* links                                 */
  --border: #2C4234;       /* card edges                            */
  --input-border: #7FA088; /* form and button edges (3 : 1 or more) */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.5);
  color-scheme: dark;      /* dark scrollbars and form controls */
}
/* Banners: same gradient, but the front hill matches the dark page */
[data-theme="dark"] .hero, [data-theme="dark"] .page-intro {
  background-image:
    url("images/hills-dark.svg"),
    radial-gradient(circle at 88% 12%, rgba(242, 193, 78, 0.30), transparent 32%),
    linear-gradient(135deg, var(--green-deep) 0%, var(--green-dark) 55%, #2F6B47 100%);
}
[data-theme="dark"] .story-banner {
  background-image:
    url("images/hills-plain-dark.svg"),
    radial-gradient(circle at 88% 12%, rgba(242, 193, 78, 0.30), transparent 32%),
    linear-gradient(135deg, var(--green-deep) 0%, var(--green-dark) 55%, #2F6B47 100%);
}
[data-theme="dark"] .section-tint { background-image: radial-gradient(rgba(166, 218, 177, 0.08) 1.5px, transparent 1.5px); }
[data-theme="dark"] a:hover { color: var(--white); }
[data-theme="dark"] .btn-outline { border-color: var(--input-border); }
[data-theme="dark"] .btn:not(.btn-sun):not(.btn-outline):not(.btn-ghost):hover { background: #2F6B47; border-color: #2F6B47; }   /* plain green buttons only */
[data-theme="dark"] .card-media { filter: brightness(0.88); }   /* soften the bright pastel picture panels */
[data-theme="dark"] .form-error, [data-theme="dark"] .required { color: #FF9B9B; }
[data-theme="dark"] .questions input, [data-theme="dark"] .task input { accent-color: var(--heading); }
/* Search icon drawn in a light color */
[data-theme="dark"] .controls input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23AFC2B4' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
/* Map: county edge in light green, dots get a white ring so every color stands out */
[data-theme="dark"] .map-county { stroke: var(--heading); }
[data-theme="dark"] .map-dot { stroke: #FFFFFF; stroke-width: 2; }

/* ---------- Printing (used by the checklist's "Print or save as PDF" button) ----------
   On paper we hide menus, buttons, and decorations, and keep the tasks as a clean list. */
.print-only { display: none; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.progress-row p { margin: 0; }
.btn-small { padding: 7px 16px; font-size: 0.95rem; }

@media print {
  /* Always print in light colors, even if the device is in dark mode */
  :root, :root[data-theme="dark"] { --page: #fff; --surface: #fff; --text: #000; --muted: #333; --heading: #000; --link: #000; --green-light: #fff; --green-pale: #fff; }
  .site-header, .skip-link, .site-footer, .questions, #reset, #print-list,
  .menu-button, .theme-toggle, .progress-bar, .all-done, .back-to-top { display: none !important; }
  [data-theme="dark"] .page-intro { background: none; }
  body { color: #000; background: #fff; }
  * { box-shadow: none !important; animation: none !important; }
  .page-intro { background: none; color: #000; padding: 0 0 8px; }
  .page-intro h1, .page-intro p { color: #000; }
  .print-only { display: block; font-style: italic; margin: 0 0 12px; }
  .progress-wrap { border: 0; padding: 0; margin: 0 0 12px; }
  #task-list { padding-left: 0; }
  #task-list::before, .stage-dot { display: none; }
  .task-group { break-inside: avoid; }
  .task { border: 1px solid #999; border-left-width: 1px; break-inside: avoid; padding: 10px; margin-bottom: 8px; }
  .task.done .task-title { text-decoration: line-through; }
  .deadline { border: 1px solid #000; background: none; color: #000; }
  /* Show where each "Learn more" link goes, since you can't click paper */
  .task-detail a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; word-break: break-all; }
}
