/*
 * Onward Africa, public website.
 *
 * Editorial, not operational. The application behind the client login is a
 * different surface with its own stylesheet.
 *
 * The system in one paragraph: a wide measured grid on white and charcoal,
 * Noto Serif set large and tight for anything that carries an argument, a
 * neutral sans for everything functional, hairlines instead of boxes, and one
 * accent green used four or five times a page so it still means something. No
 * photography: the only image is an original drawing made from the logo's
 * geometry.
 */

:root {
  /* Brand, as recorded from the supplied proposal. */
  --green: #00b62a;
  --red: #f21818;
  --charcoal: #171918;

  /* Accessible derivatives. */
  --green-text: #00701c;
  --green-btn: #007a1c;
  --green-btn-hover: #00921f;

  /* Neutrals, biased a shade green so they read as chosen. */
  --paper: #ffffff;
  --paper-2: #f4f6f4;
  --ink: #141815;
  --ink-2: #3d443f;
  --ink-3: #656d68;
  --hairline: #d9ded9;
  --hairline-soft: #e8ebe8;

  /* On charcoal. */
  --on-dark: #f6f7f6;
  --on-dark-2: #c3c9c4;
  --on-dark-3: #8d948f;
  --hairline-dark: #343935;

  --display: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --section-y: clamp(4rem, 8vw, 8.5rem);
  --shell: 1320px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 6rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.028em;
  line-height: 1.04;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h4 {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 0.5em;
}
.display { font-size: clamp(2.9rem, 1.9rem + 4.6vw, 5.6rem); line-height: 0.98; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.4rem, 1.8rem + 2.6vw, 4.1rem); }
h2 { font-size: clamp(1.85rem, 1.45rem + 1.7vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.7rem); line-height: 1.15; }

p { margin: 0 0 1.15em; }
p, li { max-width: var(--measure); }
.lead {
  font-size: clamp(1.18rem, 1.06rem + 0.55vw, 1.55rem);
  line-height: 1.42;
  letter-spacing: -0.011em;
  color: var(--ink-2);
  max-width: 46ch;
}
.lead-wide { max-width: 62ch; }

a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-btn-hover); }
:focus-visible { outline: 2px solid var(--green-btn); outline-offset: 3px; border-radius: 1px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sans);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-text);
  margin: 0 0 1.35rem;
  max-width: none;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--green); flex: none; }
.eyebrow-light { color: var(--green); }

.muted { color: var(--ink-3); }
.small { font-size: 0.95rem; }
.tiny { font-size: 0.85rem; }
.strong { font-weight: 650; }
.measure { max-width: var(--measure); }

/* ---------- structure ---------- */

