/* Ecoclime Africa Learning Hub -- site stylesheet.
   Palette and fonts sourced from Brand Assets/_shared/eco_brand.py. Do not
   invent new brand colors here; this file must stay in sync with that
   module if the palette ever changes. */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Open+Sans:wght@400;600;700&display=swap');

:root {
  --primary: #006A56;
  --primary-dark: #004A3D;
  --primary-tint: #E4F2EE;
  --ink: #16211E;
  --paper: #FFFFFF;
  --muted: #5B6B67;
  --rule: #D8DEE6;
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  --max-w: 1120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--primary-dark); line-height: 1.25; }
h1 { font-size: 2.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.8rem; margin: 0 0 1rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ═══ NAVIGATION ══════════════════════════════════════════════════════
   Markup lives in partials/nav.html and is injected by assets/js/script.js. */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.2s ease;
}
.nav.scrolled { box-shadow: 0 2px 14px rgba(22, 33, 30, 0.09); }
.nav__inner { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; }

.nav__brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.nav__brand:hover { text-decoration: none; }
.nav__logo { height: 42px; width: 42px; }
.nav__brand-name {
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
  color: var(--primary-dark); line-height: 1.15; display: block;
}
.nav__brand-name small {
  display: block; font-family: var(--font-body); font-weight: 600;
  font-size: 0.75rem; color: var(--muted); letter-spacing: 0.4px;
}

.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; margin-left: auto; }
.nav__links > li { position: relative; }
.nav__links a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: var(--ink); font-weight: 600; font-size: 0.94rem;
  /* Reserves the width of the bold state so the active page does not shift layout. */
  text-shadow: 0 0 0.01px currentColor;
}
.nav__links a:hover { color: var(--primary); background: var(--primary-tint); text-decoration: none; }
.nav__links a.active { color: var(--primary-dark); font-weight: 700; box-shadow: inset 0 -2px 0 var(--primary); }

.dropdown-content {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(22, 33, 30, 0.13);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.nav__links .dropdown:hover .dropdown-content,
.nav__links .dropdown:focus-within .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-content a { display: block; padding: 9px 12px; font-weight: 600; font-size: 0.9rem; }

/* Search */
.nav__search { position: relative; flex-shrink: 0; }
.nav__search-input {
  width: 172px; padding: 8px 12px 8px 32px;
  border: 1px solid var(--rule); border-radius: 999px;
  font-family: var(--font-body); font-size: 0.87rem; color: var(--ink);
  background: #FAFCFB; transition: width 0.2s ease, border-color 0.2s ease;
}
.nav__search-input:focus { outline: none; border-color: var(--primary); width: 220px; background: var(--paper); }
.nav__search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nav__search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: 60vh; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(22, 33, 30, 0.16); padding: 6px; z-index: 60;
}
.search-result { display: block; padding: 10px 12px; border-radius: 7px; }
.search-result:hover { background: var(--primary-tint); text-decoration: none; }
.search-result__type {
  display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--primary);
}
.search-result__title { display: block; font-weight: 700; color: var(--primary-dark); margin: 2px 0; font-size: 0.93rem; }
.search-result__snippet { display: block; font-size: 0.83rem; color: var(--muted); line-height: 1.45; }
.search-hint { padding: 14px; color: var(--muted); font-size: 0.87rem; }

