/* =========================================================
   Africa Governance Institute — shared styles
   Brand: deep olive, AGI red, ochre, gold + warm cream
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600;8..60,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand */
  --agi-red:        #B22F28;
  --agi-red-dark:   #8E1F1A;
  --agi-olive:      #5E6B27;
  --agi-olive-dark: #3F4A18;
  --agi-olive-deep: #2A3210;
  --agi-orange:     #DD8728;
  --agi-yellow:     #E8B936;

  /* Surfaces */
  --paper:    #FFFFFF;
  --cream:    #F8F2E2;
  --cream-2:  #EFE7D1;
  --cream-3:  #E5DCC0;
  --ink:      #181612;
  --ink-2:    #3A352A;
  --ink-3:    #6A6354;
  --line:     #E2D9BF;
  --line-2:   #C9BE9E;

  /* Type */
  --serif: 'Source Serif 4', 'Times New Roman', serif;
  --sans:  'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --maxw: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
}

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

/* Layout wrappers ----------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-wide { max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }

/* Eyebrow / labels ---------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--agi-red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: currentColor;
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.on-dark { color: var(--agi-yellow); }

/* Display headlines --------------------------------------- */
.h-display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
.h-section {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.h-card {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin: 0;
}
.lead {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 400;
}

/* Buttons ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn .arrow { transition: transform .3s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--agi-red);
  color: #fff;
}
.btn-primary:hover { background: var(--agi-red-dark); }
.btn-outline {
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
.btn-outline:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-outline-dark {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline-dark:hover { background: var(--ink); color: var(--cream); }
.btn-ghost {
  padding: 14px 0;
  border-bottom: 1.5px solid currentColor;
  border-radius: 0;
  color: var(--ink);
}
.btn-yellow {
  background: var(--agi-yellow);
  color: var(--ink);
}
.btn-yellow:hover { background: #d6a824; }

/* =========================================================
   Top utility bar
   ========================================================= */
.utility-bar {
  background: var(--agi-olive-deep);
  color: var(--cream);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.utility-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  gap: 24px;
}
.util-left, .util-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.util-left span { display: inline-flex; align-items: center; gap: 8px; }
.util-left svg { opacity: 0.75; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(248, 242, 226, 0.25);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.lang-switch button {
  padding: 4px 10px;
  color: var(--cream);
  opacity: 0.65;
}
.lang-switch button.active {
  background: var(--agi-yellow);
  color: var(--ink);  opacity: 1;
}
/* Translating indicator on the active FR button */
html.i18n-translating .lang-switch button.active {
  position: relative;
  pointer-events: none;
}
html.i18n-translating .lang-switch button.active::after {
  content: "";
  position: absolute;
  inset: -1px -1px -1px -1px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 2px;
  animation: agi-i18n-spin 0.8s linear infinite;
  opacity: 0.55;
}
@keyframes agi-i18n-spin { to { transform: rotate(360deg); } }
html.i18n-translating { cursor: progress; }

.util-right .socials { display: inline-flex; gap: 14px; }
.util-right .socials a { opacity: 0.75; transition: opacity .2s; }
.util-right .socials a:hover { opacity: 1; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand img {
  height: 56px;
  width: auto;
}
.brand-text {
  display: none;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--agi-red);
  line-height: 1;
  font-size: 13px;
}
.nav-primary {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-primary a {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  transition: color .2s;
}
.nav-primary a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--agi-red);
  transform: translateX(-50%);
  transition: width .3s ease;
}
.nav-primary a:hover { color: var(--agi-red); }
.nav-primary a:hover::after,
.nav-primary a.active::after { width: 22px; }
.nav-primary a.active { color: var(--agi-red); font-weight: 600; }

.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.search-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.search-btn:hover { border-color: var(--agi-red); color: var(--agi-red); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--agi-olive-deep);
  color: var(--cream);
  padding: 88px 0 0;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 60px 48px;
  padding-bottom: 64px;
}
.footer-brand img {
  height: 70px;
  filter: brightness(0) invert(1);
  margin-bottom: 22px;
}
.footer-brand p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.4;
  color: var(--cream);
  opacity: 0.9;
  max-width: 320px;
  margin: 0 0 28px;
}
.footer-h {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--agi-yellow);
  margin: 0 0 22px;
  font-weight: 500;
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.footer-list a {
  font-size: 15px;
  opacity: 0.82;
  transition: opacity .2s, color .2s;
}
.footer-list a:hover { opacity: 1; color: var(--agi-yellow); }

.newsletter-form {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
  padding: 6px;
  margin-top: 18px;
}
.newsletter-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--cream);
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
}
.newsletter-form input::placeholder { color: rgba(248, 242, 226, 0.5); }
.newsletter-form input:focus { outline: none; }
.newsletter-form button {
  background: var(--agi-yellow);
  color: var(--ink);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background .2s;
}
.newsletter-form button:hover { background: #d6a824; }
.newsletter-form .ok-msg {
  font-size: 13px;
  opacity: 0.7;
  padding: 12px 18px 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.65;
}
.footer-bottom .legal {
  display: flex; gap: 28px;
}
.footer-stripe {
  display: flex;
  height: 4px;
}
.footer-stripe span { flex: 1; }
.footer-stripe span:nth-child(1) { background: var(--agi-olive); }
.footer-stripe span:nth-child(2) { background: var(--agi-orange); }
.footer-stripe span:nth-child(3) { background: var(--agi-yellow); }
.footer-stripe span:nth-child(4) { background: var(--agi-red); }

/* =========================================================
   Utility
   ========================================================= */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .nav-primary { display: none; }
  .header-cta .search-btn { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .utility-bar { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 14px; }
}