.wrap { width: min(var(--shell), 100%); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: min(820px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(2.5rem, 4.5vw, 4rem); }
.section-form { padding-block: clamp(2.75rem, 5vw, 5rem) var(--section-y); }
.section-alt { background: var(--paper-2); }
.stack > * + * { margin-top: 1.15rem; }

/* The editorial row: a heading column and a substance column. The heading
   column always carries something, so no column is ever left empty. */
.row-split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 5rem);
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  align-items: start;
}
.row-split-even {
  display: grid;
  gap: clamp(1.75rem, 4vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .row-split, .row-split-even { grid-template-columns: 1fr; gap: 1.5rem; } }

.quad { display: grid; gap: clamp(1.75rem, 3.5vw, 3.25rem) clamp(2rem, 5vw, 5rem); grid-template-columns: 1fr; }
@media (min-width: 760px) { .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quad p { max-width: 52ch; }
.trio { display: grid; gap: clamp(1.75rem, 3.5vw, 3.25rem); grid-template-columns: repeat(auto-fit, minmax(min(275px, 100%), 1fr)); }
.duo { display: grid; gap: clamp(1.5rem, 3vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.actions { display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; }

.rule { border: 0; border-top: 1px solid var(--hairline); margin: 0; }
.rule-green { border: 0; border-top: 2px solid var(--green); width: 48px; margin: 1.5rem 0; }

/* ---------- brand marks ---------- */

.brandbar {
  height: 4px;
  background: linear-gradient(to right, var(--green) 0 33.3%, var(--charcoal) 33.3% 66.6%, var(--red) 66.6% 100%);
}

.logo { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.logo .wordmark {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.1;
}
.logo .descriptor {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.28rem;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 1.1rem; }
.site-nav ul { display: flex; gap: clamp(1.25rem, 2.4vw, 2.4rem); list-style: none; margin: 0; padding: 0; align-items: center; }
.site-nav li { max-width: none; }
.site-nav a {
  position: relative;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.97rem;
  font-weight: 500;
  padding-block: 0.4rem;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav .quiet { color: var(--ink-3); font-size: 0.9rem; font-weight: 400; }
.site-nav .quiet::after { display: none; }
.site-nav .quiet:hover { color: var(--green-text); text-decoration: underline; }

@media (max-width: 800px) {
  .site-header { position: static; }
  .site-nav { flex-wrap: wrap; gap: 0.65rem 1rem; }
  .site-nav ul { gap: 0.9rem 1.15rem; flex-wrap: wrap; }
  .logo .descriptor { display: none; }
}

/* ---------- dark bands ---------- */

.band {
  background-color: var(--charcoal);
  background-image: var(--band-image, none);
  background-size: cover;
  background-position: center;
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
}
/* Raise --band-scrim to 1 when a photograph is set, so type keeps its contrast. */
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, rgba(12, 14, 12, 0.94) 0%, rgba(12, 14, 12, 0.78) 55%, rgba(12, 14, 12, 0.6) 100%);
  opacity: var(--band-scrim, 0);
  pointer-events: none;
}
.band > * { position: relative; z-index: 1; }
.band h1, .band h2, .band h3, .band h4 { color: #fff; }
.band p { color: var(--on-dark-2); }
.band .lead { color: var(--on-dark); }
.band a { color: #74dc8c; }
.band .muted { color: var(--on-dark-3); }
.band .rule { border-top-color: var(--hairline-dark); }

/* The one graphic device, drawn from the logo's own geometry. */
.band-motif::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -6%;
  width: min(72vw, 880px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: url("../img/site/motif.6159ff998d3b.svg") center / contain no-repeat;
  opacity: 0.9;
  pointer-events: none;
}
@media (max-width: 900px) {
  .band-motif::before { top: auto; bottom: -18%; right: -30%; width: 620px; transform: none; opacity: 0.55; }
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(4.5rem, 10vw, 9.5rem) clamp(3rem, 6vw, 5rem); }
.hero .display { margin-bottom: 0.45em; max-width: 16ch; }
.hero .lead { max-width: 44ch; }
.hero-actions { display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; margin-top: 2.5rem; }

.page-hero { padding-block: clamp(3.25rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4.5rem); }
.page-hero h1 { max-width: 17ch; margin-bottom: 0.4em; }

/* A rail of short statements along the bottom of a dark band. */
.rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  border-top: 1px solid var(--hairline-dark);
}
.rail > div { padding: clamp(1.5rem, 2.5vw, 2.25rem) clamp(1.25rem, 2.5vw, 2.25rem); border-right: 1px solid var(--hairline-dark); }
.rail > div:first-child { padding-left: 0; }
.rail > div:last-child { border-right: 0; }
.rail h4 { color: #fff; font-size: 1.04rem; margin-bottom: 0.45rem; }
.rail p { font-size: 0.98rem; color: var(--on-dark-2); margin: 0; max-width: 34ch; }
@media (max-width: 700px) {
  .rail > div { border-right: 0; border-bottom: 1px solid var(--hairline-dark); padding-inline: 0; }
  .rail > div:last-child { border-bottom: 0; }
}

/* ---------- buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 1rem 1.85rem;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-btn); color: #fff; }
.btn-primary:hover { background: var(--green-btn-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.band .btn-primary { background: #fff; color: var(--charcoal); }
.band .btn-primary:hover { background: var(--green); color: #0f130f; }
.band .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.band .btn-secondary:hover { border-color: #fff; }

.textlink {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--green);
  padding-bottom: 3px;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.textlink::after { content: "\2192"; transition: transform 0.16s ease; }
.textlink:hover { color: var(--green-text); border-bottom-color: var(--green-text); }
.textlink:hover::after { transform: translateX(3px); }
.band .textlink { color: #fff; }
.band .textlink:hover { color: var(--green); border-bottom-color: var(--green); }

/* ---------- editorial entries ---------- */

.entries { border-top: 1px solid var(--hairline); }
.entry {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1rem, 4vw, 4rem);
  padding: clamp(1.85rem, 3vw, 2.6rem) 0;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}
.entry h3 { margin-bottom: 0.3rem; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry:hover h3 a { color: var(--green-text); }
.entry .entry-lead { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 0.75rem; }
.entry .entry-note { color: var(--ink-3); font-size: 0.97rem; margin: 0; }
.entry p:last-child { margin-bottom: 0; }
.entry .meta { font-size: 0.88rem; color: var(--ink-3); letter-spacing: 0.02em; margin: 0; }
.entry .textlink { margin-top: 1rem; }
@media (max-width: 900px) { .entry { grid-template-columns: 1fr; gap: 0.75rem; } }

.band .entries { border-top-color: var(--hairline-dark); }
.band .entry { border-bottom-color: var(--hairline-dark); }
.band .entry h3 a { color: #fff; }
.band .entry:hover h3 a { color: var(--green); }

.plainlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.plainlist li { padding-left: 1.35rem; position: relative; color: var(--ink-2); max-width: 46ch; }
.plainlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 9px;
  height: 2px;
  background: var(--green);
}
.plainlist a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.plainlist a:hover { color: var(--green-text); border-bottom-color: var(--green); }
.band .plainlist li { color: var(--on-dark-2); }
.band .plainlist a { color: #fff; border-bottom-color: var(--hairline-dark); }

.pullquote {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 0;
  max-width: 20ch;
}
.pullquote::before { content: ""; display: block; width: 48px; height: 2px; background: var(--green); margin-bottom: 1.5rem; }

/* ---------- forms ---------- */

label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.4rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="password"], input[type="search"], select, textarea {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea { resize: vertical; min-height: 9rem; }
input:focus, select:focus, textarea:focus {
  border-color: var(--green-btn);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 122, 28, 0.16);
}
.field { margin-bottom: 1.35rem; }
.field .help { font-size: 0.88rem; color: var(--ink-3); margin-top: 0.4rem; font-weight: 400; }
.errorlist { color: #a3120f; font-size: 0.9rem; list-style: none; padding: 0; margin: 0.4rem 0 0; }
.form-grid { display: grid; gap: 0 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.messages li { padding: 0.95rem 1.2rem; border-left: 2px solid var(--green); background: var(--paper-2); font-size: 0.97rem; max-width: none; }
.messages .error { border-left-color: #a3120f; }

/* ---------- odds and ends ---------- */

.panel { background: var(--paper-2); padding: clamp(1.5rem, 3vw, 2.5rem); }
.panel h3 { margin-top: 0; }
.note { border-left: 2px solid var(--green); background: var(--paper-2); padding: 1.2rem 1.5rem; font-size: 0.97rem; max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }
.note-neutral { border-left-color: var(--hairline); }
.note-warn { border-left-color: #a3120f; }
.panel-pale { background: #edf5ef; }
.panel-grey { background: var(--paper-2); }
.empty { padding: 3rem 0; color: var(--ink-3); border-top: 1px solid var(--hairline); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.75rem; margin: 0; font-size: 0.97rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.prose > * { max-width: var(--measure); }
.prose h2 { margin-top: 2.75rem; }
.prose h3 { margin-top: 2rem; }
.prose h4 { margin-top: 1.75rem; color: var(--ink-3); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--charcoal); color: #fff; padding: 0.75rem 1.2rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- footer ---------- */

.site-footer { background: var(--charcoal); color: var(--on-dark-2); padding-block: clamp(3.5rem, 6vw, 5rem) 2.5rem; }
.site-footer .logo .wordmark { color: #fff; }
.site-footer h4 { color: #fff; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1.15rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.site-footer li { max-width: none; }
.site-footer a { color: var(--on-dark-2); text-decoration: none; font-size: 0.96rem; }
.site-footer a:hover { color: #fff; }
.site-footer .rule { border-top-color: var(--hairline-dark); margin-block: clamp(2.5rem, 4vw, 3.5rem) 1.75rem; }
.site-footer .colophon { color: var(--on-dark-3); font-size: 0.86rem; max-width: 74ch; }
.footer-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); } }
