/* ==========================================================================
   Naguru Teenage Centre — public stylesheet
   Brand colours and font come from the admin (Appearance) and are injected as
   CSS variables in the page <head>, so this file never needs rebuilding.
   ========================================================================== */

:root {
  --green: #003B94;
  --cream: #EAF2FA;
  --green-dark: #001B4D;
  --green-light: #1F5FC4;
  --gold: #38B6E8;
  --ink: #101826;
  --muted: #5C6B84;
  --line: rgba(0, 0, 0, .08);
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .12);
  --wrap: 1180px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--green); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mt-lg { margin-top: 2rem; }
.mb-lg { margin-bottom: 2rem; }
.lead { font-size: 1.15rem; color: #333; }

.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 12px 24px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); }
.btn--secondary { background: #fff; color: var(--green); border-color: var(--green); }
.btn--secondary:hover { background: var(--cream); }
.btn--cream { background: var(--cream); color: var(--green); }
.btn--cream:hover { background: #fff; }
.btn--outline { background: transparent; color: #fff; border-color: #fff; }
.btn--outline:hover { background: rgba(255, 255, 255, .15); }
.btn--deep { background: var(--green-dark); color: #fff; }
.btn--deep:hover { background: #0A2C63; }
.btn--block { width: 100%; }

/* --- Top bar + header --------------------------------------------------- */
.topbar { background: var(--topbar-bg, var(--green-dark)); color: #fff; font-size: .82rem; }
.topbar__inner { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between; padding-block: 7px; }
.topbar a { color: #fff; text-decoration: none; opacity: .9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar__links { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, .14); color: #fff;
  transition: background .2s ease, transform .2s ease;
}
.social-icon:hover { background: rgba(255, 255, 255, .28); transform: translateY(-2px); text-decoration: none; opacity: 1; }
.social-icon__svg { width: 15px; height: 15px; }
.topbar .social-icon { width: 25px; height: 25px; }
.topbar .social-icon__svg { width: 12px; height: 12px; }

.site-header { position: sticky; top: 0; z-index: 100; background: var(--header-bg, #fff); box-shadow: var(--shadow); }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 82px; }
.brand img { height: 58px; width: auto; object-fit: contain; }
.site-header__cta { margin-left: auto; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; padding: 11px 16px; font-size: .8rem; font-weight: 700;
  letter-spacing: .045em; text-transform: uppercase; color: var(--ink); text-decoration: none;
  border-radius: 999px; position: relative; transition: color .18s, background-color .18s;
}
.nav__link:hover { color: var(--green); background: var(--cream); }
.nav__link.is-active { color: var(--green); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 3px; height: 2px;
  background: var(--green); border-radius: 2px;
}
.nav__caret {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .55;
}
.nav__toggle-sub { display: none; }

/* --- Dropdown mega menu ----------------------------------------------------
   Every nav item with children uses the same panel: a coloured intro column
   beside numbered link columns. "Programmes" (is_mega) fills it from live
   programme data and the Homepage — Programmes Section copy; every other
   item fills it from its own nav_items children, with the sidebar just
   introducing the item itself - see the is_mega branch in layout.php.

   Anchored with left:0 to .nav__item - the same positioning context the
   plain .nav__sub dropdowns already use - rather than trying to center on
   the viewport. An earlier version centered on the viewport via a JS-measured
   position:fixed; when that script didn't run (e.g. main.js failed to load,
   or fired after the hover state), the panel fell back to a raw
   left:50%/translateX(-50%) computed against the narrow nav item itself,
   which pushed most of the panel off-screen and left only an unstyled
   sliver visible. Plain CSS anchoring has no such failure mode.

   Width is kept modest (not a dramatic full-bleed panel) specifically so a
   left:0 anchor can never push the right edge past the viewport: even the
   rightmost items sit within about 70% of the header's width at any desktop
   size, so 700px leaves comfortable room even at the narrowest breakpoint. */
.nav__mega {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  width: min(700px, calc(100vw - 40px));
  background: #fff; border: 1px solid rgba(0, 0, 0, .06); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; overflow: hidden;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s; z-index: 90;
}
.nav__item.has-children:hover .nav__mega,
.nav__item.has-children:focus-within .nav__mega { opacity: 1; visibility: visible; transform: translateY(0); }

/* The last couple of items sit far enough right that a left-anchored 700px
   panel would run off the edge of the screen - open those toward the left
   (right-anchored to the item) instead. */
.nav__item--align-right .nav__mega { left: auto; right: 0; }

/* A single-column dropdown (everything except Programmes) doesn't need
   the full 700px - a narrower panel both looks less empty and further
   reduces any risk of overflowing the viewport. */
.nav__mega--compact { width: min(420px, calc(100vw - 40px)); }
.nav__mega--compact .nav__mega-inner { grid-template-columns: 150px 1fr; }
.nav__mega--compact .nav__mega-intro { padding: 22px 18px; }

.nav__mega-inner { display: grid; grid-template-columns: 200px 1fr; }
.nav__mega-intro { background: var(--nav-menu-bg, var(--green-dark)); color: #fff; padding: 26px 22px; display: flex; flex-direction: column; }
.nav__mega-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin: 0 0 .6rem; }
.nav__mega-intro h3 { color: #fff; font-size: 1.3rem; margin: 0 0 .6rem; }
.nav__mega-intro p { color: rgba(255, 255, 255, .8); font-size: .86rem; margin: 0; }
.nav__mega-all { margin-top: auto; padding-top: 1.4rem; color: #fff; font-weight: 700; font-size: .82rem; text-decoration: none; }
.nav__mega-all:hover { text-decoration: underline; }

.nav__mega-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); padding: 22px 6px; }
.nav__mega-col { padding: 6px 20px; }
.nav__mega-col + .nav__mega-col { border-left: 1px solid var(--line); }
.nav__mega-col h4 {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--green); margin: 0 0 .7rem; padding-bottom: .5rem; border-bottom: 2px solid var(--green);
}
.nav__mega-col h4 a { color: inherit; text-decoration: none; }
.nav__mega-col ul { list-style: none; margin: 0; padding: 0; }
.nav__mega-col li + li { border-top: 1px solid var(--line); }
.nav__mega-col a {
  display: flex; align-items: baseline; gap: .6rem; padding: .55rem 0;
  text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 600;
}
.nav__mega-num { color: var(--green); font-weight: 700; font-size: .76rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.nav__mega-col a:hover span:last-child { text-decoration: underline; }
.nav__mega-col a:hover .nav__mega-num { color: var(--ink); }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; cursor: pointer;
  padding: 10px; flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* --- Hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero--plain { background: var(--green); color: #fff; padding: 64px 0; }
.hero--image { min-height: 42vh; display: flex; align-items: flex-end; background-size: cover; background-position: center; padding: 0 0 42px; }
.hero--image .hero__inner { position: relative; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.25) 60%, rgba(0,0,0,.12)); }
.hero h1 { color: #fff; }
.hero__lead { max-width: 42rem; color: rgba(255, 255, 255, .9); margin: 0; }

/* Soft drifting light blobs behind every hero, for depth on both photo and plain-colour heroes. */
.hero::before {
  content: ""; position: absolute; inset: -10%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .16) 0, transparent 42%),
    radial-gradient(circle at 6% 90%, rgba(255, 255, 255, .12) 0, transparent 38%);
  animation: hero-drift 16s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}

.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); margin: 0 0 .4rem; }
.eyebrow--light { color: var(--cream); }
.eyebrow--gold { color: var(--gold); }

.crumbs { color: rgba(255,255,255,.85); font-size: .875rem; margin-bottom: .6rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.crumbs a { color: rgba(255,255,255,.85); }

/* --- Sections ----------------------------------------------------------- */
.section { padding: 72px 0; position: relative; overflow: hidden; }
.section--cream { background: var(--cream); }
.section--green { background: var(--green); color: #fff; }
.section--green h2, .section--green .section-title { color: #fff; }

.section-head { max-width: 46rem; margin: 0 auto 2.5rem; text-align: center; }
.section-head--left { margin-inline: 0; text-align: left; }
.section-head--light .section-title { color: #fff; }
.section-title { color: var(--green); }
.section-lead { color: var(--muted); }

.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
/* Keeps text-then-image DOM order for accessibility while flipping the visual column order. */
@media (min-width: 900px) {
  .split--reverse > :first-child { order: 2; }
  .split--reverse > :last-child { order: 1; }
}

.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* --- Cards -------------------------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.card--link { text-decoration: none; color: inherit; }
.card--link:hover, .card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }
.card--center { text-align: center; align-items: center; }
.card--pad { padding: 28px; }
.card__media { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card--center .card__media { max-width: 220px; margin: 24px auto 0; }
.card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card__body > .pill { align-self: flex-start; margin-bottom: .7rem; }
.card__body h2, .card__body h3 { color: var(--green); }
.card__body p { color: #444; font-size: .95rem; }

.link-more { margin-top: auto; padding-top: .6rem; font-weight: 700; font-size: .9rem; text-decoration: none; }
.link-more:hover { text-decoration: underline; }

/* --- Card style variants (Admin > Appearance > Card Style) ---------------
   "Classic" is the default look above and needs no override. These are pure
   surface treatments layered on the same markup, so one setting restyles
   every card sitewide — thematic areas, success stories, and any other
   section still using the plain grid-of-cards layout. */
.card-style-minimal .card { border: 0; box-shadow: none; background: transparent; }
.card-style-minimal .card:hover, .card-style-minimal .card--link:hover { box-shadow: none; }
.card-style-bordered .card { box-shadow: none; border: 2px solid var(--green); }
.card-style-bordered .card--link:hover, .card-style-bordered .card:hover { box-shadow: var(--shadow); }
.card-style-soft .card { border-radius: 22px; box-shadow: var(--shadow-lg); border-color: transparent; }
.card-style-soft .card__media { border-radius: 22px 22px 0 0; }

/* --- Feature grid: one large featured item beside a compact list --------
   Used on the homepage's Programmes and News sections so they read as a
   different layout from the plain card grids (Thematic Areas, Stories)
   rather than every section repeating the same "grid of cards" rhythm. */
.feature-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) {
  .feature-grid { grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: stretch; }
  /* Admin-chosen: which side the featured programme card sits on (Page Content > Home — Programmes). */
  .feature-grid--reverse { grid-template-columns: 1fr 1.3fr; }
  .feature-grid--reverse .feature-grid__main { order: 2; }
  .feature-grid--reverse .feature-grid__list { order: 1; }
}
.feature-grid__main {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.feature-grid__media { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.feature-grid__media--extra { border-top: 1px solid var(--line); }
.feature-grid__body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.feature-grid__body h3 { font-size: 1.5rem; color: var(--green); }
.feature-grid__body p { color: #444; }
.feature-grid__list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feature-grid__list li + li { border-top: 1px solid var(--line); }
.feature-grid__item { display: flex; align-items: center; gap: 1rem; padding: 16px 18px; text-decoration: none; color: inherit; transition: background-color .16s; }
.feature-grid__item:hover { background: var(--cream); }
.feature-grid__item img { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.feature-grid__item-icon {
  width: 68px; height: 68px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; background: var(--cream); color: var(--green); font-weight: 700; font-size: 1.3rem;
}
.feature-grid__item strong { display: block; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.feature-grid__item small { display: block; color: var(--muted); font-size: .78rem; margin-top: .3rem; }
.feature-grid__item:hover strong { color: var(--green); }

.pill {
  display: inline-block; background: rgba(0, 59, 148, .1); color: var(--green);
  border-radius: 999px; padding: 3px 12px; font-size: .75rem; font-weight: 700;
}
.pill--open { background: #e3f5e8; color: #17632f; }
.pill--closed { background: #eee; color: #666; }

/* --- Image frames ------------------------------------------------------- */
.frame { display: block; width: 100%; object-fit: cover; }
.frame--rectangle { border-radius: 0; }
.frame--rounded { border-radius: var(--radius); }
.frame--squircle { border-radius: 28% / 22%; }
.frame--circle { border-radius: 50%; aspect-ratio: 1; }
.frame--leaf { border-radius: 46% 8% 46% 8%; }
.frame--arch { border-radius: 50% 50% 12px 12px / 34% 34% 12px 12px; }
.frame--blob { border-radius: 58% 42% 38% 62% / 42% 38% 62% 58%; }
.frame--hexagon { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.image-accent { position: relative; }
.image-accent::before {
  content: ""; position: absolute; inset: -14px -14px auto auto; width: 96px; height: 96px;
  border: 2px dashed rgba(0, 59, 148, .25); border-radius: 50%; z-index: -1;
  animation: accent-spin 20s linear infinite;
}
@keyframes accent-spin { to { transform: rotate(360deg); } }

/* --- Small line-style icons (used when a block/thematic area has no photo) */
.icon-svg { width: 22px; height: 22px; }
.block__icon svg, .feature-grid__item-icon svg { width: 60%; height: 60%; }

/* --- SDG badges ----------------------------------------------------------
   A comma-separated list of goal numbers (Admin > Programmes/Thematic Areas)
   renders as a row of pill badges in each goal's official colour. */
.sdg-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.1rem 0; }
.sdg-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--sdg-color, var(--green)); color: #fff;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.sdg-badge__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .28);
}
.sdg-badge__num .icon-svg { width: 14px; height: 14px; }
.sdg-badge:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0, 0, 0, .18); }
.sdg-badges--compact .sdg-badge__name { display: none; }
.sdg-badges--compact .sdg-badge { padding: 0; background: none; box-shadow: none; }
.sdg-badges--compact .sdg-badge__num { width: 30px; height: 30px; background: var(--sdg-color, var(--green)); color: #fff; }
.sdg-badges--compact .sdg-badge__num .icon-svg { width: 17px; height: 17px; }

/* --- Decorative background patterns -------------------------------------
   Each theme below reads as a distinct motif at a glance, not just the same
   dots recoloured: overlapping rings for community, a medical cross for
   health, an ascending staircase for life-skills, sound-wave ripples for
   advocacy, a diagonal shield-weave for gender-protection, and so on. All of
   them stay low-opacity so they read as texture behind text, never compete
   with it. Default (plain ".pattern" with no theme) falls back to soft dots.
   ---------------------------------------------------------------------- */
.pattern::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(circle at 8% 18%, var(--green) 0 9px, transparent 10px),
    radial-gradient(circle at 92% 26%, var(--green) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 82%, var(--green) 0 7px, transparent 8px),
    radial-gradient(circle at 84% 74%, var(--green) 0 10px, transparent 11px);
}
.section--green.pattern::before, .cta-band.pattern::before { opacity: .12; }

/* Youth — playful scatter of varied-size dots. */
.pattern--youth::before {
  background-image:
    radial-gradient(circle at 6% 14%, var(--green) 0 6px, transparent 7px),
    radial-gradient(circle at 14% 26%, var(--green) 0 4px, transparent 5px),
    radial-gradient(circle at 92% 18%, var(--green) 0 8px, transparent 9px),
    radial-gradient(circle at 86% 32%, var(--green) 0 4px, transparent 5px),
    radial-gradient(circle at 10% 82%, var(--green) 0 5px, transparent 6px),
    radial-gradient(circle at 90% 78%, var(--green) 0 7px, transparent 8px),
    radial-gradient(circle at 52% 92%, var(--green) 0 4px, transparent 5px);
}

/* Community — overlapping rings, suggesting people coming together. */
.pattern--community::before {
  background-image:
    radial-gradient(circle at 10% 20%, transparent 0 17px, var(--green) 17px 19px, transparent 19px),
    radial-gradient(circle at 17% 27%, transparent 0 13px, var(--green) 13px 15px, transparent 15px),
    radial-gradient(circle at 88% 78%, transparent 0 17px, var(--green) 17px 19px, transparent 19px),
    radial-gradient(circle at 81% 71%, transparent 0 13px, var(--green) 13px 15px, transparent 15px);
}

/* Health — a pair of medical crosses. */
.pattern--health::before {
  background-image:
    linear-gradient(var(--green) 0 0), linear-gradient(var(--green) 0 0),
    linear-gradient(var(--green) 0 0), linear-gradient(var(--green) 0 0);
  background-size: 3px 18px, 18px 3px, 3px 14px, 14px 3px;
  background-position: 10% 22%, 10% 22%, 90% 72%, 90% 72%;
}

/* Life-skills — an ascending staircase, like steady growth. */
.pattern--life-skills::before {
  background-image:
    linear-gradient(var(--green) 0 0), linear-gradient(var(--green) 0 0),
    linear-gradient(var(--green) 0 0), linear-gradient(var(--green) 0 0),
    radial-gradient(circle at 88% 20%, var(--green) 0 5px, transparent 6px);
  background-size: 6px 10px, 6px 16px, 6px 22px, 6px 28px, auto;
  background-position: 8% 88%, 13% 82%, 18% 74%, 23% 64%, 88% 20%;
}

/* Peer education — two dot-pairs joined by a short line, like mentor pairs. */
.pattern--peer::before {
  background-image:
    radial-gradient(circle at 8% 22%, var(--green) 0 5px, transparent 6px),
    linear-gradient(var(--green) 0 0),
    radial-gradient(circle at 19% 22%, var(--green) 0 5px, transparent 6px),
    radial-gradient(circle at 80% 76%, var(--green) 0 5px, transparent 6px),
    linear-gradient(var(--green) 0 0),
    radial-gradient(circle at 91% 76%, var(--green) 0 5px, transparent 6px);
  background-size: auto, 9% 2px, auto, auto, 9% 2px, auto;
  background-position: 8% 22%, 13.5% 22%, 19% 22%, 80% 76%, 85.5% 76%, 91% 76%;
}

/* Research — a faint dotted grid, like graph paper. */
.pattern--research::before {
  background-image: repeating-radial-gradient(circle at 0 0, var(--green) 0 1.5px, transparent 1.5px 34px);
  background-size: 34px 34px;
  background-repeat: repeat;
}

/* Systems — a faint diagonal hatch with a few connection nodes. */
.pattern--systems::before {
  background-image:
    repeating-linear-gradient(45deg, var(--green) 0 1px, transparent 1px 46px),
    radial-gradient(circle at 20% 30%, var(--green) 0 4px, transparent 5px),
    radial-gradient(circle at 72% 58%, var(--green) 0 4px, transparent 5px),
    radial-gradient(circle at 42% 82%, var(--green) 0 4px, transparent 5px);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}

/* Advocacy — concentric ripples, like sound or an announcement. */
.pattern--advocacy::before {
  background-image:
    radial-gradient(circle at 12% 22%, transparent 0 6px, var(--green) 6px 8px, transparent 8px 14px, var(--green) 14px 16px, transparent 16px),
    radial-gradient(circle at 85% 75%, transparent 0 6px, var(--green) 6px 8px, transparent 8px 14px, var(--green) 14px 16px, transparent 16px);
}

/* Economic empowerment — ascending growth ticks. */
.pattern--economic::before {
  background-image:
    linear-gradient(70deg, var(--green) 0 3px, transparent 3px),
    linear-gradient(70deg, var(--green) 0 3px, transparent 3px),
    linear-gradient(70deg, var(--green) 0 3px, transparent 3px),
    radial-gradient(circle at 85% 22%, var(--green) 0 6px, transparent 7px);
  background-size: 3px 14px, 3px 20px, 3px 26px, auto;
  background-position: 65% 80%, 72% 70%, 79% 58%, 85% 22%;
}

/* Gender & protection — a diagonal shield-weave lattice. */
.pattern--gender-protection::before {
  background-image:
    repeating-linear-gradient(45deg, var(--green) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(-45deg, var(--green) 0 1px, transparent 1px 28px);
  background-repeat: repeat, repeat;
}

/* --- Slider ------------------------------------------------------------- */
.slider { position: relative; overflow: hidden; background: var(--green-dark); }
.slider__track { position: relative; height: clamp(420px, 68vh, 680px); }
.slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  display: flex; align-items: center; opacity: 0; transition: opacity .7s ease;
  pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.3) 60%, rgba(0,0,0,.2)); }
.slide__body { position: relative; color: #fff; max-width: 44rem; }
.slide__body h1 { color: #fff; }
.slide__body p { color: rgba(255,255,255,.92); font-size: 1.05rem; }
.slide__body .slide__eyebrow {
  display: flex; align-items: center; gap: .6rem; font-size: .8rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 0 0 1rem;
}
.slide__eyebrow::before { content: ""; display: inline-block; width: 26px; height: 2px; background: #fff; flex-shrink: 0; }
.slide__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(255,255,255,.2); color: #fff; border: 0; border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(4px);
}
.slider__arrow:hover { background: rgba(255,255,255,.35); }
.slider__arrow--prev { left: 14px; }
.slider__arrow--next { right: 14px; }
.slider__dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; z-index: 3; }
.slider__dots button { width: 10px; height: 10px; border: 0; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.slider__dots button.is-active { width: 30px; background: #fff; }

/* --- Impact section (homepage only) ---------------------------------------
   Two-column layout: an admin-uploaded photo on the left, a featured "hero"
   stat plus a 2x2 grid of supporting stats on the right. Colours here are
   deliberately literal (not the sitewide --green/--cream admin variables) —
   this section uses NTC's specified impact-section palette on purpose, scoped
   only to these classes so nothing else on the site is affected.
   ---------------------------------------------------------------------- */
.impact-v2 { padding: 72px 0; background: #fff; }
.impact-v2__layout { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .impact-v2__layout { grid-template-columns: 45fr 55fr; gap: 3.5rem; } }

.impact-v2__media { width: 100%; }
.impact-v2__img {
  width: 100%; height: 100%; min-height: 280px; aspect-ratio: 4 / 5;
  object-fit: cover; border-radius: 24px; display: block; background: #ECE7CA;
}
@media (min-width: 900px) { .impact-v2__img { aspect-ratio: 3 / 4; } }
.impact-v2__img--placeholder { display: block; }

.impact-v2__eyebrow { color: #006400; }
.impact-v2__heading {
  font-family: var(--font), "Inter", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; color: var(--ink);
  margin: 0 0 .9rem; overflow-wrap: break-word;
}
.impact-v2__lead { font-size: 1.02rem; line-height: 1.6; color: var(--muted); max-width: 46ch; margin: 0 0 1.8rem; }

.impact-v2__hero-stat {
  display: flex; align-items: center; gap: 1.1rem;
  background: #006400; color: #fff; border-radius: 20px;
  padding: 1.5rem 1.7rem; margin-bottom: 1.2rem;
  box-shadow: 0 10px 28px rgba(0, 100, 0, .18);
  transition: transform .25s ease, box-shadow .25s ease;
}
.impact-v2__hero-stat:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 100, 0, .24); }
.impact-v2__hero-icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center;
}
.impact-v2__hero-icon .icon-svg { width: 26px; height: 26px; }
.impact-v2__hero-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.impact-v2__hero-value {
  font-family: var(--font), "Inter", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.4rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.impact-v2__hero-label { font-size: .95rem; opacity: .92; }

.impact-v2__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.8rem; align-items: stretch; }
.impact-v2__stat {
  display: flex; flex-direction: column; gap: .55rem;
  background: #ECE7CA; border-radius: 16px; padding: 1.15rem 1.1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.impact-v2__stat:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0, 0, 0, .1); }
.impact-v2__stat-icon {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 100, 0, .12);
  display: flex; align-items: center; justify-content: center; color: #006400;
}
.impact-v2__stat-icon .icon-svg { width: 18px; height: 18px; }
.impact-v2__stat-value {
  font-family: var(--font), "Inter", system-ui, sans-serif; font-weight: 700;
  font-size: 1.45rem; line-height: 1; color: #006400; font-variant-numeric: tabular-nums;
}
.impact-v2__stat-label { font-size: .85rem; line-height: 1.3; color: var(--ink); }

.impact-v2__cta { margin: 0 0 .7rem; }
.impact-v2__btn {
  display: inline-flex; align-items: center; gap: .55rem;
  background: #006400; color: #fff; font-weight: 700; font-size: 1rem;
  text-decoration: none; padding: 15px 30px; border-radius: 999px;
  min-height: 48px; box-sizing: border-box;
  transition: background .2s ease, transform .2s ease;
}
.impact-v2__btn:hover { background: #004d00; transform: translateY(-2px); }
.impact-v2__btn:focus-visible { outline: 3px solid #006400; outline-offset: 3px; }
.impact-v2__note { font-size: .82rem; color: var(--muted); margin: 0; }

@media (max-width: 599px) {
  .impact-v2__grid { grid-template-columns: 1fr; }
}

.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; }
.stat-card--dark { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.stat-card__value { display: block; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; color: var(--green); font-variant-numeric: tabular-nums; }
.stat-card--dark .stat-card__value { color: #fff; }
.stat-card__label { display: block; font-size: .9rem; color: var(--muted); }
.stat-card--dark .stat-card__label { color: rgba(255,255,255,.75); }

/* --- Content blocks ----------------------------------------------------- */
.blocks { display: grid; gap: 1.5rem; }
.blocks--grid.cols-1 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .blocks--grid.cols-2, .blocks--grid.cols-3, .blocks--grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .blocks--grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .blocks--grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.blocks--rows { gap: 3.5rem; }

.block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.blocks--rows .block {
  display: grid; gap: 2rem; align-items: center; background: none; border: 0; box-shadow: none; overflow: visible;
}
@media (min-width: 900px) { .blocks--rows .block { grid-template-columns: 1fr 1fr; gap: 3rem; } }
@media (min-width: 900px) { .blocks--rows .block--flip .block__media { order: 2; } }
.block__body { padding: 24px; }
.blocks--rows .block__body { padding: 0; }
.block__body h3 { color: var(--green); }
.blocks--rows .block__body h3 { font-size: 1.6rem; }
.block__subtitle { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.block__text { color: #444; font-size: .95rem; }
.block__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 50%; background: rgba(0,59,148,.1); color: var(--green);
  font-weight: 700; text-transform: uppercase; margin-bottom: .8rem;
}
.block__media img, .block__media iframe { width: 100%; }
.block__cta { margin: .9rem 0 0; }

/* --- Map ---------------------------------------------------------------- */
.map-wrap { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .map-wrap { grid-template-columns: 1.2fr 1fr; } }
.map { position: relative; width: 100%; max-width: 440px; margin: 0 auto; background: var(--cream); border-radius: var(--radius); padding: 20px; }
/* Shown until a real map photo is uploaded (Admin > Where We Work > Map Image). */
.map__placeholder { aspect-ratio: 380 / 420; background: rgba(0, 59, 148, .06); border-radius: 8px; }
.map__photo { position: relative; }
.map__image { width: 100%; height: auto; display: block; border-radius: 8px; object-fit: cover; }
/* Positions the per-page tint (see overlay_css() in app/helpers.php) over the photo only,
   not the cream padding around it. */
.map__scrim { position: absolute; inset: 0; pointer-events: none; border-radius: 8px; }
.map__pin { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 6px; cursor: pointer; }
.map__pin span { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--cream); transition: transform .2s; }
.map__pin:hover span, .map__pin:focus span { transform: scale(1.35); }
.map__tip { position: absolute; left: 20px; right: 20px; bottom: 20px; background: #fff; border-radius: 10px; padding: 14px; box-shadow: var(--shadow-lg); font-size: .9rem; }
.map__tip strong { display: block; color: var(--green); }

.district-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.district-list__btn {
  width: 100%; text-align: left; background: #fff; border: 1px solid rgba(0,59,148,.18);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.district-list__btn:hover { border-color: var(--green); background: var(--cream); }

/* --- Misc components ---------------------------------------------------- */
.logo-strip { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; align-items: center; }
.logo-strip__item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 24px;
  min-width: 150px; min-height: 92px; display: flex; align-items: center; justify-content: center;
}
.logo-strip__item img { max-height: 56px; width: auto; object-fit: contain; }

/* --- Partners marquee ----------------------------------------------------
   The logo strip's content is rendered twice back to back in the template;
   the animation slides exactly one copy's width (-50%) so the loop is
   seamless, then jumps back with no visible seam. Pauses on hover and for
   visitors who've asked for reduced motion. */
.marquee { overflow: hidden; position: relative; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 1; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--cream), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--cream), transparent); }
.marquee__track.logo-strip {
  flex-wrap: nowrap; justify-content: flex-start; width: max-content;
  animation: marquee-left 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--right .marquee__track { animation-name: marquee-right; }
.marquee--slow .marquee__track { animation-duration: 52s; }
.marquee--fast .marquee__track { animation-duration: 20s; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

.gallery-item { margin: 0; }
.gallery-img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-item figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: .5rem; }

.notice-list, .closed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.notice { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 760px) { .notice { grid-template-columns: 1fr auto; } }
.notice__meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.notice__deadline { margin: 0; }
.closed-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }

.faq-list { display: grid; gap: .7rem; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 700; color: var(--green);
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq[open] summary span { transform: rotate(45deg); }
.faq summary span { transition: transform .2s; font-weight: 400; font-size: 1.4rem; line-height: 1; }
.faq__answer { padding: 0 20px 18px; color: #444; border-top: 1px solid var(--line); padding-top: 14px; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-list li { display: grid; gap: .15rem; }
.contact-list strong { color: var(--green); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

.map-embed iframe, .video-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); display: block; }

.cta-band { background: var(--green); color: #fff; }
.cta-band__inner { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 760px) { .cta-band__inner { grid-template-columns: 1fr auto; } }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; }

.programme-group + .programme-group { margin-top: 4rem; }

.prose h2 { color: var(--green); margin-top: 1.6em; }
.prose h3 { color: var(--green); margin-top: 1.4em; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }

/* --- News/event post: optional sidebar layout ---------------------------
   Main story on the left, a narrower sidebar (extra photos, an advert, or a
   video/social embed) on the right. Stacks to a single column on mobile. */
.post-layout { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 860px) { .post-layout { grid-template-columns: 2fr 1fr; } }
.post-sidebar { display: grid; gap: 1.25rem; }
.post-sidebar__card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.post-sidebar__title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 .9rem; }
.post-sidebar__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.post-sidebar__gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.post-sidebar__advert img { width: 100%; border-radius: 8px; display: block; }
.post-sidebar__advert figcaption { font-size: .82rem; color: var(--muted); margin-top: .6rem; text-align: center; }
.post-sidebar .video-embed, .post-sidebar .twitter-tweet { max-width: 100%; }

/* --- Forms -------------------------------------------------------------- */
.stack { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; margin: 0; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field textarea, .field select {
  font: inherit; padding: 11px 14px; border: 1px solid #ccc; border-radius: 9px;
  background: #fff; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(0,59,148,.15); }
.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.form-card { padding: 28px; }
.hp { position: absolute; left: -9999px; }

.newsletter { display: flex; gap: .6rem; flex-wrap: wrap; }
.newsletter input { flex: 1; min-width: 220px; padding: 12px 16px; border-radius: 999px; border: 0; font: inherit; }

.alert { border-radius: 10px; padding: 13px 16px; margin: 1.2rem 0; font-size: .95rem; }
.alert--success { background: #e8f6ec; border: 1px solid #a8d8b9; color: #17632f; }
.alert--error { background: #fdecec; border: 1px solid #f5b5b5; color: #a11; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--footer-bg, var(--green-dark)); color: rgba(255,255,255,.75); margin-top: 0; }
.site-footer__cta { background: var(--green); }
.site-footer__cta-inner { display: grid; gap: 1.5rem; align-items: center; padding: 34px 0; }
@media (min-width: 860px) { .site-footer__cta-inner { grid-template-columns: 1fr auto; } }
.site-footer__cta h2 { color: #fff; margin: 0 0 .25rem; font-size: 1.4rem; }
.site-footer__cta p { color: rgba(255,255,255,.85); margin: 0; font-size: .92rem; }

.site-footer__grid { display: grid; gap: 2.5rem; padding: 56px 20px; }
@media (min-width: 860px) { .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h3 { color: var(--cream); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.site-footer a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .92rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__about { font-size: .92rem; }
/* The logo is used exactly as supplied; its wordmark is dark, so it sits on a
   light panel here instead of being recoloured. */
.footer-brand { display: inline-block; background: #fff; padding: 12px; border-radius: 12px; }
.footer-brand img { height: 66px; width: auto; object-fit: contain; }
.site-footer__socials { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.2rem; }
.site-footer__contact li { font-size: .92rem; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); }
.site-footer__bottom-inner { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; padding: 20px; font-size: .82rem; }
.site-footer__bottom p { margin: 0; }

/* --- Chatbot ------------------------------------------------------------
   The panel's open/close is class-driven (.is-open), not just the [hidden]
   attribute, so opacity/transform can transition. JS removes [hidden] before
   adding .is-open (so the "from" state renders first) and re-adds [hidden]
   only after the close transition ends (so it stays out of the tab order
   and off-screen readers while shut, not just invisible). */
.chat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 120; width: 56px; height: 56px;
  border-radius: 50%; border: 0; background: var(--green); color: #fff; font-size: 1.5rem;
  cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .15s ease;
  display: flex; align-items: center; justify-content: center;
}
.chat-launch:hover { transform: scale(1.06); }
/* The logo's wordmark is dark, so it sits on a small white disc for
   contrast regardless of the launch button's own colour. */
.chat-launch__logo {
  width: 38px; height: 38px; object-fit: contain; display: block;
  background: #fff; border-radius: 50%; padding: 5px;
}
.chat-panel {
  position: fixed; right: 20px; bottom: 88px; z-index: 120; width: min(360px, calc(100vw - 40px));
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: min(70vh, 520px);
  opacity: 0; transform: translateY(18px) scale(.95); transform-origin: bottom right;
  transition: opacity .2s ease, transform .24s cubic-bezier(.24, .9, .32, 1.3), max-height .22s ease, width .22s ease;
}
.chat-panel.is-open { opacity: 1; transform: translateY(0) scale(1); }
/* The class's own "display: flex" above otherwise always beats the browser's
   built-in "[hidden] { display: none }" rule (author styles win over
   user-agent styles regardless of specificity), so the panel toggle button
   opening/closing the panel silently had no visual effect. */
.chat-panel[hidden] { display: none; }
.chat-panel--maximized { width: min(720px, calc(100vw - 40px)); max-height: min(88vh, 760px); }

.chat--left.chat-launch { right: auto; left: 20px; }
.chat--left.chat-panel { right: auto; left: 20px; transform-origin: bottom left; }

.chat-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--green); color: #fff; }
.chat-panel__head-actions { display: flex; align-items: center; gap: .2rem; }
.chat-panel__head button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 4px; border-radius: 6px; }
.chat-panel__head button:hover { background: rgba(255, 255, 255, .15); }
.chat-panel__head-actions button span { display: block; font-size: 1rem; }
.chat-panel__log { padding: 14px 16px; overflow-y: auto; flex: 1; display: grid; gap: .6rem; align-content: start; }
.chat-msg { margin: 0; padding: 10px 13px; border-radius: 12px; font-size: .9rem; max-width: 85%; }
.chat-msg--bot { background: var(--cream); }
.chat-msg--user { background: var(--green); color: #fff; justify-self: end; }
.chat-panel__form { display: flex; gap: .5rem; padding: 12px; border-top: 1px solid var(--line); }
.chat-panel__form input { flex: 1; font: inherit; padding: 9px 12px; border: 1px solid #ccc; border-radius: 999px; }
.chat-panel__form button { background: var(--green); color: #fff; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 700; cursor: pointer; }

/* --- Scroll reveal ------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Grids of cards fade in with a slight stagger instead of all at once. */
.grid .reveal:nth-child(2), .blocks--grid .reveal:nth-child(2) { transition-delay: .08s; }
.grid .reveal:nth-child(3), .blocks--grid .reveal:nth-child(3) { transition-delay: .16s; }
.grid .reveal:nth-child(4), .blocks--grid .reveal:nth-child(4) { transition-delay: .24s; }
.grid .reveal:nth-child(n+5), .blocks--grid .reveal:nth-child(n+5) { transition-delay: .3s; }

/* --- Mobile navigation -------------------------------------------------- */
@media (max-width: 1120px) {
  .nav-toggle { display: flex; }
  .site-header__cta { display: none; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; background: #fff; margin: 0;
    box-shadow: var(--shadow-lg); max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.is-open { max-height: 80vh; overflow-y: auto; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px; }
  .nav__item { position: relative; }
  .nav__link { padding: 13px 14px; border-radius: 10px; }
  .nav__toggle-sub {
    display: block; position: absolute; right: 6px; top: 6px; background: none; border: 0;
    font-size: 1.1rem; padding: 8px 12px; cursor: pointer;
  }
  .nav__caret { display: none; } /* the toggle button above already indicates "has children" on mobile */
  .nav__sub {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    display: none; padding-left: 14px; background: var(--cream); border-radius: 8px; margin-bottom: 6px;
  }
  .nav__item.is-open .nav__sub { display: block; }

  /* The two-column mega panel collapses to a single stacked accordion,
     using the same is-open toggle as the plain dropdowns. */
  .nav__mega {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; width: auto; display: none; border-radius: 8px; margin: 0 0 6px; overflow: visible;
  }
  .nav__item.is-open .nav__mega { display: block; }
  .nav__mega-inner { display: block; }
  .nav__mega-intro { border-radius: 8px 8px 0 0; padding: 20px; }
  .nav__mega-columns { display: block; padding: 4px 0; }
  .nav__mega-col { padding: 14px 6px; }
  .nav__mega-col + .nav__mega-col { border-left: 0; border-top: 1px solid var(--line); }
}

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