/* Burger, shown only on narrow screens */
.nav__burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 0 9px; margin-left: auto;
  background: none; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer;
}
.nav__burger span { display: block; height: 2px; background: var(--primary-dark); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile navigation panel */
.mobile-nav {
  display: none; flex-direction: column; position: sticky; top: 63px; z-index: 45;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding: 8px 24px 16px; box-shadow: 0 10px 22px rgba(22, 33, 30, 0.1);
}
.mobile-nav.open { display: flex; }
.mobile-nav > a, .mobile-nav .dropdown > a {
  display: block; padding: 12px 4px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.mobile-nav a.active { color: var(--primary-dark); font-weight: 700; }
.mobile-nav .dropdown .dropdown-content {
  position: static; opacity: 1; visibility: visible; transform: none;
  box-shadow: none; border: none; border-radius: 0; padding: 0 0 0 14px;
  max-height: 0; overflow: hidden; transition: max-height 0.22s ease;
}
.mobile-nav .dropdown.open .dropdown-content { max-height: 300px; }
.mobile-nav .dropdown > a::after { content: ' +'; color: var(--primary); }
.mobile-nav .dropdown.open > a::after { content: ' –'; }
.mobile-nav__search-btn {
  width: 100%; text-align: left; padding: 11px 12px; margin-bottom: 6px;
  background: var(--primary-tint); border: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem; color: var(--primary-dark);
}

/* Full-screen search modal, used on narrow screens */
.search-modal { position: fixed; inset: 0; z-index: 100; background: rgba(22, 33, 30, 0.55); padding: 8vh 16px 0; }
.search-modal__panel { max-width: 620px; margin: 0 auto; background: var(--paper); border-radius: 12px; overflow: hidden; }
.search-modal__input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.search-modal__input-row input { flex: 1; border: none; outline: none; font-family: var(--font-body); font-size: 1rem; color: var(--ink); }
.search-modal__input-row button { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
.search-modal__results { max-height: 60vh; overflow-y: auto; padding: 6px; }

/* Hero */
.hero {
  background: var(--primary);
  color: var(--paper);
  padding: 72px 0 64px;
}
.hero h1 { color: var(--paper); }
.hero p.lead { font-size: 1.15rem; max-width: 640px; color: #EAF6F2; }
.hero .badge {
  display: inline-block; background: rgba(255,255,255,0.15); color: #fff;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.btn {
  display: inline-block; background: var(--paper); color: var(--primary-dark);
  font-weight: 700; padding: 12px 22px; border-radius: 8px; margin-top: 8px;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn.outline { background: transparent; color: var(--paper); border: 2px solid rgba(255,255,255,0.6); margin-left: 10px; }

/* Sections */
section { padding: 56px 0; }
section.tint { background: var(--primary-tint); }
.grid { display: grid; gap: 24px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) {
  /* Desktop links and inline search collapse into the burger panel. Before
     this the nav was simply hidden here, leaving phones with no navigation. */
  .nav__links, .nav__search { display: none; }
  .nav__burger { display: flex; }
}
@media (max-width: 860px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0; }
  h1 { font-size: 2rem; }
  .part-grid { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .footer__cols { grid-template-columns: 1fr; }
  .part-nav { flex-direction: column; align-items: stretch; }
}

.card {
  border: 1px solid var(--rule); border-radius: 12px; padding: 24px; background: var(--paper);
}
.card h3 { color: var(--primary-dark); }
.card .tag {
  display: inline-block; background: var(--primary-tint); color: var(--primary);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}

.pillar-num {
  font-family: var(--font-heading); font-weight: 900; font-size: 2rem; color: var(--primary);
  margin-bottom: 6px;
}

/* ═══ FOOTER ══════════════════════════════════════════════════════════
   Markup lives in partials/footer.html. */
footer.site {
  background: var(--primary-dark); color: #CFE7DF;
  border-top: 3px solid var(--primary);
  padding: 48px 0 26px; margin-top: 56px;
}
footer.site a { color: #fff; display: block; padding: 5px 0; font-size: 0.9rem; transition: padding-left 0.16s ease; }
footer.site a:hover { padding-left: 5px; text-decoration: none; color: #EAF6F2; }
footer.site strong { color: #fff; display: block; margin-bottom: 10px; font-family: var(--font-heading); font-size: 0.98rem; }
.footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; }
.footer__brand p { font-size: 0.88rem; line-height: 1.6; max-width: 340px; margin-bottom: 10px; }
.footer__brand .footer__parent { color: #9FC4B9; font-size: 0.82rem; }
.footer__logo { height: 46px; width: 46px; margin-bottom: 12px; }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.footer__bottom small { color: #9FC4B9; }
.footer__top { font-weight: 600; }

.notice {
  border-left: 4px solid var(--primary); background: var(--primary-tint);
  padding: 16px 20px; border-radius: 6px; margin: 24px 0;
}

table.roadmap { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.roadmap th, table.roadmap td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
table.roadmap th { color: var(--primary-dark); font-family: var(--font-heading); }
table.roadmap tr:nth-child(even) { background: var(--primary-tint); }

/* ═══ SUSTAINABILITY 101 LISTING ══════════════════════════════════════
   Rendered from assets/data/series.json by assets/js/series.js. */
.module-block { padding: 0; margin-bottom: 44px; }
.module-block__head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 22px; }
.module-block__eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary); background: var(--primary-tint); padding: 4px 10px; border-radius: 999px;
}
.module-block__head h2 { margin: 0; font-size: 1.45rem; }

.part-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.part-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper);
  color: inherit; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.part-card:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(22, 33, 30, 0.12); border-color: var(--primary);
}
.part-card__media { background: var(--primary-tint); aspect-ratio: 16 / 9; overflow: hidden; }
.part-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.part-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.part-card__meta { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--primary); margin-bottom: 7px; }
.part-card__body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.part-card__body p { font-size: 0.9rem; color: var(--muted); line-height: 1.58; flex: 1; }
.part-card__cta { font-weight: 700; color: var(--primary); font-size: 0.88rem; margin-top: 10px; }
.part-card__badge {
  align-self: flex-start; margin-top: 10px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px; padding: 4px 11px;
}
.part-card--scheduled { opacity: 0.82; }
.part-card--scheduled .part-card__media { filter: grayscale(0.55); }

/* ═══ PART DETAIL ═════════════════════════════════════════════════════ */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.part-meta { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.part-hero { width: 100%; border-radius: 12px; border: 1px solid var(--rule); margin: 22px 0 28px; display: block; }
.part-body { font-size: 1.04rem; line-height: 1.75; }
.part-body h3 { font-size: 1.2rem; margin: 30px 0 10px; color: var(--primary-dark); }
.part-body ul { padding-left: 22px; margin: 0 0 18px; }
.part-body li { margin-bottom: 8px; }
.part-body p { margin-bottom: 18px; }

.part-nav { display: flex; align-items: stretch; gap: 14px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--rule); }
.part-nav__link { flex: 1; border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.part-nav__link:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-tint); }
.part-nav__label { display: block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--primary); }
.part-nav__title { display: block; font-weight: 600; color: var(--ink); font-size: 0.92rem; margin-top: 3px; }
.part-nav__all { align-self: center; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

.load-error { color: var(--muted); padding: 22px; border: 1px dashed var(--rule); border-radius: 10px; }

/* ═══ REPORT REGIONS ══════════════════════════════════════════════════ */
.region-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 20px; }
@media (max-width: 700px) { .region-list { grid-template-columns: 1fr; } }
.region { border-left: 3px solid var(--primary); padding: 4px 0 4px 16px; }
.region h4 { margin: 0 0 5px; font-family: var(--font-heading); color: var(--primary-dark); font-size: 1.02rem; }
.region p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* Skip link, keyboard users land here first */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary-dark); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
