/* ==========================================================================
   AFRIS — site styles
   All colours, fonts and spacing are defined once here as variables.
   ========================================================================== */

:root {
  /* Colours */
  --ink: #0d1a2b;          /* deepest navy, main text and dark sections */
  --navy: #142a47;         /* secondary dark */
  --navy-soft: #1f3a5f;
  --sand: #c8a96a;         /* accent: use on dark backgrounds */
  --sand-light: #efe6d2;
  --gold-text: #7f6128;    /* accent for text on light backgrounds (AA contrast) */
  --paper: #faf8f4;        /* warm off-white section background */
  --white: #ffffff;
  --line: #e3ddd1;
  --muted: #4b5563;        /* secondary text on light (AA) */
  --muted-dark: #c3cad6;   /* secondary text on dark (AA) */

  /* Type */
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Spacing and layout */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --container: 72rem;
  --radius: 4px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 var(--space-2); }
a { color: var(--navy-soft); text-underline-offset: 3px; }
a:hover { color: var(--gold-text); }
:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }
ul { padding-left: 1.2rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-3); }
.narrow { max-width: 46rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--white); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 4.5rem; }

/* Logo: replace the contents of .logo with <img src="assets/img/logo.svg" alt="AFRIS"> when the real logo is ready */
.logo { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.logo-mark {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 1.5px solid var(--ink); font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.14em; }
.logo-tag { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.logo:hover { color: var(--ink); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; font: inherit; font-size: 0.9rem; color: var(--ink); cursor: pointer;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem; }
.main-nav a {
  display: block; padding: 0.5rem 0.55rem; font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--gold-text); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--sand); }
.main-nav .nav-cta a { margin-left: 0.5rem; }

.site-header .logo-tag { max-width: 15rem; }
@media (max-width: 1220px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: var(--space-2) var(--space-3) var(--space-3); gap: 0; }
  .main-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--gold-text); }
  .main-nav .nav-cta a { margin: var(--space-2) 0 0; text-align: center; border: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1.5px solid transparent;
  cursor: pointer; font-family: inherit; line-height: 1.3;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--navy-soft); color: var(--white); }
.btn-accent { background: var(--sand); color: var(--ink); }
.btn-accent:hover { background: var(--sand-light); color: var(--ink); }
.btn-outline-light { border-color: rgba(255,255,255,0.6); color: var(--white); }
.btn-outline-light:hover { border-color: var(--white); background: rgba(255,255,255,0.08); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.main-nav .btn-primary { color: var(--white); padding: 0.6rem 1.1rem; }

/* ---------- Sections ---------- */
.section { padding: var(--space-6) 0; }
@media (max-width: 700px) {
  .section, .cta-band { padding: var(--space-5) 0; }
  .split { gap: var(--space-3); }
  .section-head { margin-bottom: var(--space-4); }
}
.section-paper { background: var(--paper); }
.section-dark { background: var(--ink); color: var(--white); }
.section-dark a { color: var(--sand); }
.section-dark p, .section-dark li { color: var(--muted-dark); }

.eyebrow {
  display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold-text); margin-bottom: var(--space-2);
}
.section-dark .eyebrow, .hero .eyebrow, .page-hero .eyebrow { color: var(--sand); }
.section-head { max-width: 44rem; margin-bottom: var(--space-5); }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-dark .section-head p { color: var(--muted-dark); }
.rule { width: 3rem; height: 2px; background: var(--sand); border: 0; margin: 0 0 var(--space-3); }

/* ---------- Hero ---------- */
.hero {
  background: var(--ink); color: var(--white);
  padding: clamp(4rem, 11vw, 8rem) 0;
  background-image: linear-gradient(120deg, var(--ink) 55%, var(--navy) 100%);
}
.hero h1 { max-width: 16ch; }
.hero .lead { max-width: 40rem; font-size: 1.2rem; color: var(--muted-dark); }
.page-hero { background: var(--ink); color: var(--white); padding: clamp(3rem, 8vw, 5.5rem) 0; }
.page-hero p { color: var(--muted-dark); font-size: 1.15rem; max-width: 42rem; margin: 0; }

