/* Al-Sumait — "Africa: The Forgotten Continent" (page 162).
 * Page-scoped layer. Every colour and space comes from the Ollie tokens.
 *
 * v1.2.0 — the redesign: cinematic opener, the real continent, a counted stage.
 * CSS renders the finished state; JS is what hides things before it animates
 * them. Nothing here can leave content invisible on its own.
 */

/* ---------- 0 · the opener ---------- */
.dsc-hero {
	position: relative;
	overflow: hidden;
}
/* A scrim under the copy: the photograph is bright on the left where the text
 * sits, and the cover's flat dim alone does not carry white type. */
.dsc-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(
			to top,
			color-mix(in srgb, var(--wp--preset--color--main) 70%, transparent) 0%,
			transparent 26%
		),
		linear-gradient(
			100deg,
			color-mix(in srgb, var(--wp--preset--color--main) 88%, transparent) 0%,
			color-mix(in srgb, var(--wp--preset--color--main) 74%, transparent) 32%,
			color-mix(in srgb, var(--wp--preset--color--main) 24%, transparent) 66%,
			transparent 100%
		);
}
.dsc-hero .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
	width: 100%;
}
.dsc-hero .dsc-hero-text {
	position: relative;
	z-index: 0;
}
.dsc-hero .dsc-hero-text > *:not(.dsc-hero-mark) {
	position: relative;
	z-index: 1;
}
.dsc-hero .dsc-hero-mark {
	position: absolute;
	z-index: -1;
	top: 50%;
	right: -0.06em;
	left: auto;
	margin: 0;
	opacity: 0.1;
	font-family: var(--dsc-serif);
	font-size: clamp(11rem, 24vw, 22rem);
	line-height: 0.8;
	letter-spacing: -0.05em;
	pointer-events: none;
	user-select: none;
}
.dsc-hero .dsc-h-eyebrow {
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-weight: 600;
	margin: 0 0 var(--wp--preset--spacing--small);
}
/* No preset font-size class on the h1: WordPress emits those with !important,
 * which would win over the fluid scale this opener needs. */
.dsc-hero .dsc-h-title {
	font-family: var(--dsc-serif);
	font-weight: 400;
	font-size: clamp(2.9rem, 7.4vw, 6.4rem);
	line-height: 0.94;
	letter-spacing: -0.018em;
	margin: 0;
	max-width: 15ch;
}
.dsc-hero .dsc-line {
	display: block;
	overflow: hidden;
	padding-bottom: 0.06em;
}
.dsc-hero .dsc-hw {
	display: inline-block;
}
.dsc-hero .dsc-h-lede {
	margin: var(--wp--preset--spacing--medium) 0 0;
	max-width: 34ch;
	line-height: 1.45;
}
.dsc-hero .dsc-h-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 1.4rem;
	margin: var(--wp--preset--spacing--large) 0 0;
	padding: var(--wp--preset--spacing--small) 0 0;
	border-top: 1px solid var(--wp--preset--color--border-dark);
	max-width: 46rem;
	letter-spacing: 0.06em;
}
.dsc-hero .dsc-readlink {
	margin: var(--wp--preset--spacing--medium) 0 0;
	font-weight: 600;
	letter-spacing: 0.04em;
}
.dsc-hero .dsc-readlink a {
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 0.15em;
}
.dsc-hero .dsc-hero-credit {
	margin: var(--wp--preset--spacing--x-large) 0 0;
	max-width: 40ch;
	line-height: 1.5;
	opacity: 0.75;
}

