/*
Theme Name: Mathare Nexus Hub
Theme URI: https://analition.test
Author: Nexus Bridge / UAYO
Description: Mathare Triple Nexus Hub — learn the Triple Nexus, see how coordination works ward by ward in Mathare, and join the data. Friendly, plain-language, mobile-first.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: analition
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --ink: #1c1f23;
  --muted: #5b6470;
  --line: #e3e7e5;
  --surface: #ffffff;
  --surface-alt: #f4f7f5;
  /* Kenyan flag palette — the site's brand/theme colours (header, nav,
     buttons, logo). Kept separate from the pillar colours below, which are
     a distinct, brief-mandated data system and stay as specified there. */
  --ke-black: #000000;
  --ke-red: #bb0000;
  --ke-green: #006600;
  --ke-white: #ffffff;
  --accent: var(--ke-red);
  --accent-soft: #eef1f0;
  --accent-green: var(--ke-green);
  --accent-green-soft: #e3f1e7;

  /* The three pillar colours — used wherever a pillar is shown, always paired
     with a text label and an icon, never colour alone. */
  --pillar-humanitarian: #2A78D6;
  --pillar-development: #EB6834;
  --pillar-peacebuilding: #1BAF7A;

  --shadow: 0 10px 30px rgba(20, 30, 25, 0.07);
  --radius: 14px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; }
.container { width: 100%; margin: 0; padding: 0 clamp(20px, 5vw, 80px); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 700;
  font-size: 15px; letter-spacing: .01em; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(28,31,35,.25); }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-green { background: var(--accent-green); color: #fff; }
.btn-green:hover { box-shadow: 0 8px 20px rgba(28,31,35,.25); }
.btn-outline-green { background: transparent; border-color: var(--accent-green); color: var(--accent-green); }
.btn-outline-green:hover { background: var(--accent-green); color: #fff; }
.btn-large { padding: 16px 30px; font-size: 16px; }

.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.section { padding: 48px 0; }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 640px; margin: 0 0 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 16px; }

/* Honest-gap / data-status notices (brief: say so plainly, label self-reported, date everything) */
.notice-banner { background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; font-size: 14px; color: var(--ink); margin-bottom: 28px; }
.notice-banner strong { font-weight: 700; }
.notice-banner.placeholder { background: #fff7e8; border-color: #f0dfb8; }
.as-of { color: var(--muted); font-size: 13px; }

/* pillar chips — colour always paired with label + icon */
.pillar-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; color: #fff; }
.pillar-chip svg { width: 13px; height: 13px; }
.pillar-chip.humanitarian { background: var(--pillar-humanitarian); }
.pillar-chip.development { background: var(--pillar-development); }
.pillar-chip.peacebuilding { background: var(--pillar-peacebuilding); }
.pillar-chip.outline { background: transparent; border: 1.5px solid currentColor; }
.pillar-chip.outline.humanitarian { color: var(--pillar-humanitarian); }
.pillar-chip.outline.development { color: var(--pillar-development); }
.pillar-chip.outline.peacebuilding { color: var(--pillar-peacebuilding); }
/* One chip per activity (colour-coded by its pillar) instead of a single
   comma-joined string — several activity labels contain their own internal
   commas (e.g. "Emergency response (fire, flood)"), which read as a run-on
   list when just joined with ", ". */
.activity-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.activity-chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; }
.served-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.served-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface-alt); color: var(--ink); border: 1px solid var(--line); }
.served-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.activity-chip-sm { font-size: 11px; font-weight: 600; padding: 3px 9px; }
.activity-chip-more { border: 1.5px dashed var(--line); color: var(--muted); }
.funding-flow { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; margin: 28px 0 8px; }
.funding-flow-node { flex: 1 1 200px; background: var(--surface-alt); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.funding-flow-node.funding-flow-source { background: var(--accent-green-soft); border-color: var(--accent-green); }
.funding-flow-node.funding-flow-end { background: #fff; }
.funding-flow-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-green); }
.funding-flow-node strong { font-size: 16px; line-height: 1.3; }
.funding-flow-arrow { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent-green); min-width: 90px; }
.funding-flow-arrow-glyph::before { content: '\2192'; font-size: 26px; line-height: 1; font-weight: 700; }
.funding-flow-arrow span { font-size: 11.5px; color: var(--muted); text-align: center; max-width: 120px; }
.funding-flow-caption { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
@media (max-width: 700px) {
	.funding-flow { flex-direction: column; }
	.funding-flow-arrow { min-width: 0; }
	.funding-flow-arrow-glyph::before { content: '\2193'; }
}
.wp-block-table table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.wp-block-table th, .wp-block-table td { text-align: left; padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; }
.wp-block-table th { background: var(--surface-alt); font-weight: 700; }
.wp-block-table tr:nth-child(even) { background: var(--surface-alt); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); font-size: 12px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); }