/* ---------- Grids and cards ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid > *, .split > * { min-width: 0; }
.split { display: grid; gap: var(--space-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--sand);
  padding: var(--space-4); border-radius: var(--radius); display: flex; flex-direction: column;
}
.card h3 { margin-bottom: var(--space-1); }
.card p { color: var(--muted); }
.card ul { color: var(--muted); margin: 0; font-size: 0.97rem; }
.card .card-link { margin-top: auto; padding-top: var(--space-2); font-weight: 600; font-size: 0.95rem; }
.section-dark .card { background: var(--navy); border-color: var(--navy-soft); border-top-color: var(--sand); }
.section-dark .card h3 { color: var(--white); }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* Methodology steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--sand); padding-top: var(--space-2); }
.steps li::before { content: "0" counter(step); display: block; font-family: var(--font-serif); font-size: 1.6rem; color: var(--sand); margin-bottom: 0.25rem; }
.steps h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.steps p { font-size: 0.95rem; margin: 0; }

/* Audience tags */
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags li { border: 1px solid var(--line); background: var(--white); padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.95rem; }

/* Notice / empty state */
.notice { border: 1px dashed var(--line); background: var(--paper); padding: var(--space-4); border-radius: var(--radius); color: var(--muted); }
.notice strong { color: var(--ink); }
.draft-banner { background: var(--sand-light); border-left: 4px solid var(--sand); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }

/* ---------- Map ---------- */
.map-wrap { width: 100%; max-width: 30rem; margin: 0 auto; }
.map-wrap svg { display: block; width: 100%; }
@media (max-width: 480px) { .site-header .logo-tag { display: none; } }
.legend { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: 0.6rem; }
.legend li { display: flex; align-items: center; gap: 0.75rem; }
.swatch { width: 1.1rem; height: 1.1rem; flex: none; border: 1px solid rgba(0,0,0,0.15); }
.swatch-primary { background: #b88d3e; }
.swatch-regional { background: #e6d3a8; }
.swatch-future { background: repeating-linear-gradient(45deg, #dfe3ea 0 3px, #b8c0cc 3px 5px); }
.swatch-base { background: #eef0f3; }
.map-note { font-size: 0.85rem; color: var(--muted); margin-top: var(--space-2); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); color: var(--white); padding: var(--space-6) 0; }
.cta-band .inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cta-band h2 { margin: 0 0 var(--space-1); }
.cta-band p { margin: 0; color: var(--muted-dark); max-width: 38rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-serif); font-size: 1rem; background: var(--paper); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-3); }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 0.7rem 0.8rem;
  border: 1px solid #9aa3af; border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--sand); outline-offset: 1px; border-color: var(--ink); }
.field-row { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 0.35rem; width: 1.05rem; height: 1.05rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: var(--space-2) var(--space-3); border-radius: var(--radius); }
.form-status.ok { background: #e7f3ec; color: #14532d; border: 1px solid #a7d3b6; }
.form-status.err { background: #fbeaea; color: #7f1d1d; border: 1px solid #e7b4b4; }

/* Contact details */
.details { margin: 0; display: grid; gap: var(--space-2); }
.details dt { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); }
.details dd { margin: 0; }
.tbc { color: var(--muted); font-style: italic; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--muted-dark); padding: var(--space-6) 0 var(--space-4); font-size: 0.95rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--sand); text-decoration: underline; }
.footer-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-footer h2 { font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); margin-bottom: var(--space-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer .logo { color: var(--white); margin-bottom: var(--space-2); }
.site-footer .logo-mark { border-color: var(--white); }
.site-footer .logo-tag { color: var(--muted-dark); }
.site-footer .tbc { color: var(--muted-dark); }
.site-footer .details dt { color: var(--sand); }
.footer-bottom { border-top: 1px solid var(--navy-soft); margin-top: var(--space-5); padding-top: var(--space-3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: 0.85rem; }
.footer-bottom ul { display: flex; gap: var(--space-3); }

/* ---------- Prose (long-form pages) ---------- */
.prose h2 { margin-top: var(--space-5); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--space-4); }
.prose p, .prose li { color: #283240; }
.anchor-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; margin: 0; font-size: 0.95rem; font-weight: 600; }
.anchor-nav a { text-decoration: none; }
[id] { scroll-margin-top: 6rem; }