/* ---------- 1 · the continent ---------- */
.dsc-map {
	position: relative;
}
.dsc-map .dsc-map-svg {
	display: block;
	width: 100%;
	max-width: 40rem;
	height: auto;
	margin-inline: auto;
	overflow: visible;
}
.dsc-map .dsc-map-fill {
	fill: var(--wp--preset--color--primary);
	fill-rule: evenodd;
	opacity: 0.9;
}
.dsc-map .dsc-map-line {
	fill: none;
	stroke: var(--wp--preset--color--main-accent);
	stroke-width: 1.1;
	stroke-linejoin: round;
	stroke-linecap: round;
}
.dsc-map .dsc-map-malawi {
	fill: var(--wp--preset--color--primary-alt);
	stroke: var(--wp--preset--color--base);
	stroke-width: 0.8;
}
.dsc-map .dsc-map-journey {
	fill: none;
	stroke: var(--wp--preset--color--primary-alt);
	stroke-width: 1.6;
	stroke-linecap: round;
}
.dsc-map .dsc-map-origin {
	fill: var(--wp--preset--color--primary-alt);
}
.dsc-map .dsc-map-ring {
	fill: none;
	stroke: var(--wp--preset--color--primary-alt);
	stroke-width: 1.6;
	opacity: 0.5;
}
.dsc-map .dsc-map-leader {
	fill: none;
	stroke: var(--wp--preset--color--primary-alt);
	stroke-width: 1.2;
}
.dsc-map .dsc-map-label {
	fill: var(--wp--preset--color--base);
	font-family: var(--dsc-serif);
	font-size: 27px;
}
.dsc-map .dsc-map-sub {
	fill: var(--wp--preset--color--primary-alt);
	font-size: 13px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* .dsc-live (the transient will-change hint) is defined in chapter.css. */

/* ---------- 2 · the seven reasons ---------- */
.dsc-reasons {
	overflow: hidden;
}
.dsc-reasons-pin {
	position: relative;
}
/* A pinned section must fit the viewport it is pinned to, so the stage sets
 * its own vertical rhythm rather than inheriting the section's padding. */
@media (min-width: 782px) {
	.dsc-reasons-pin {
		min-height: 100vh;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding-top: var(--wp--preset--spacing--large);
		padding-bottom: var(--wp--preset--spacing--large);
	}
}
/* The stage is measured in viewport height, not in fixed rem: a pinned section
 * has exactly one screen to live in, and a 768px laptop has to hold the same
 * seven rows a 1080px monitor does. */
/* !important throughout: the section's padding is an inline style from the
 * block, and WordPress emits its preset font-size classes with !important.
 * Neither can be beaten by specificity alone. */
@media (min-width: 782px) {
	.dsc-reasons-pin {
		padding-top: clamp(1rem, 3.5vh, 3rem) !important;
		padding-bottom: clamp(1rem, 3.5vh, 3rem) !important;
	}
	.dsc-reasons-pin .wp-block-heading {
		font-size: clamp(1.25rem, 3.1vh, 2.1rem) !important;
		line-height: 1.12;
	}
	.dsc-reasons-pin .wp-block-spacer {
		height: clamp(0.5rem, 1.6vh, 1.75rem) !important;
	}
	.dsc-reasons-pin .dsc-reason-list {
		margin-top: clamp(0.5rem, 2vh, 1.5rem) !important;
	}
	.dsc-reason {
		padding: clamp(0.18rem, 0.7vh, 0.5rem) 0;
	}
	.dsc-reason .dsc-reason-n {
		font-size: clamp(1.25rem, 2.5vh, 1.9rem) !important;
	}
	.dsc-reason .dsc-reason-t {
		font-size: clamp(0.88rem, 1.85vh, 1.14rem) !important;
	}
	.dsc-reason .dsc-reason-d {
		font-size: clamp(0.72rem, 1.3vh, 0.87rem) !important;
	}
}
.dsc-reason-count {
	position: absolute;
	top: var(--wp--preset--spacing--large);
	right: 0;
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 0.12em;
	font-family: var(--dsc-serif);
	font-size: clamp(2.4rem, 5vw, 4.2rem);
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--main-accent);
	pointer-events: none;
}
.dsc-reason-count .dsc-rc-now {
	display: inline-block;
	color: var(--wp--preset--color--primary-alt);
}
.dsc-reason-count .dsc-rc-sep,
.dsc-reason-count .dsc-rc-all {
	opacity: 0.4;
	font-size: 0.55em;
}
@media (max-width: 781px) {
	.dsc-reason-count {
		display: none;
	}
}
.dsc-reason-list > * + * {
	margin-block-start: 0;
}
.dsc-reason {
	display: grid;
	grid-template-columns: 4.4rem minmax(0, 1fr);
	column-gap: var(--wp--preset--spacing--medium);
	row-gap: 0.2rem;
	align-items: start;
	padding: 0.5rem 0;
	border-top: 1px solid var(--wp--preset--color--border-dark);
}
.dsc-reason:last-child {
	border-bottom: 1px solid var(--wp--preset--color--border-dark);
}
.dsc-reason .dsc-reason-n {
	grid-row: 1 / 3;
	margin: 0;
	font-family: var(--dsc-serif);
	font-size: 1.9rem;
	line-height: 1;
	color: var(--wp--preset--color--primary-alt);
	font-variant-numeric: tabular-nums;
}
.dsc-reason .dsc-reason-t {
	margin: 0;
	font-size: 1.14rem;
	font-family: var(--dsc-serif);
	font-weight: 400;
	line-height: 1.15;
}
.dsc-reason .dsc-reason-d {
	margin: 0;
	font-size: 0.87rem;
	line-height: 1.35;
	color: var(--wp--preset--color--main-accent);
}