/* ==========================================================================
   Top bar + header
   ========================================================================== */
.breadcrumbs { background: var(--surface-alt); border-bottom: 1px solid var(--line); padding: 12px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 13px; }
.breadcrumbs li { display: flex; align-items: center; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: '\203A'; display: inline-block; margin: 0 8px; color: var(--line); font-weight: 700; }
.breadcrumbs li a { color: var(--muted); font-weight: 600; }
.breadcrumbs li a:hover { color: var(--accent); }
.breadcrumbs li:last-child span { color: var(--ink); font-weight: 700; }

.flag-stripe { height: 4px; display: flex; width: 100%; }
.flag-stripe span { flex: 1; }
.flag-stripe .b { background: var(--ke-black); }
.flag-stripe .w { background: var(--ke-white); flex: 0 0 2px; }
.flag-stripe .r { background: var(--ke-red); }
.flag-stripe .g { background: var(--ke-green); }

.topbar { background: var(--ke-black); color: #cfd3d8; font-size: 13px; }
/* nowrap: the ticker is built to shrink and clip (it has its own overflow
   mask), not to wrap — wrapping would drop the language switcher onto its
   own line below it instead of keeping it pinned top-right. */
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; gap: 20px; flex-wrap: nowrap; }
/* Topbar campaign ticker — admin-managed via Campaigns in wp-admin
   (inc/campaign.php). Reuses the same seamless-loop marquee technique as
   the homepage partner/org logo slider: the track holds the message twice
   back to back and animates exactly -50%, so the join is invisible. */
