/* ===========================================================================
   RBF Works — strawman mockup
   Aesthetic: editorial knowledge hub. Deep royal blue authority + amber
   "energy" gradient on warm paper. Network-node motif from the logo.
   =========================================================================== */

:root {
  /* brand */
  --blue-900: #131f4d;
  --blue-800: #1b2a63;
  --blue-700: #2b3f8c;   /* the wordmark blue */
  --blue-500: #3a5bc7;
  --blue-200: #c3cdec;
  --blue-100: #e7ebf7;
  --amber:    #f7941e;
  --amber-2:  #fdb913;
  --grad-energy: linear-gradient(118deg, #f7941e 0%, #fdb913 100%);

  /* neutrals — warm paper */
  --paper:   #faf7f1;
  --paper-2: #f2ecdf;
  --card:    #ffffff;
  --ink:     #141f3c;
  --muted:   #5e6885;
  --line:    rgba(20, 32, 63, .12);
  --line-2:  rgba(20, 32, 63, .07);

  /* type */
  --display: "Montserrat", system-ui, sans-serif;
  --sans: "Montserrat", system-ui, sans-serif;
  --mono: "Montserrat", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px rgba(19,31,77,.06), 0 1px 3px rgba(19,31,77,.05);
  --shadow:    0 10px 30px -12px rgba(19,31,77,.22);
  --shadow-lg: 0 30px 60px -22px rgba(19,31,77,.30);

  --rad: 14px;
  --rad-sm: 9px;
  --maxw: 1240px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--amber);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--amber); display: inline-block; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250,247,241,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 8px 24px -18px rgba(19,31,77,.4); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  position: relative;
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-800); padding: 9px 13px; border-radius: 8px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-links a .num { font-family: var(--mono); color: var(--amber); font-size: 10px; margin-right: 5px; opacity: .9; }
.nav-links a:hover { background: var(--blue-100); }
.nav-links a.active { color: var(--blue-700); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px;
  background: var(--grad-energy); border-radius: 2px;
}
.nav-links a.soon { color: var(--muted); }
.nav-cta {
  background: var(--blue-700); color: #fff !important; border-radius: 999px;
  padding: 9px 18px !important;
}
.nav-cta:hover { background: var(--blue-800) !important; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--blue-800); position: relative; transition: .25s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--blue-800); }
.btn-amber { background: var(--grad-energy); color: var(--blue-900); box-shadow: 0 12px 26px -12px rgba(247,148,30,.6); }
.btn-ghost { border-color: var(--line); color: var(--blue-800); background: rgba(255,255,255,.4); }
.btn-ghost:hover { background: #fff; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(19,31,77,.30) 0%, rgba(19,31,77,.10) 38%, rgba(19,31,77,.62) 100%),
    linear-gradient(100deg, rgba(19,31,77,.82) 0%, rgba(19,31,77,.30) 52%, rgba(19,31,77,0) 78%);
}
.hero-net { position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none; }
.hero-inner { padding: 116px 0 120px; max-width: 900px; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); font-weight: 600; letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--amber-2); }
.hero .lead { font-size: clamp(17px, 1.6vw, 21px); color: rgba(255,255,255,.88); max-width: 620px; margin-top: 24px; }
.hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hosted {
  display: flex; gap: 40px; margin-top: 64px; align-items: flex-start; flex-wrap: wrap;
}
.hosted .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.hosted strong { font-weight: 600; font-size: 15px; color: #fff; }

/* ---------- stat band ---------- */
.statband { background: var(--blue-900); color: #fff; position: relative; overflow: hidden; }
.statband .wrap { display: grid; grid-template-columns: 0.8fr 0.8fr 0.8fr 1.2fr 1.35fr; gap: 24px; padding: 46px 32px; position: relative; z-index: 1; }
.statband .stat .n { white-space: nowrap; }
.stat { border-left: 1px solid rgba(255,255,255,.16); padding-left: 22px; }
.stat .n { font-family: var(--mono); font-weight: 600; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.02em; }
.stat .n .unit { color: var(--amber-2); }
.stat .l { font-size: 13.5px; color: rgba(255,255,255,.7); margin-top: 10px; letter-spacing: .02em; }
.statband::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(247,148,30,.28), transparent 62%); z-index: 0;
}

/* ---------- sections ---------- */
section { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 46px); margin-top: 16px; }
.section-head p { color: var(--muted); margin-top: 16px; font-size: 18px; }