/* ---------- 3 · the thunderbolt ---------- */
.dsc-thunder {
	border: 0;
	padding: 0;
	margin: 0 auto;
	max-width: 56rem;
	text-align: center;
}
.dsc-thunder p {
	margin: 0;
	font-family: var(--dsc-serif);
	line-height: 1.24;
	font-style: normal;
}
.dsc-thunder p + p {
	margin-top: var(--wp--preset--spacing--medium);
}
.dsc-thunder .dsc-tline {
	display: block;
}
.dsc-thunder .dsc-word {
	display: inline-block;
}
.dsc-thunder cite {
	display: block;
	margin-top: var(--wp--preset--spacing--medium);
	font-family: inherit;
	font-style: normal;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--primary);
}

/* ---------- 4 · life expectancy bars ---------- */
.dsc-life-row {
	display: grid;
	grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr) 5.5rem;
	align-items: center;
	column-gap: var(--wp--preset--spacing--medium);
	padding: var(--wp--preset--spacing--x-small) 0;
}
.dsc-life-row .dsc-life-label {
	margin: 0;
	line-height: 1.3;
}
.dsc-life-row .dsc-track {
	display: flex;
	align-items: center;
	height: 0.85rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--secondary) 22%, transparent);
	overflow: hidden;
	padding: 0;
}
.dsc-life-row .dsc-bar {
	height: 100%;
	border-radius: 999px;
	transform-origin: left center;
	padding: 0;
	min-height: 0.85rem;
}
.dsc-bar--low {
	width: 67%;
	background: var(--wp--preset--color--primary-alt);
}
.dsc-bar--high {
	width: 100%;
	background: var(--wp--preset--color--primary);
}
.dsc-life-row .dsc-life-val {
	margin: 0;
	text-align: right;
	font-family: var(--dsc-serif);
	font-size: 1.6rem;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--primary);
}

/* ---------- 5 · fertile soil ---------- */
.dsc-fertile p {
	font-family: var(--dsc-serif);
	line-height: 1.3;
}

/* ---------- scale figures ---------- */
.dsc-scale-num {
	margin: 0;
	font-family: var(--dsc-serif);
	font-weight: 400;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

/* ---------- gateway call to action ---------- */
.dsc-gateway-link a {
	text-decoration: none;
	font-weight: 600;
}
.dsc-gateway-link a:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* ---------- mobile ---------- */
@media (max-width: 781px) {
	/* On a narrow screen the numeral has nowhere to hide behind the title, so
	 * it sits in the empty band beside the eyebrow instead. */
	.dsc-hero .dsc-hero-mark {
		font-size: 6rem;
		top: -0.14em;
		right: -0.02em;
		opacity: 0.16;
	}
	.dsc-hero .dsc-h-title {
		max-width: none;
	}
	.dsc-hero .dsc-h-meta {
		flex-direction: column;
		gap: 0.35rem;
	}
	.dsc-reason {
		grid-template-columns: 3rem minmax(0, 1fr);
		column-gap: var(--wp--preset--spacing--small);
	}
	.dsc-reason .dsc-reason-n {
		font-size: 1.7rem;
	}
	.dsc-life-row {
		grid-template-columns: minmax(0, 1fr) 4.5rem;
		row-gap: 0.5rem;
	}
	.dsc-life-row .dsc-track {
		grid-column: 1 / 3;
		grid-row: 2;
	}
	.dsc-life-row .dsc-life-val {
		font-size: 1.35rem;
	}
	.dsc-map .dsc-map-label {
		font-size: 32px;
	}
	.dsc-map .dsc-map-sub {
		font-size: 15px;
	}
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.dsc-reason,
	.dsc-fertile,
	.dsc-thunder .dsc-word,
	.dsc-hero .dsc-hw,
	.dsc-life-row .dsc-bar {
		opacity: 1 !important;
		transform: none !important;
	}
	.dsc-live {
		will-change: auto;
	}
}