.campaign-ticker { display: flex; align-items: center; gap: 16px; flex: 1 1 auto; min-width: 0; }
.campaign-ticker-date { flex-shrink: 0; font-weight: 700; color: #fff; white-space: nowrap; }
.campaign-ticker-viewport {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.campaign-ticker-track { display: flex; width: max-content; gap: 60px; animation: analition-marquee 24s linear infinite; }
.campaign-ticker:hover .campaign-ticker-track { animation-play-state: paused; }
.campaign-ticker-item { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .campaign-ticker-track { animation: none; }
  .campaign-ticker-viewport { overflow-x: auto; }
}
.lang-switch { display: flex; gap: 10px; flex-shrink: 0; }
.lang-switch button, .lang-switch a, .lang-switch span { background: none; border: none; color: #cfd3d8; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0; }
.lang-switch a:hover { color: #fff; }
.lang-switch .active { color: #fff; text-decoration: underline; cursor: default; }

/* Google Website Translator — drive it from our own EN/SW buttons and hide
   every bit of Google's own chrome (the widget box, the top banner iframe,
   the highlight it puts on translated words). */
.goog-te-hidden, .goog-te-gadget, #goog-gt-tt, .skiptranslate iframe.skiptranslate { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 21px; color: var(--ink); }
.brand .mark { width: 36px; height: 24px; flex-shrink: 0; display: block; border-radius: 4px; overflow: hidden; border: 1px solid rgba(0,0,0,.1); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.brand .mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .03em; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { font-weight: 600; font-size: 15px; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--accent); border-color: var(--accent); }

/* Grouped nav items ("Explore", "About") — a plain-language dropdown rather
   than more top-level links, since the nav grew past what reads well flat. */
.nav-item.has-dropdown { position: relative; }
.nav-dropdown-toggle {
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); background: none; border: none;
  padding: 6px 0; border-bottom: 2px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-caret { transition: transform .15s ease; flex-shrink: 0; }
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active { color: var(--accent); border-color: var(--accent); }
.nav-item.has-dropdown:hover .nav-caret, .nav-item.has-dropdown:focus-within .nav-caret { transform: rotate(180deg); }
.nav-dropdown {
  /* Flush against the toggle (no margin-top gap): a gap there is dead
     space that belongs to neither element, so moving the pointer into it
     — even briefly — drops :hover and closes the menu before a slow-moving
     click can land. padding-top gives the same visual breathing room
     without creating that dead zone. */
  display: none; position: absolute; top: 100%; left: 0; margin-top: 0; padding-top: 14px;
  min-width: 210px; z-index: 60;
}
.nav-dropdown-inner {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px;
}
.nav-item.has-dropdown:hover .nav-dropdown, .nav-item.has-dropdown:focus-within .nav-dropdown { display: block; }
.nav-dropdown a { display: block; font-size: 14px; padding: 10px 12px; border-radius: 6px; border-bottom: none; white-space: nowrap; }
.nav-dropdown a:hover, .nav-dropdown a.active { background: var(--surface-alt); color: var(--accent); }

.header-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; z-index: 60; position: relative; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.nav-open { overflow: hidden; }

/* ==========================================================================
   Hero + headline numbers
   ========================================================================== */
.hero { background: linear-gradient(180deg, #fff 0%, var(--surface-alt) 100%); padding: 44px 0; }
.hero h1 { font-size: 40px; margin-bottom: 18px; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 560px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.stat-dashboard { background: var(--surface-alt); }
.stat-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.stat-card-lg {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 3px rgba(20,30,25,.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card-lg:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.stat-icon-green { background: var(--accent-green-soft); color: var(--accent-green); }
.stat-num-lg { font-size: 32px; font-weight: 800; font-family: var(--font-head); display: block; }
.stat-label-lg { color: var(--muted); font-size: 13.5px; }

/* ==========================================================================
   Choropleth maps (Home: Kenya counties, Nairobi constituencies)
   ========================================================================== */
.hero-map-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 48px; align-items: center;
  max-width: min(1440px, 94vw); margin: 0 auto;
}
.hero-map-inner.reverse { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.hero-map-inner.reverse .map-card { order: 1; }
.hero-map-inner.reverse > div:last-child { order: 2; }
.nexus-map-section { background: var(--surface-alt); padding: 40px 0; }
.nexus-map-section .hero-map-inner {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.nexus-map-section h2 { font-size: 28px; margin: 0 0 14px; }
.nexus-map-section p { color: var(--muted); font-size: 16px; margin: 0 0 22px; max-width: 520px; }

.map-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* Mathare overview's ward map gets more room than the homepage maps —
   a wider column that still scales down gracefully on narrower screens. */
.mathare-map-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 620px); }
@media (max-width: 1300px) {
  .mathare-map-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 46vw); }
}
.choropleth-map { width: 100%; height: auto; display: block; }
.choropleth-shape { stroke: #fff; stroke-width: 1.2; transition: opacity .12s ease; cursor: pointer; }
.choropleth-shape:hover { opacity: .78; }
.choropleth-shape.is-active { stroke: #0f8a5f; }
.choropleth-label { font-family: inherit; font-size: 28px; font-weight: 700; fill: #2a2a2a; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.map-legend-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.map-legend-row .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Decorated pillar donut (Mathare overview): dashed orbit rings + accent
   dots are pure ornament; the floating badges carry real, computed
   percentages — never invented numbers. */
.donut-wrap { position: relative; width: 460px; height: 460px; margin: 40px auto; display: flex; align-items: center; justify-content: center; }
.donut-ring { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1.5px dashed var(--line); transform: translate(-50%, -50%); }
.donut-ring { width: 390px; height: 390px; }
.donut-ring-outer { width: 450px; height: 450px; border-color: #e9ecea; }
.donut-dot { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.donut-dot span { position: absolute; top: -13px; left: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 8px rgba(20,30,25,.1); display: flex; align-items: center; justify-content: center; }
.donut-dot span::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.donut-canvas-card { position: relative; z-index: 2; width: 280px; height: 280px; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; padding: 16px; }
.donut-badges { position: absolute; inset: 0; pointer-events: none; }
.donut-badge {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  color: #fff; font-size: 12.5px; font-weight: 700; padding: 7px 14px 7px 10px;
  border-radius: 999px; box-shadow: 0 6px 14px rgba(20,30,25,.14);
}
.donut-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.85); }
/* Mobile fallback: the floating badges are nowrap pills sized for the
   desktop ring's radius — on a narrow screen they run off the edge of the
   viewport, so below the breakpoint they're swapped for this plain list. */
.donut-mobile-legend { display: none; }

@media (max-width: 540px) {
  .donut-wrap { width: 320px; height: 320px; margin: 24px auto; --dot-ry: 135px; }
  .donut-ring { width: 270px; height: 270px; }
  .donut-ring-outer { width: 312px; height: 312px; }
  .donut-dot span { transform: scale(.7); }
  .donut-canvas-card { width: 200px; height: 200px; }
  .donut-badges { display: none; }
  .donut-mobile-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px;
    margin: 20px auto 0; padding: 0; max-width: 320px; font-size: 13.5px; color: var(--ink); font-weight: 600;
  }
  .donut-mobile-legend li { display: flex; align-items: center; }
  .donut-mobile-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; flex-shrink: 0; }
}

/* Side-by-side chart pair (Mathare overview). Each fixed-size chart needs
   real room, so the two columns only sit side by side once the viewport
   is wide enough to give both of them that room — otherwise they stack. */
.chart-pair-grid { display: grid; grid-template-columns: 1fr; gap: 48px; margin-top: 8px; }
.chart-pair-item { text-align: center; }
.chart-pair-item h3 { font-size: 19px; margin-bottom: 10px; }
.chart-pair-item > p { color: var(--muted); font-size: 14.5px; max-width: 460px; margin: 0 auto 8px; }
.chart-pair-card { margin: 20px auto 0; max-width: 520px; height: 300px; position: relative; }
@media (min-width: 1100px) {
  .chart-pair-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ==========================================================================
   Logo slider (Home) — a sampled, auto-scrolling strip of real
   organisations. Falls back to generated initials where no photo was
   uploaded (same avatar system used everywhere else on the site).
   ========================================================================== */
.logo-slider-section { background: var(--surface-alt); padding: 40px 0 48px; }
.logo-slider-section .section-head { margin-bottom: 36px; }
.logo-slider { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.logo-slider + .logo-slider { margin-top: 28px; }
.logo-slider-track { display: flex; gap: 36px; width: max-content; animation: analition-marquee 50s linear infinite; }
.logo-slider-track-reverse { animation-name: analition-marquee-reverse; animation-duration: 56s; }
.logo-slider:hover .logo-slider-track { animation-play-state: paused; }
.logo-slider-item { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 110px; flex-shrink: 0; text-align: center; }
.logo-slider-item .avatar { width: 56px; height: 56px; font-size: 18px; }
.logo-slider-item .name { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.logo-slider-item:hover .name { color: var(--accent); }
@keyframes analition-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes analition-marquee-reverse {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-slider-track { animation: none; }
  .logo-slider { overflow-x: auto; }
}

/* ==========================================================================
   Cards: ward tiles, pillar summary, org cards
   ========================================================================== */
.ward-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
/* "Three ways in" (Learn/See Mathare/Join) is always exactly 3 cards, so it
   gets its own horizontal-row layout rather than the 2-up default the
   6-tile ward grid elsewhere uses — see the responsive overrides below. */
.feature-grid-3up { grid-template-columns: repeat(3, 1fr); }
.ward-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden; display: block;
  box-shadow: 0 1px 3px rgba(20,30,25,.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ward-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.ward-card::after, .org-card::after {
  content: '\2192';
  position: absolute; bottom: 18px; right: 18px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-alt); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; line-height: 1;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.ward-card:hover::after, .org-card:hover::after {
  background: var(--accent); color: #fff; transform: translateX(3px);
}
/* Team cards aren't links (no single-profile page yet) — drop the "go to"
   arrow so the card doesn't promise a click that goes nowhere. */
.org-card.org-card-static::after { display: none; }
.org-card.org-card-static:hover { transform: none; box-shadow: 0 1px 3px rgba(20,30,25,.05); }
/* Generic "this card isn't a link" suppression, for any .ward-card/.org-card
   used purely as a value-prop tile (e.g. the Join page's three info cards). */
.ward-card.card-static::after, .org-card.card-static::after { display: none; }
.ward-card.card-static:hover, .org-card.card-static:hover { transform: none; box-shadow: 0 1px 3px rgba(20,30,25,.05); }
.ward-card-accent { display: block; height: 6px; width: 100%; }
.ward-card-body { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.ward-card-head { display: flex; align-items: center; gap: 16px; }
.ward-card-icon {
  width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
}
.ward-card-titles { display: flex; flex-direction: column; gap: 8px; }
.ward-card h3 { margin: 0; font-size: 23px; }
.ward-card .count { color: var(--muted); font-size: 14px; }
.ward-card-count-badge { align-self: flex-start; background: var(--accent-soft); color: var(--ink); font-weight: 800; font-size: 13px; padding: 4px 11px; border-radius: 999px; }

/* Feature cards (Home: Learn / See Mathare / Join) — reuse the ward-card
   shell, swap the letter badge for an icon and centre the content. */
.feature-card .ward-card-body { align-items: center; text-align: center; padding-top: 32px; padding-bottom: 32px; }
.feature-icon { background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.feature-icon-green { background: var(--accent-green-soft); color: var(--accent-green); }

/* Contact page */
.contact-quicklinks { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.contact-quicklinks li { display: flex; align-items: flex-start; gap: 14px; }
.contact-quicklinks strong { display: block; font-size: 15px; margin-bottom: 2px; }
.contact-quicklinks p { margin: 0; color: var(--muted); font-size: 13.5px; }
.contact-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.contact-details { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.contact-details li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.contact-details svg { color: var(--accent); flex-shrink: 0; }
.feature-card .count { max-width: 280px; }
.pillar-bars { display: flex; flex-direction: column; gap: 8px; }
.pillar-bar-row { display: grid; grid-template-columns: 90px 1fr 26px; align-items: center; gap: 8px; font-size: 12.5px; }
.pillar-bar-row .label { color: var(--muted); }
.pillar-bar-track { background: var(--surface-alt); border-radius: 999px; height: 8px; overflow: hidden; }
.pillar-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.pillar-bar-row .val { text-align: right; font-weight: 700; }

.level-group { margin-bottom: 36px; }
.level-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.level-badge { padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: #fff; }
.level-badge.high { background: #1BAF7A; }
.level-badge.medium { background: #EB6834; }
.level-badge.low { background: #8a8e94; }
.level-count { color: var(--muted); font-size: 13px; }
.level-group.collapsed-group { border-top: 1px dashed var(--line); padding-top: 24px; }

.org-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.org-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden; display: block;
  box-shadow: 0 1px 3px rgba(20,30,25,.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.org-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.org-card-accent { display: block; height: 5px; width: 100%; }
.org-card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.org-card-top { display: flex; align-items: center; gap: 12px; }
.org-card-name { font-weight: 700; font-size: 15px; }
.org-card-activities { color: var(--muted); font-size: 13px; }
.org-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* A visual cue only — the whole card is already the link to this org's page
   (and its Team section), so this isn't a second clickable target. */
.org-card-team-note { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--accent-green); }
.org-card-team-note svg { flex-shrink: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; }
/* Team cards: a full-width, edge-to-edge square photo stacked above the
   details (the card's own overflow:hidden + border-radius already clips its
   top corners to match), rather than the small circular initials avatar
   used for org/stakeholder cards. */
.team-card-photo { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.team-card-photo .avatar { width: 100% !important; height: 100% !important; border-radius: 0; object-fit: cover; display: block; }
/* One more column than the default org-card-grid, plus a touch less body
   padding/font-size — team cards carry much less text than org/stakeholder
   cards, so the extra room those use isn't needed here. */
.team-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.team-grid .org-card-body { padding: 14px; gap: 8px; }
.team-grid .org-card-name { font-size: 14px; }
.team-grid .org-card-activities { font-size: 12px; }
/* Stakeholders are grouped by type (INGO/NGO/Network/…) and most groups only
   have a handful of entries — repeat(3,1fr) would stretch 1-2 cards to fill
   a row they don't have content for, leaving a lot of dead space. Cards
   here size to their own content instead and the row just wraps. */
.stakeholder-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 320px)); }

.org-column-list { display: flex; flex-direction: column; gap: 12px; }
.org-column-item { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.org-column-item .main { flex: 1; }
.org-column-item .main strong { font-size: 14.5px; }
.org-column-item .status { color: var(--muted); font-size: 12.5px; }

/* filters + search */
.filter-panel { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 32px; }
.filter-panel .search-box { max-width: 100%; margin-bottom: 20px; }
.filter-toolbar { display: flex; align-items: center; gap: 12px; }
.filter-toolbar .search-box { flex: 1; margin-bottom: 0; }
.filters-btn {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filters-btn:hover { border-color: var(--accent); }
.filters-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters-panel-body { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.filters-panel-body[hidden] { display: none; }
.filter-group { margin-bottom: 18px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-bar-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar a, .filter-bar button {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; background: #fff; color: var(--ink); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-bar a:hover, .filter-bar button:hover { border-color: var(--accent); }
.filter-bar a.active, .filter-bar button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; max-width: 320px; margin-bottom: 24px; }
.search-box svg { flex-shrink: 0; color: var(--muted); }
.search-box input { border: none; outline: none; flex: 1; font-size: 14.5px; font-family: inherit; background: none; }

.how-measured { position: relative; display: inline-block; }
.how-measured summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 700; list-style: none; }
.how-measured summary::-webkit-details-marker { display: none; }
.how-measured[open] summary { margin-bottom: 10px; }
.how-measured .pop { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13.5px; color: var(--muted); max-width: 440px; }

/* ==========================================================================
   Join wizard
   ========================================================================== */
.wizard-progress { background: var(--surface-alt); border-radius: 999px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.wizard-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; width: 16.66%; }
.wizard-step-label { color: var(--muted); font-size: 12.5px; margin: 0 0 24px; text-transform: uppercase; letter-spacing: .04em; }
.wizard-step h3 { margin-bottom: 18px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.wizard-nav button:only-of-type { margin-left: auto; }
#joinSearchResults { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* Beats .form-field label's `display: block` (equal specificity, but this
   utility must always render inline regardless of which container it's in). */
label.checkbox-inline, .form-field label.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; font-size: 14px; font-weight: 400; white-space: nowrap; }

@media print {
  .topbar, .site-header, .footer-cta, .site-footer, .wizard-progress, .wizard-step-label, .wizard-nav,
  #joinSearchResults, #joinSearch, #joinDraftBanner, .page-actions, .ward-grid, .nexus-map-section,
  .wizard-step[data-step="1"] { display: none !important; }
  .wizard-step { display: block !important; page-break-inside: avoid; margin-bottom: 24px; }
  body { font-size: 12pt; }
}

/* ==========================================================================
   Learn lessons
   ========================================================================== */
.lesson { max-width: 740px; margin: 0 auto 56px; padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.lesson:last-of-type { border-bottom: none; }
.lesson-illustration {
  width: 100%; aspect-ratio: 16/7; border-radius: var(--radius); margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background-image: linear-gradient(135deg, rgba(255,255,255,.18), transparent 60%);
}
.lesson-illustration svg { width: 56px; height: 56px; }
.lesson-number { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; margin-right: 10px; }
.lesson h2 { display: inline; }
.lesson-length { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.lesson-body p { font-size: 16px; }
.check-block { background: var(--surface-alt); border-radius: var(--radius); padding: 24px; margin-top: 28px; }
.check-q { margin-bottom: 18px; }
.check-q p { font-weight: 700; margin-bottom: 10px; }
.check-options { display: flex; gap: 10px; flex-wrap: wrap; }
.check-options button { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; cursor: pointer; }
.check-options button.correct { background: #1BAF7A; border-color: #1BAF7A; color: #fff; }
.check-options button.incorrect { background: #e3665a; border-color: #e3665a; color: #fff; }

/* ==========================================================================
   Placeholder pages (Kenya / Nairobi)
   ========================================================================== */
.placeholder-card { background: #fff7e8; border: 1px solid #f0dfb8; border-radius: var(--radius); padding: 28px; margin: 28px 0; }
.placeholder-card h3 { margin-top: 0; }

/* ==========================================================================
   Org profile
   ========================================================================== */
.org-hero { display: grid; grid-template-columns: 110px 1fr; gap: 24px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.org-hero h1 { font-size: 28px; margin-bottom: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 40px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.metric-card .val { font-size: 20px; font-weight: 800; font-family: var(--font-head); }
.metric-card .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.org-content { max-width: 760px; }
.org-content p { color: var(--ink); }

/* Organisation profile's About/Activities/Who it serves/Registration/Contact
   — a grid of small info cards instead of a plain stacked list of headings,
   matching the icon-badge card language used elsewhere (.feature-card,
   .join-path-card) rather than inventing a new pattern for this one page. */
/* auto-fit lets this pick up more columns on a wide screen instead of
   staying capped at two with blank space beside it, while minmax keeps each
   card a comfortable reading width rather than stretching edge to edge.
   Default (stretch) align-items, not start, so every card in a row matches
   the row's tallest one instead of each sizing only to its own content. */
.org-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1100px; margin: 0 0 20px; }
.org-info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
/* An org with several activities gets a double-width card so its chips wrap
   across more room and stay shorter, instead of a tall single column that
   (via the grid's row-stretch) forces every other card in the row to match. */
.org-info-card-wide { grid-column: span 2; }
.org-info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  margin-bottom: 10px;
}
.org-info-card h3 { margin: 0 0 8px; font-size: 16px; }
.org-info-card p { margin: 0; color: var(--ink); font-size: 14.5px; }
.org-info-card .contact-details { margin-top: 10px; }
.org-info-card .as-of { margin-top: 10px; }
.org-section-heading { display: flex; align-items: center; gap: 12px; }
.org-section-heading .org-info-icon { margin-bottom: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
.surface-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-family: inherit; min-height: 44px;
}
.form-field textarea { min-height: 120px; resize: vertical; }
.notice { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.notice.success { background: rgba(27,175,122,.12); color: #0f7a53; }
.notice.error { background: rgba(227,102,90,.12); color: #b23224; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.leaderboard-actions, .page-actions { display: flex; justify-content: center; margin-top: 30px; }
.page-numbers { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.page-numbers li a, .page-numbers li span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.page-numbers li span.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-numbers li a:hover { background: var(--surface-alt); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-cta { background: var(--accent-green); }
.footer-cta .container { display: flex; align-items: center; justify-content: space-between; padding: 40px 24px; gap: 24px; flex-wrap: wrap; }
.footer-cta h3 { color: #fff; margin: 0 0 6px; font-size: 22px; }
.footer-cta p { color: rgba(255,255,255,.85); margin: 0; }
.footer-cta .btn-primary, .footer-cta .btn-green { background: #fff; color: var(--accent-green); }
.footer-cta .btn-primary:hover, .footer-cta .btn-green:hover { background: var(--surface-alt); }

.site-footer { background: #15171a; color: #b9bdc3; padding: 0; }
.site-footer .footer-grid { padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-grid p { font-size: 14px; line-height: 1.7; }
.footer-grid li { margin-bottom: 10px; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2a2c30; padding: 18px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }

/* Block content seeded into the "footer-about" page (paragraph + partner
   logos) inherits the surrounding dark footer column's own type rules —
   this just lays out the logo row the block editor's Columns block produces. */
.footer-about-content .wp-block-columns { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 0; }
.footer-about-content .wp-block-column { flex: 0 0 auto; margin: 0; }
.footer-about-content .wp-block-column img { display: block; height: auto; opacity: .9; }

/* ==========================================================================
   Responsive — mobile first per brief; these are the exceptions for wider screens
   ========================================================================== */
@media (max-width: 980px) {
  .contact-grid { grid-template-columns: 1fr; }
  .stat-card-grid { grid-template-columns: repeat(2, 1fr); }
  .ward-grid, .org-card-grid, .feature-grid-3up { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .stakeholder-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-map-inner, .hero-map-inner.reverse { grid-template-columns: 1fr; }
  .hero-map-inner .map-card, .hero-map-inner.reverse .map-card { max-width: 420px; margin: 0 auto; }
  .hero-map-inner.reverse .map-card { order: 0; }
  .hero-map-inner.reverse > div:last-child { order: 1; text-align: center; }
  .nexus-map-section p { margin-left: auto; margin-right: auto; }
}
@media (max-width: 1400px) {
  .header-cta { display: none; }
  .main-nav { position: fixed; top: var(--nav-top, 96px); right: 0; bottom: 0; left: 0; background: #fff; flex-direction: column; padding: 24px; gap: 4px; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; z-index: 55; }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); width: 100%; }
  .main-nav a:hover, .main-nav a.active { border-color: var(--line); background: var(--surface-alt); }
  /* No hover on touch — a group's sub-links just sit indented underneath its
     label, always open, instead of behaving like a desktop hover dropdown. */
  .nav-item.has-dropdown { width: 100%; }
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: default; color: var(--muted); }
  .nav-dropdown-toggle.active { color: var(--accent); border-color: var(--line); }
  .nav-item.has-dropdown:hover .nav-caret { transform: none; }
  .nav-dropdown { display: block; position: static; margin: 0; padding: 0 0 0 16px; min-width: 0; }
  .nav-dropdown-inner { background: none; border: none; box-shadow: none; padding: 0; }
  .nav-dropdown a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 15px; border-radius: 0; }
  .nav-dropdown a:hover, .nav-dropdown a.active { background: var(--surface-alt); }
  .nav-toggle { display: block; }
  .site-header .container { padding-top: 10px; padding-bottom: 10px; }
  .brand { font-size: 17px; min-width: 0; gap: 8px; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand .mark { width: 30px; height: 20px; }
}
@media (max-width: 720px) {
  .campaign-ticker-date { font-size: 12.5px; }
  .hero { padding: 40px 0; }
  .hero h1 { font-size: 28px; }
  .section, .nexus-map-section { padding: 32px 0; }
  .ward-grid, .org-card-grid, .feature-grid-3up { grid-template-columns: 1fr; }
  .footer-cta .container { text-align: center; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .org-hero { grid-template-columns: 1fr; text-align: center; }
  .org-hero .avatar-lg-wrap { margin: 0 auto; }
  .org-info-grid { grid-template-columns: 1fr; }
  .org-info-card-wide { grid-column: span 1; }
}
@media (max-width: 420px) {
  .brand small { display: none; }
  .brand { font-size: 15.5px; }
}
