/* Sands Africa Foundation
   Colors come from the foundation logo: globe green, Africa gold, foundation red.
   The strata (one gold band per company) is the one bold element. */

:root {
	--dusk: #0e3b2e;      /* deep logo green: hero, footer, headings */
	--dusk-2: #175440;
	--sand-1: #f8e9b0;    /* gold strata, lightest to deepest */
	--sand-2: #f3d968;
	--sand-3: #f0c932;
	--sand-4: #d9ab1f;
	--gold: #f3cc28;      /* logo yellow */
	--red: #c92d21;       /* logo red */
	--sage: #10755a;      /* logo green: links, primary buttons */
	--sage-dark: #0b5a45;
	--paper: #f8f9f7;
	--white: #ffffff;
	--ink: #16191a;
	--muted: #535a57;
	--line: #dfe3df;

	--display: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--body: "Source Serif 4", Georgia, "Times New Roman", serif;

	--wrap: 72rem;
	--narrow: 44rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--space: clamp(3.5rem, 8vw, 6.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1.125rem;
	line-height: 1.7;
	font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; }

a { color: var(--sage); text-underline-offset: 0.18em; }
a:hover { color: var(--sage-dark); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3, h4 {
	font-family: var(--display);
	line-height: 1.15;
	margin: 0 0 0.6em;
	font-weight: 700;
	color: var(--dusk);
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2 * var(--gutter), var(--narrow)); }

.skip-link {
	position: absolute; left: -999px; top: 0.5rem;
	background: var(--white); color: var(--dusk); padding: 0.5rem 1rem; z-index: 100;
	font-family: var(--display);
}
.skip-link:focus { left: 0.5rem; }

/* ---------- Header ---------- */

.site-header { background: var(--white); color: var(--ink); position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; }
.brand-bar { height: 4px; background: linear-gradient(90deg, var(--sage) 0 34%, var(--gold) 34% 67%, var(--red) 67%); }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 52px; height: 52px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--body); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-sub { font-family: var(--body); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--red); margin-top: 0.35rem; }
.brand-logo img { max-height: 3.5rem; width: auto; display: block; }

.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 1.75rem; }
.site-nav a {
	font-family: var(--display); font-size: 0.98rem; font-weight: 500;
	color: var(--ink); text-decoration: none;
}
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--sage); text-decoration: underline; }
.site-nav .menu-cta a {
	background: var(--sage); color: var(--white); padding: 0.6rem 1.05rem; border-radius: 3px; font-weight: 600;
}
.site-nav .menu-cta a:hover { background: var(--sage-dark); color: var(--white); text-decoration: none; }

.nav-toggle {
	display: none; font: 600 0.95rem var(--display);
	background: transparent; color: var(--ink);
	border: 1px solid var(--line); border-radius: 3px; padding: 0.5rem 0.9rem; cursor: pointer;
}

@media (max-width: 960px) {
	.nav-toggle { display: inline-block; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--white); padding: 0.5rem var(--gutter) 1.5rem;
		border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
	}
	.site-nav.is-open { display: block; }
	.site-nav .menu { flex-direction: column; align-items: flex-start; gap: 0; }
	.site-nav .menu li { width: 100%; }
	.site-nav a { display: block; padding: 0.8rem 0; font-size: 1.05rem; }
	.site-nav .menu-cta { margin-top: 0.75rem; }
	.site-nav .menu-cta a { display: inline-block; padding: 0.7rem 1.1rem; }
}
@media (max-width: 420px) {
	.brand-mark { width: 44px; height: 44px; }
	.brand-name { font-size: 1.1rem; }
}

/* ---------- Buttons ---------- */

.button {
	display: inline-block; font: 600 1rem/1.2 var(--display);
	padding: 0.9rem 1.4rem; border-radius: 3px; text-decoration: none;
	border: 2px solid transparent; cursor: pointer;
}
.button-sand { background: var(--gold); color: var(--dusk); }
.button-sand:hover { background: var(--sand-1); color: var(--dusk); }
.button-ghost { border-color: rgba(255, 255, 255, .45); color: var(--white); }
.button-ghost:hover { border-color: var(--white); color: var(--white); }
.button-primary { background: var(--sage); color: var(--white); }
.button-primary:hover { background: var(--sage-dark); color: var(--white); }
.button-small { padding: 0.55rem 1rem; font-size: 0.95rem; background: var(--dusk); color: var(--white); }
.button-small:hover { background: var(--dusk-2); }