/* destination cards */
.dest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dest {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 28px 26px 26px; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
  display: flex; flex-direction: column; min-height: 196px;
}
.dest:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.dest .idx { font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: .1em; }
.dest h3 { font-size: 23px; margin: 14px 0 8px; }
.dest p { color: var(--muted); font-size: 15px; flex: 1; }
.dest .go { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--blue-700); }
.dest .go .arrow { transition: transform .25s var(--ease); }
.dest:hover .go .arrow { transform: translateX(5px); }
.dest::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--grad-energy); transition: width .4s var(--ease); }
.dest:hover::after { width: 100%; }
.dest .tag-soon { position: absolute; top: 20px; right: 20px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 4px 8px; border-radius: 999px; }
.dest.soon-card { cursor: default; opacity: .92; }
.dest.soon-card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.dest.soon-card::after { display: none; }
.nav-links a.disabled { pointer-events: none; }
.soon-link { display: block; color: rgba(20,32,63,.4); font-size: 14.5px; padding: 5px 0; }

/* alt section bg */
.bg-paper2 { background: var(--paper-2); }
.bg-blue-tint { background: var(--blue-100); }   /* cool pale-blue band (funder/contribute) */
.contribute-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.contribute-logos { text-align: right; }
/* About page funder section: two columns with logos in a row; on mobile, single column + stacked logos */
.about-funders { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about-funders .flogo-row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 860px) {
  .about-funders { grid-template-columns: 1fr; gap: 30px; }
  .about-funders .flogo-row { flex-direction: column; align-items: flex-start; gap: 18px; }
}
/* Contribute page path picker: 3 cards on desktop; on mobile a segmented toggle flips a single card */
.contrib-paths { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; max-width: 1100px; }
.contrib-toggle { display: none; }
@media (max-width: 860px) {
  .contrib-toggle { display: flex; gap: 3px; background: var(--paper-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
  .contrib-toggle button { flex: 1; font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; padding: 10px 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
  .contrib-toggle button.on { background: #fff; color: var(--blue-700); box-shadow: 0 1px 2px rgba(19,31,77,.14); }
  .contrib-toggle button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
  .contrib-paths { grid-template-columns: 1fr; }
  .contrib-paths .dest { display: none; }
  .contrib-paths .dest.is-active { display: flex; }
}
.bg-blue { background: var(--blue-900); color: #fff; }
.bg-blue .muted { color: rgba(255,255,255,.72); }
.bg-blue .section-head p { color: rgba(255,255,255,.72); }

/* ---------- page header (interior pages) ---------- */
.page-head { padding: 44px 0 40px; }
.page-head h1 { font-size: clamp(38px, 5vw, 64px); }
.page-head .lead { color: var(--muted); font-size: 19px; max-width: 800px; margin-top: 18px; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: stretch; padding-bottom: 90px; }
.map-panel-cell { position: relative; }
.map-stage { position: relative; background: linear-gradient(180deg,#fff, #fbf8f2); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; }
#worldmap { width: 100%; height: auto; display: block; }
#worldmap .land { fill: #e9e3d6; stroke: #fff; stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .2s; }
#worldmap .land.has-data { fill: var(--blue-200); cursor: pointer; }
#worldmap .land.has-data:hover, #worldmap .land.active { fill: var(--amber); }
.map-node { fill: var(--blue-700); opacity: .9; cursor: pointer; transition: fill .2s; }
.map-node:hover { fill: var(--amber); }
.map-tooltip {
  position: fixed; pointer-events: none; z-index: 80; background: var(--blue-900); color: #fff;
  padding: 9px 13px; border-radius: 9px; font-size: 13px; box-shadow: var(--shadow); opacity: 0;
  transition: opacity .15s; max-width: 240px;
}
.map-tooltip b { color: var(--amber-2); }
.map-mini-stats { display: flex; gap: 26px; margin-bottom: 18px; flex-wrap: wrap; }
.map-mini-stats .ms { }
.map-mini-stats .ms .n { font-family: var(--mono); font-weight: 600; font-size: 30px; color: var(--blue-700); }
.map-mini-stats .ms .n .unit { color: var(--amber); }
.map-mini-stats .ms .l { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.map-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: 24px; position: absolute; inset: 0; overflow: auto; }
.map-panel .ph { color: var(--muted); font-size: 15px; }
.map-clear { background: none; border: 0; color: var(--blue-700); font-family: var(--sans); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0 0 12px; display: inline-flex; align-items: center; gap: 6px; }
.map-clear:hover { color: var(--amber); }
.map-panel h3 { font-size: 26px; display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.map-panel h3 .cnt { font-family: var(--mono); font-size: 14px; color: var(--amber); }
.prog { border-top: 1px solid var(--line); padding: 14px 0; }
.prog:first-of-type { border-top: 0; }
.prog .pn { font-weight: 600; font-size: 15px; line-height: 1.35; }
.prog .meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.prog .meta .yr { font-family: var(--mono); color: var(--blue-700); }

/* Map program cards (redesign) — bordered cards with a status+timeframe pill, role-led facts, and a
   coloured left rail (green = active, warm grey = ended) for at-a-glance scanning down a list. */
.map-panel .prog { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.map-panel .prog.act { border-left: 3px solid #1c7c39; }
.map-panel .prog.ended { border-left: 3px solid #cfc9bc; }
.map-panel .prog .pn { font-weight: 600; font-size: 15px; line-height: 1.35; }
.map-panel .prog .status { margin-top: 8px; }
.map-panel .badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.map-panel .badge.act { background: #e7f4ea; color: #1c7c39; }
.map-panel .badge.end { background: var(--paper-2); color: var(--muted); }
.map-panel .kv { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.map-panel .kvr { display: flex; gap: 10px; line-height: 1.5; }
.map-panel .kvr .k { flex: none; width: 90px; white-space: nowrap; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.map-panel .kvr .v { flex: 1; min-width: 0; color: var(--ink); }
.map-panel .prog-note { font-size: 12.5px; font-style: italic; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.map-panel .chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.map-panel .chips-l { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.map-panel .chip { font-size: 11px; background: var(--blue-100); color: var(--blue-700); padding: 2px 9px; border-radius: 99px; cursor: pointer; }
.map-panel .chip:hover { background: #cbddf3; }
.map-panel .chip.chip-region { background: var(--paper-2); color: var(--muted); cursor: default; }
.map-panel .chip.chip-more { background: transparent; border: 1px solid var(--line); color: var(--muted); }
/* extra "Also in" chips stay collapsed until the "+N more" pill is clicked. Needs higher specificity
   than the global `.chip { display: inline-flex }` (library) rule, which otherwise overrides [hidden]. */
.map-panel .chip.chip-extra { display: none; }
.map-panel .lib { display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--blue-700); text-decoration: none; }
.map-panel .lib:hover { text-decoration: underline; }
.map-panel .panel-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.map-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; margin-bottom: 14px; transition: box-shadow .15s, border-color .15s; }
.map-search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(58,91,199,.16); }
.map-search input { border: 0; outline: 0; font-family: var(--sans); font-size: 15px; flex: 1; background: transparent; color: var(--ink); }
/* Active / All as a single segmented control, with a live program tally filling the row's right side */
.map-filterrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 16px; }
.map-seg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; }
.map-seg .seg { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 6px 15px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s; }
.map-seg .seg.on { background: #fff; color: var(--blue-700); box-shadow: 0 1px 2px rgba(19,31,77,.14); }
.map-seg .seg:not(.on):hover { color: var(--ink); }
.map-seg .seg:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.map-count { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.legend { display: flex; gap: 18px; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
/* node-size legend: graduated circles matching the .map-node fill, showing bigger = more programs */
.legend .legend-size { display: inline-flex; align-items: center; }
.legend .dot { border-radius: 50%; background: var(--blue-700); opacity: .85; margin-right: 3px; vertical-align: middle; }
.legend .dot.s { width: 5px; height: 5px; }
.legend .dot.m { width: 9px; height: 9px; }
.legend .dot.l { width: 14px; height: 14px; }

/* reset-view control, overlaid on the map; shown only while a country is selected (zoomed in) */
.map-reset { position: absolute; top: 14px; right: 14px; z-index: 5; font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.94); color: var(--blue-700); cursor: pointer; box-shadow: var(--shadow-sm); transition: background .15s, color .15s, border-color .15s; }
.map-reset:hover { background: var(--amber); color: #fff; border-color: var(--amber); }
.map-reset[hidden] { display: none; }

/* loading state while D3 fetches world geometry from the CDN */
.map-loading { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: linear-gradient(180deg,#fff,#fbf8f2); color: var(--muted); font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; animation: mapPulse 1.4s ease-in-out infinite; }
@keyframes mapPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* search clear button (✕), shown only when the field has a query */
.map-search-clear { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px; line-height: 1; border-radius: 50%; }
.map-search-clear:hover { color: var(--ink); }
.map-search-clear[hidden] { display: none; }

/* visible keyboard focus for the now-focusable map paths, top-list rows and chips */
#worldmap .land.has-data:focus { outline: none; }
#worldmap .land.has-data:focus-visible { fill: var(--amber); stroke: var(--blue-900); stroke-width: 1.5; }
.map-panel .prog[role="button"]:focus-visible,
.map-panel .chip[role="button"]:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .map-loading { animation: none; }
}

/* ---------- library ---------- */
.lib-layout { display: grid; grid-template-columns: 252px 1fr; gap: 32px; align-items: start; }
.filters { position: sticky; top: 96px; }
.filters h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.filter-group { border-top: 1px solid var(--line); padding: 18px 0; }
.filter-group:first-child { border-top: 0; padding-top: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; margin: 0 6px 8px 0;
  background: #fff; transition: .2s; color: var(--blue-800);
}
.chip:hover { border-color: var(--blue-500); }
.chip.on { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }
.chip.dim { opacity: .4; }
.sub-countries { margin-top: 4px; padding-left: 2px; }
.searchbar {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.searchbar svg { color: var(--muted); flex: none; }
.searchbar input { border: 0; outline: 0; font-family: var(--sans); font-size: 17px; flex: 1; background: transparent; }
/* hide the native datalist dropdown arrow — we use an explicit clear (✕) button instead */
.searchbar input::-webkit-calendar-picker-indicator { display: none !important; }
.lib-clear { flex: none; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 6px; margin: -6px -6px -6px 0; border-radius: 999px; transition: color .2s, background .2s; }
.lib-clear:hover { color: var(--blue-800); background: var(--paper-2); }
.lib-clear[hidden] { display: none; }
.search-prompts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 26px; }
.search-prompts .muted { font-size: 13px; }
.prompt-chip { font-family: var(--sans); font-size: 13px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--blue-800); cursor: pointer; transition: .2s; }
.prompt-chip:hover { border-color: var(--blue-500); background: var(--blue-100); }
.lib-empty { padding: 48px; text-align: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.lib-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.lib-toolbar .count { font-size: 14px; color: var(--muted); }
.lib-toolbar .count b { color: var(--blue-700); font-family: var(--mono); }
.sortsel { font-family: var(--sans); font-size: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; color: var(--ink); }
/* Library pagination (25 / page) */
.lib-pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 34px; flex-wrap: wrap; }
.lib-pager.top { margin: 0; }   /* sits inline in the toolbar, beside the count + sort selector */
.lib-pager.top .pg { height: 34px; min-width: 34px; padding: 0 10px; font-size: 13px; }
.lib-pager:empty { display: none; }
.lib-pager .pg { min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: #fff; color: var(--blue-800); font-family: var(--sans); font-size: 14px; border-radius: 9px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.lib-pager .pg:hover:not(:disabled):not(.cur) { border-color: var(--blue-500); background: var(--blue-100); }
.lib-pager .pg.cur { background: var(--blue-700); border-color: var(--blue-700); color: #fff; cursor: default; }
.lib-pager .pg:disabled { opacity: .4; cursor: default; }
.lib-pager .pg:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.lib-pager .pg-gap { color: var(--muted); padding: 0 4px; }

.rescard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--rad);
  padding: 22px 24px; margin-bottom: 16px; display: grid; grid-template-columns: 92px 1fr minmax(120px, 240px); gap: 22px;
  transition: box-shadow .3s, border-color .3s; position: relative;
}
.rescard:hover { box-shadow: var(--shadow); }
.rescard .cover { width: 92px; height: 122px; border-radius: 8px; background: var(--blue-100); overflow: hidden; position: relative; box-shadow: var(--shadow-sm); }
.rescard .cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.rescard .cover .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg,var(--blue-700),var(--blue-900)); color: #fff; font-family: var(--mono); font-size: 10px; text-align: center; padding: 8px; }
.rescard .rtype { display: none; }   /* type label — mobile only (shown in the ≤860 card layout) */
.rescard .cardlinks { display: none; }  /* footer Source/Download — mobile only; desktop keeps them in the expand */
.rescard .body h3 { font-size: 21px; }
.rescard .body .sub { color: var(--muted); font-size: 14.5px; margin-top: 5px; }
.rescard .tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.rescard .t { font-size: 11.5px; font-family: var(--mono); letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--blue-800); }
.rescard .t.tech { background: rgba(247,148,30,.13); color: #a35c06; }
.rescard .tags .t.tech { display: none; }   /* tech chips live in the right column on desktop; merged into .tags on mobile */
.rescard .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 120px; }
.rescard .techfacet { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.rescard .techfacet span { font-size: 11.5px; font-family: var(--mono); background: rgba(247,148,30,.13); color: #a35c06; padding: 3px 9px; border-radius: 999px; }
.rescard .yr { font-family: var(--mono); font-size: 13px; color: var(--blue-700); }
.rescard .org { font-weight: 700; font-size: 15px; }
.rescard .readmore { background: none; border: 0; color: var(--blue-700); font-family: var(--sans); font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0; }
.rescard .readmore .chev { transition: transform .25s; }
.rescard.open .readmore .chev { transform: rotate(180deg); }
.rescard .expand { grid-column: 1 / -1; overflow: hidden; max-height: 0; transition: max-height .4s var(--ease); }
.rescard.open .expand { max-height: 640px; }
.rescard .expand .inner { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 240px; gap: 24px; }
.rescard .expand p { font-size: 15px; color: #2c3759; }
.rescard .facets { font-size: 13px; }
.rescard .facetscroll div { margin-bottom: 9px; }
.rescard .facets .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 2px; }
/* item 2: cap the facets (geography/countries/technology/RBF programs) at ~10 lines and scroll;
   keep the Download/Source buttons pinned below the scroll area, always visible. */
.rescard .facetscroll { max-height: 188px; overflow-y: auto; padding-right: 8px; }
.rescard .facetscroll::-webkit-scrollbar { width: 6px; }
.rescard .facetscroll::-webkit-scrollbar-track { background: transparent; }
.rescard .facetscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.rescard .facets { display: flex; flex-direction: column; }
.rescard .cardactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: auto; padding-top: 14px; }
/* attribution sits at the bottom of the summary column, level with the Download/Source buttons */
.rescard .summary { display: flex; flex-direction: column; }
.rescard .attribution { margin-top: auto; padding-top: 16px; }
.rescard .attribution .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 4px; }
.rescard .attr-text { font-size: 12px; line-height: 1.55; color: var(--muted); word-break: break-word; }
.rescard .attr-text em { font-style: italic; }
.lib-disclaimer { margin-top: 30px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper-2); color: var(--muted); font-size: 13px; line-height: 1.65; }
.lib-disclaimer .ai-mark { color: var(--amber); }
.lib-disclaimer a { color: var(--blue-700); font-weight: 600; }
.illus-badge { position: absolute; top: 14px; right: 18px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- case study cards ---------- */
.cs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cscard { background: linear-gradient(165deg, var(--blue-700), var(--blue-900)); color: #fff; border-radius: var(--rad); padding: 22px; min-height: 230px; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; }
.cscard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.cscard::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0%, rgba(247,148,30,.35), transparent 55%); opacity: .8; }
.cscard .badge { position: relative; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; align-self: flex-start; }
.cscard .badge.wb { background: rgba(255,255,255,.16); }
.cscard .badge.ext { background: var(--grad-energy); color: var(--blue-900); }
.cscard h3 { position: relative; font-size: 22px; margin-top: 16px; }
.cscard .csmeta { position: relative; font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.72); margin-top: 8px; line-height: 1.7; }
.cscard .blurb { position: relative; font-size: 13.5px; color: rgba(255,255,255,.85); margin-top: 14px; flex: 1; }
.cscard.placeholder { background: #fff; color: var(--muted); border: 1px dashed var(--line); }
.cscard.placeholder::before { display: none; }
.cscard.placeholder h3 { color: var(--blue-800); font-family: var(--mono); font-size: 14px; font-weight: 500; }
.cscard .badge.fund { background: rgba(255,255,255,.18); }
.cscard .blurb { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.cscard.open .blurb { -webkit-line-clamp: unset; }
.cscard .cs-expand { position: relative; display: flex; gap: 8px; flex-wrap: wrap; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s var(--ease), opacity .3s, margin .3s; }
.cscard.open .cs-expand { max-height: 120px; opacity: 1; margin-top: 12px; }
.cs-btn { position: relative; font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: var(--grad-energy); color: var(--blue-900); }
.cs-btn.ghost { background: rgba(255,255,255,.16); color: #fff; }
.cs-more { position: relative; align-self: flex-start; margin-top: 12px; background: none; border: 0; color: #fff; font-family: var(--sans); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; opacity: .85; }
.cs-more .chev { transition: transform .25s; display: inline-block; }
.cscard.open .cs-more .chev { transform: rotate(180deg); }

/* ---------- contributors ---------- */
.logo-wall { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.logo-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--rad-sm); height: 96px; display: grid; place-items: center; text-align: center; padding: 14px; font-weight: 600; color: var(--blue-800); font-size: 15px; transition: .3s; }
.logo-tile:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--blue-200); }
.logo-tile.has-logo { padding: 16px 18px; }
.logo-tile.has-logo img { max-width: 100%; max-height: 58px; width: auto; height: auto; object-fit: contain; }
/* per-logo size tuning (default cap is 58px tall) */
.logo-tile img[src$="seforall.webp"] { max-height: 67px; }              /* SEforALL +15% */
.logo-tile img[src$="real-programme-catalyst.webp"] { max-height: 84px; } /* REAL */
.logo-tile img[src$="nefco.webp"] { max-height: 75px; }                 /* Nefco +30% */
.logo-tile img[src$="mirova.svg"] { max-height: 67px; }                 /* Mirova +15% */
.logo-tile img[src$="sdc.webp"] { max-height: 67px; }                   /* SDC +15% */
.logo-tile img[src$="ucl.svg"] { max-height: 46px; }                    /* UCL ~20% smaller */
.logo-tile img[src$="giz.webp"] { max-height: 81px; }                   /* GIZ +40% */
.logo-tile img[src$="dalberg.svg"] { max-width: 80%; max-height: 46px; }   /* Dalberg -20% */
.logo-tile img[src$="paygops.webp"] { max-width: 80%; max-height: 46px; }  /* PaygOps -20% */

/* ---------- generic content / forms ---------- */
.prose { max-width: 720px; }
.prose p { font-size: 18px; color: #2c3759; }
.soon-hero { text-align: center; padding: 60px 0; }
.soon-hero .badge { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(247,148,30,.4); padding: 7px 16px; border-radius: 999px; margin-bottom: 22px; }
.form { max-width: 620px; background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 32px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--blue-800); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; font-family: var(--sans); font-size: 15px; background: var(--paper); }
.field textarea { min-height: 96px; resize: vertical; }

/* ---------- timeline / scrolly teaser (insights) ---------- */
.bignum-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; margin-top: 40px; }
.bignum { padding: 30px; border-radius: var(--rad); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }
.bignum .n { font-family: var(--mono); font-size: 48px; font-weight: 600; background: var(--grad-energy); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bignum p { color: rgba(255,255,255,.78); font-size: 15px; margin-top: 10px; }

/* ---------- footer ---------- */
.site-footer { background: var(--paper); color: var(--ink); padding: 64px 0 34px; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer img { height: 26px; margin-bottom: 16px; }
.site-footer p { color: var(--muted); font-size: 14.5px; max-width: 360px; }
.foot-col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.foot-col a { display: block; color: var(--blue-800); font-size: 14.5px; padding: 5px 0; transition: color .2s; }
.foot-col a:hover { color: var(--amber); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; gap: 12px; }
.foot-hosted { display: flex; gap: 28px; }
.foot-hosted span b { color: var(--blue-800); font-weight: 600; }
.foot-hosted .fh { display: flex; flex-direction: column; gap: 8px; }
.foot-hosted .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 9px 14px; transition: transform .25s ease, box-shadow .25s ease; }
.logo-chip:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(0,0,0,.45); }
.logo-chip img { height: 28px; width: auto; display: block; }
.logo-chip.sm { padding: 8px 12px; border-radius: 9px; }
.logo-chip.sm img { height: 20px; }
.foot-hosted a { text-decoration: none; }
.foot-hosted a:hover b { color: var(--amber); }
.partner-link:hover { color: var(--amber-2) !important; }

/* ---------- strawman badge ---------- */
.straw {
  position: fixed; left: 18px; bottom: 18px; z-index: 90;
  background: var(--blue-900); color: #fff; border-radius: 999px; padding: 8px 14px 8px 12px;
  font-size: 12px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.14);
}
.straw .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-energy); }
.straw b { font-weight: 600; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
[data-stagger] > * { opacity: 0; transform: translateY(20px); }
[data-stagger].in > * { animation: rise .7s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-panel-cell { position: static; }
  .map-panel { position: static; inset: auto; max-height: none; }
  .lib-layout { grid-template-columns: 1fr; }
  .filters { position: relative; top: 0; }
  .cs-grid { grid-template-columns: repeat(2,1fr); }
  .logo-wall { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 1200px) {
  .nav-links { position: fixed; inset: 76px 0 auto 0; background: var(--paper); flex-direction: column; align-items: stretch; padding: 16px; gap: 2px; border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .35s var(--ease); box-shadow: var(--shadow); }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 13px; }
  /* In the stacked mobile menu, colour is the only cue — fade the unavailable ("coming soon") items
     well below the active links so they read as clearly not-yet-clickable (matches the footer tone). */
  .nav-links a.soon { color: rgba(20,32,63,.38); }
  .nav-links a.active::after { left: 13px; right: auto; width: 18px; bottom: 6px; }
  .nav-toggle { display: block; }
}

@media (max-width: 860px) {
  .dest-grid { grid-template-columns: 1fr; }
  .statband .wrap { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .bignum-grid { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr; gap: 28px; }
  /* Library cards (blend of A + C): cover thumbnail left, type-coloured spine, then a single
     ordered content stack — type · title · author · date·tech · tags · footer. The body/right
     wrappers are flattened with display:contents so their children share one grid column and can
     be ordered freely beside the spanning cover. */
  .rescard { grid-template-columns: 72px 1fr; column-gap: 14px; row-gap: 0; padding: 16px;
             border-left: 4px solid var(--rtype, var(--blue-700)); }
  .rescard[data-type="Presentation"]  { --rtype: var(--amber); }
  .rescard[data-type="Report"]        { --rtype: var(--blue-700); }
  .rescard[data-type="Working Paper"] { --rtype: var(--blue-700); }
  .rescard[data-type="Article"]       { --rtype: #1c7c39; }
  .rescard[data-type="Case study"]    { --rtype: #c2570b; }
  .rescard[data-type="Toolkit"]       { --rtype: #7a4fb0; }
  .rescard[data-type="Evaluation"]    { --rtype: #0e7c86; }

  .rescard .cover { width: 72px; height: 96px; grid-column: 1; grid-row: 1 / span 30; align-self: start; }
  .rescard .body, .rescard .right { display: contents; }
  .rescard .body > *, .rescard .right > * { grid-column: 2; text-align: left; }   /* undo the desktop right-align */

  .rescard .rtype { display: block; order: 1; font-family: var(--mono); font-size: 9.5px;
                    letter-spacing: .13em; text-transform: uppercase; font-weight: 600; color: var(--rtype, var(--blue-700)); }
  .rescard .body h3 { order: 2; font-size: 16px; line-height: 1.25; margin: 3px 0 6px; letter-spacing: -.01em; }
  .rescard .body .sub { display: none; }                      /* subtitle hidden on phones for a cleaner card */
  .rescard .org { order: 3; font-size: 13.5px; font-weight: 700; color: var(--amber); }
  .rescard .yr  { order: 4; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
  .rescard .techfacet { display: none; }                      /* tech chips merge into the one .tags group below */
  .rescard .tags { order: 5; margin-top: 11px; }
  .rescard .tags .t.tech { display: inline-block; }           /* show tech chips inside the combined group */
  .rescard .tags .t:nth-child(n+6) { display: none; }         /* cap the combined group to ~5 chips */
  /* footer: Source / Download buttons one tap away (no expanding), Read more beneath them */
  .rescard .cardlinks { display: flex; order: 7; grid-column: 2; gap: 8px; align-items: center; flex-wrap: wrap;
                        width: 100%; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
  .rescard .cardlinks .cl { font-size: 12.5px; font-weight: 600; padding: 7px 15px; border-radius: 99px; text-decoration: none; white-space: nowrap; }
  .rescard .cardlinks .src { background: var(--paper-2); color: var(--blue-800); }
  .rescard .cardlinks .dl { background: var(--blue-700); color: #fff; }
  .rescard .readmore { order: 8; grid-column: 2; margin-left: auto; margin-top: 10px; }
  .rescard .expand { grid-column: 1 / -1; order: 9; }
  .rescard .expand .inner { grid-template-columns: 1fr; }
  .rescard .expand .cardactions { display: none; }           /* avoid duplicating the footer buttons */
  .wrap { padding: 0 22px; }
  .nav { padding: 0 22px; }
}
@media (max-width: 560px) {
  .cs-grid, .logo-wall { grid-template-columns: 1fr 1fr; }
  .statband .wrap { grid-template-columns: 1fr; }
  /* Library: fewer search suggestions, and a tidier toolbar — the count takes its own line so the
     page selector + sort sit together on the next line, with sort pushed to the right. */
  .search-prompts .prompt-chip:nth-of-type(n+4) { display: none; }
  .lib-toolbar .count { flex: 1 1 100%; }
  .lib-toolbar .sortsel { margin-left: auto; }
  /* drop the ‹ › arrows from the in-toolbar pager so the 3 numbers fit beside sort (the sliding
     window stays fully navigable by tapping; the bottom pager keeps its arrows) */
  .lib-toolbar .lib-pager.top .pg:first-child,
  .lib-toolbar .lib-pager.top .pg:last-child { display: none; }
}
@media (max-width: 860px) {
  /* Contribute banner stacks: text + (right-aligned) button on top, funder logos below, left-aligned */
  .contribute-grid { grid-template-columns: 1fr; gap: 30px; }
  .contribute-grid .contribute-cta { display: block; width: fit-content; margin-left: auto; }
  .contribute-logos { text-align: left; }
}

/* ===== Country Report page ===== */
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 26px; }
.report-countries { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-countries .rc-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.rc-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--blue-700); color: #fff; font-size: 13.5px; padding: 6px 8px 6px 14px; border-radius: 999px; }
.rc-chip .rc-x { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: 10px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.rc-chip .rc-x:hover { background: rgba(255,255,255,.34); }
.rc-add { font-family: var(--sans); font-size: 13.5px; border: 1px dashed var(--line); border-radius: 999px; padding: 8px 14px; background: #fff; color: var(--blue-700); cursor: pointer; }
.rc-add:hover { border-color: var(--blue-500); }
.rc-print { padding: 9px 18px; font-size: 13.5px; }

.rc-empty { background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 40px; text-align: center; color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 680px; }

.rc-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.rc-stat { background: var(--paper-2); border-radius: 12px; padding: 13px 20px; min-width: 92px; }
.rc-stat .n { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--blue-700); line-height: 1.1; }
.rc-stat .n .hot { color: #1c7c39; }
.rc-stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.rc-section { padding: 0; margin-top: 32px; }   /* override the global section { padding: 96px 0 } */
.rc-section h2 { font-size: 24px; margin: 6px 0 16px; display: flex; align-items: baseline; gap: 10px; }
.rc-section .rc-count { font-family: var(--mono); font-size: 15px; color: var(--amber); }
.rc-viewtoggle { margin-left: auto; align-self: center; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--blue-700); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.rc-viewtoggle:hover { border-color: var(--blue-500); background: var(--blue-100); }
.rc-none { color: var(--muted); font-size: 14.5px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 18px 20px; }
.rc-none a { color: var(--blue-700); font-weight: 600; }

.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 14px; }
.rc-prog { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; }
.rc-prog.act { border-left: 3px solid #1c7c39; }
.rc-prog.ended { border-left: 3px solid #cfc9bc; }
.rc-prog-name { font-weight: 600; font-size: 15px; line-height: 1.35; }
.rc-status { margin-top: 8px; }
.rc-prog .badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.rc-prog .badge.act { background: #e7f4ea; color: #1c7c39; }
.rc-prog .badge.end { background: var(--paper-2); color: var(--muted); }
.rc-prog .kv { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.rc-prog .kvr { display: flex; gap: 10px; line-height: 1.5; }
.rc-prog .kvr .k { flex: none; width: 90px; white-space: nowrap; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.rc-prog .kvr .v { flex: 1; min-width: 0; color: var(--ink); }
.rc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.rc-tag { font-size: 11px; background: var(--blue-100); color: var(--blue-700); padding: 2px 9px; border-radius: 99px; }
.rc-tag.region { background: var(--paper-2); color: var(--muted); }
.rc-link { display: inline-block; margin-top: 12px; margin-right: 14px; font-size: 12.5px; font-weight: 600; color: var(--blue-700); text-decoration: none; }
.rc-link:hover { text-decoration: underline; }

.rc-resgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); gap: 14px; }
.rc-res { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.rc-cover { flex: none; width: 64px; height: 86px; border-radius: 7px; overflow: hidden; background: var(--blue-100); box-shadow: var(--shadow-sm); }
.rc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(160deg,var(--blue-700),var(--blue-900)); color: #fff; font-family: var(--mono); font-size: 9px; text-align: center; padding: 6px; line-height: 1.3; }
.rc-res-body { min-width: 0; }
.rc-type { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--blue-700); font-weight: 600; }
.rc-res-title { font-weight: 600; font-size: 14px; line-height: 1.3; margin: 5px 0 4px; }
.rc-res-meta { font-size: 12.5px; color: var(--muted); }
.rc-res-links { margin-top: 4px; }
.rc-res-links .rc-link { margin-top: 6px; }

/* "Open the {country} report" button in the map's country panel */
.map-report-btn { display: block; text-align: center; margin: 0 0 16px; padding: 11px 14px; background: var(--blue-700); color: #fff; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.map-report-btn:hover { background: var(--blue-800); }

/* Library: "view country report" CTA above the results when the search matches a country */
#country-cta:empty { display: none; }
.country-cta-btn { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 11px 18px; background: var(--blue-700); color: #fff; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
.country-cta-btn:hover { background: var(--blue-800); }

/* ===== Organisation profile page ===== */
.org-head { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.org-head-top { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.org-logo { flex: none; width: 150px; height: 86px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 12px; }
.org-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.org-logo .ph { font-family: var(--mono); font-weight: 600; font-size: 26px; color: var(--blue-700); }
.org-id { flex: 1; min-width: 240px; }
.org-parent { font-size: 15px; color: var(--muted); }
.org-parent a { color: var(--blue-700); font-weight: 600; text-decoration: none; }
.org-site-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 9px 16px; border: 1px solid var(--blue-700); border-radius: 999px; color: var(--blue-700); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.org-site-btn:hover { background: var(--blue-100); }
.org-blurb { margin: 20px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.org-actions { margin-left: auto; align-self: flex-start; }
.org-pdf-btn { padding: 9px 18px; font-size: 13.5px; }
.org-map-stage { background: linear-gradient(180deg,#fff,#fbf8f2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 4px; }
.org-map-countries { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.rc-tag.role { background: #fdf1e0; color: #a05c10; }
/* org-name links on cards (map / report / library) */
.orglink { color: var(--blue-700); text-decoration: none; }
.orglink:hover { text-decoration: underline; }
/* org mini-map hover tooltip: reuses .map-tooltip, with per-program lines */
.map-tooltip { max-width: 360px; }
.map-tooltip .tipline { margin-top: 4px; font-size: 12px; line-height: 1.45; }
.map-tooltip .tipline span { opacity: .72; }

@media (max-width: 560px) { .rc-stat { flex: 1 1 40%; } }
@media print { #site-header, #site-footer, .report-bar { display: none !important; } .rc-link { color: #000; } }