/* ---------- Hero ---------- */

.hero { background: var(--dusk); color: #e4eee9; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }

.hero-title {
	color: var(--white);
	font-stretch: 125%;
	font-weight: 750;
	font-size: clamp(2.5rem, 5.4vw, 4.6rem);
	line-height: 1.02;
	letter-spacing: -0.01em;
	margin-bottom: 1.5rem;
	max-width: 14ch;
}
.hero-text { font-size: 1.25rem; line-height: 1.65; max-width: 34em; margin: 0 0 1.25rem; color: #e4eee9; }
.hero-totals { margin: 0 0 1.75rem; color: #c9dcd3; }
.hero-totals strong { color: var(--white); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

/* ---------- Strata (contributing companies) ---------- */

.strata-title {
	font-size: 1rem; font-weight: 500; color: var(--gold);
	margin: 0 0 0.75rem;
}
.strata {
	list-style: none; margin: 0; padding: 0;
	display: flex; flex-direction: column; gap: 3px;
	min-height: clamp(22rem, 40vw, 28rem);
}
.band { flex: var(--grow, 1) 1 auto; display: flex; min-height: 2.6rem; }
.band:nth-child(4n + 1) .band-inner { background: var(--sand-1); }
.band:nth-child(4n + 2) .band-inner { background: var(--sand-2); }
.band:nth-child(4n + 3) .band-inner { background: var(--sand-3); }
.band:nth-child(4n + 4) .band-inner { background: var(--sand-4); }

.band-inner {
	flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 0.45rem 1rem; color: var(--dusk); text-decoration: none;
	transform-origin: left center;
	animation: lay-down 700ms cubic-bezier(.2, .7, .2, 1) both;
	animation-delay: calc(var(--i, 0) * 80ms + 150ms);
}
.band-name { font-family: var(--display); font-weight: 650; font-size: 1rem; line-height: 1.25; }
.band-meta { font-family: var(--display); font-size: 0.88rem; white-space: nowrap; opacity: 0.85; }
a.band-inner:hover { color: var(--dusk); }
a.band-inner:hover .band-name { text-decoration: underline; }
a.band-inner:focus-visible { outline-color: var(--white); outline-offset: -3px; }

.strata-note { font-size: 1rem; color: #c9dcd3; margin: 1rem 0 0; max-width: 32em; }
.strata-empty a { color: var(--white); }

@keyframes lay-down {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
	.band-inner { animation: none; }
}

@media (max-width: 900px) {
	.hero-grid { grid-template-columns: 1fr; }
	.strata { min-height: 0; }
}
@media (max-width: 480px) {
	.band-inner { flex-direction: column; align-items: flex-start; gap: 0.1rem; padding-block: 0.55rem; }
	.band-meta { white-space: normal; }
}

/* ---------- Sections ---------- */

.section { padding: var(--space) 0; }
.section-tint { background: var(--white); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.75rem, 3vw, 2.4rem); font-stretch: 112%; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.text-link { font-family: var(--display); font-weight: 600; }

.steps {
	list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
}
.steps li { counter-increment: step; border-top: 3px solid var(--dusk); padding-top: 1rem; }
.steps li::before {
	content: counter(step);
	display: block; font: 700 2.4rem/1 var(--display); font-stretch: 125%;
	color: var(--red); margin-bottom: 0.75rem;
}
.steps h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.steps p { margin: 0; color: var(--muted); font-size: 1.05rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.focus-list { margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.focus-item { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.focus-list dt { font: 650 1.25rem/1.3 var(--display); margin-bottom: 0.3rem; }
.focus-list dt a { color: var(--dusk); text-decoration: none; }
.focus-list dt a:hover { text-decoration: underline; }
.focus-list dd { margin: 0; color: var(--muted); }
.focus-count { display: block; margin-top: 0.35rem; font: 500 0.92rem var(--display); color: var(--sage); }
@media (max-width: 700px) { .focus-list { grid-template-columns: 1fr; } }

/* ---------- Grants table ---------- */

.table-scroll { overflow-x: auto; margin-top: 1.5rem; -webkit-overflow-scrolling: touch; }
.grants { width: 100%; border-collapse: collapse; min-width: 44rem; font-size: 1rem; }
.grants th {
	font: 600 0.9rem var(--display); color: var(--muted); text-align: left;
	padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--dusk);
}
.grants td { padding: 0.9rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grants td:first-child { font-family: var(--display); font-weight: 600; color: var(--dusk); }
.grants .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grants tbody tr:hover { background: var(--white); }

.empty { color: var(--muted); margin-top: 1.5rem; }

/* ---------- News ---------- */

.news-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 1.5rem; }
.news-list-stacked { grid-template-columns: 1fr; }
.news-item h3, .news-item h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.news-item h3 a, .news-item h2 a { color: var(--dusk); text-decoration: none; }
.news-item h3 a:hover, .news-item h2 a:hover { text-decoration: underline; }
.news-item p { margin: 0; color: var(--muted); }
.news-date { font: 500 0.9rem var(--display); color: var(--sage) !important; margin-bottom: 0.4rem !important; }
@media (max-width: 800px) { .news-list { grid-template-columns: 1fr; } }

/* ---------- Request band ---------- */

.request-band { background: var(--sage); color: var(--white); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.request-band .section-title { color: var(--white); }
.request-band p { margin: 0; max-width: 36em; }
.request-grid { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }

/* ---------- Inner pages ---------- */

.page-head { background: var(--white); border-bottom: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); }
.page-title { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-stretch: 118%; margin-bottom: 0.5rem; }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0; max-width: 38em; }
.crumb { font: 500 0.95rem var(--display); margin: 0 0 0.75rem; color: var(--muted); }
.page-body { padding: clamp(2rem, 5vw, 3.5rem) 0 var(--space); }

.entry > * { max-width: 40em; }
.entry h2 { font-size: 1.6rem; margin-top: 2em; }
.entry h3 { font-size: 1.3rem; margin-top: 1.6em; }
.entry blockquote { margin: 1.5em 0; padding-left: 1.25rem; border-left: 3px solid var(--gold); font-style: italic; }

.grant-facts { margin: 0 0 2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.grant-facts > div { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.grant-facts dt { font: 500 0.9rem var(--display); color: var(--muted); }
.grant-facts dd { margin: 0.15rem 0 0; font: 600 1.1rem var(--display); color: var(--dusk); }
@media (max-width: 560px) { .grant-facts { grid-template-columns: 1fr; } }
.grant-photo { margin: 0 0 2rem; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; font-family: var(--display); font-size: 0.95rem; }
.filters select { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid #b6bbca; border-radius: 3px; background: var(--white); }

.nav-links { display: flex; gap: 0.5rem; margin-top: 2rem; font-family: var(--display); }
.nav-links .page-numbers { padding: 0.4rem 0.75rem; border: 1px solid var(--line); text-decoration: none; }
.nav-links .current { background: var(--dusk); color: var(--white); border-color: var(--dusk); }

/* ---------- Form ---------- */

.request-form-wrap { scroll-margin-top: 2rem; }
.request-form { margin-top: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field { margin: 0 0 1.25rem; }
.field label { display: block; font: 600 0.95rem var(--display); color: var(--dusk); margin-bottom: 0.35rem; }
.req { color: var(--red); }
.field input, .field select, .field textarea {
	width: 100%; font: 1rem/1.5 var(--body); color: var(--ink);
	padding: 0.7rem 0.8rem; background: var(--white);
	border: 1px solid #b6bbca; border-radius: 3px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(47, 107, 87, .35); border-color: var(--sage); }
.form-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.form-hint { font-size: 0.95rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 1rem 1.25rem; border-radius: 3px; margin-bottom: 1.5rem; }
.notice p { margin: 0; }
.notice-ok { background: #e6f1ec; border-left: 4px solid var(--sage); }
.notice-error { background: #fbeaea; border-left: 4px solid #9b2c2c; }

/* ---------- Footer ---------- */

.site-footer { background: var(--dusk); color: #e4eee9; padding: 3.5rem 0 1.5rem; font-size: 1rem; }
.site-footer a { color: #e4eee9; }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; font: 600 1.15rem var(--body); letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 0.9rem !important; color: var(--white); }
.footer-mark { width: 56px; height: 56px; flex: none; }
.footer-status { color: #c9dcd3; margin: 0; max-width: 28em; }
.footer-heading { font-size: 1rem; color: var(--gold); font-weight: 500; margin-bottom: 0.75rem; }
.site-footer p, .site-footer address { margin: 0 0 0.5rem; font-style: normal; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin-bottom: 0.5rem; }
.footer-base { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--dusk-2); color: #a9c4b8; font-size: 0.92rem; }
.footer-base p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Core alignment classes */
.alignwide { max-width: 60rem; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); max-width: none; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
