/* ==========================================================================
   Case Study v4 – editorial layout, part 1: vars, resets, hero, results (part 2: case-study-v4-sections.css)
   Scope: everything lives under `.cs4` so it cannot leak into other pages.
   Per-page colours come from inline CSS vars set in the template:
     --cs4-brand        client brand colour (numbers, quote, CTA band)
     --cs4-accent       IVC accent (small details)
     --cs4-button       CTA button background (white unless set in ACF)
     --cs4-button-text  CTA button text
   The hero starts dark because the site header is white text on a transparent bar.
   ========================================================================== */

.cs4 {
	--cs4-ink: #141414;
	--cs4-ink-2: #2b2b2b;
	--cs4-muted: #6b665f;
	--cs4-paper: #f5f1ea;
	--cs4-card: #ffffff;
	--cs4-line: rgba(20, 20, 20, 0.14);
	--cs4-line-dark: rgba(255, 255, 255, 0.18);
	--cs4-on-brand: #ffffff;
	--cs4-on-brand-soft: rgba(255, 255, 255, 0.82);
	--cs4-on-brand-line: rgba(255, 255, 255, 0.22);
	--cs4-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--cs4-radius: 20px;
	--cs4-gap: clamp(64px, 7vw, 120px);
	--cs4-header-offset: clamp(130px, 11vw, 190px);

	background: var(--cs4-paper);
	color: var(--cs4-ink);
	font-family: var(--primary-font, "Poppins", sans-serif);
	font-weight: 400;
	line-height: 1.5;
}

.cs4 *,
.cs4 *::before,
.cs4 *::after {
	box-sizing: border-box;
}

/* Resets use :where() so any single component class below overrides them. */
.cs4 :where(h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote) {
	margin: 0;
	padding: 0;
	color: inherit;
}

.cs4 :where(blockquote) {
	border: 0;
	background: none;
	font-style: normal;
}

.cs4 :where(ul, ol) {
	list-style: none;
}

.cs4 :where(img) {
	display: block;
	max-width: 100%;
}

.cs4 :where(a) {
	color: inherit;
}

/* Light brand colour: dark text on the quote + CTA (ACF "Text colour on brand colour"). */
.cs4--on-brand-dark {
	--cs4-on-brand: #141414;
	--cs4-on-brand-soft: rgba(20, 20, 20, 0.75);
	--cs4-on-brand-line: rgba(20, 20, 20, 0.2);
}

@media (max-width: 991px) {
	.cs4 {
		--cs4-header-offset: 110px;
	}

	.cs4 .container {
		padding-left: 32px;
		padding-right: 32px;
		max-width: none;
	}
}

@media (max-width: 575px) {
	.cs4 {
		--cs4-gap: 56px;
		--cs4-radius: 14px;
	}

	.cs4 .container {
		padding-left: 20px;
		padding-right: 20px;
	}
}

.cs4-section {
	padding: var(--cs4-gap) 0;
}

/* Consecutive paper sections share one gap; the brand band keeps its own padding. */
.cs4-section:not(.cs4-band) + .cs4-section:not(.cs4-band) {
	padding-top: 0;
}

/* Shared ----------------------------------------------------------------- */

.cs4-label {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.cs4-label::before {
	content: "";
	width: 28px;
	height: 2px;
	background: var(--cs4-brand-ink);
}

.cs4-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px 24px;
	margin-bottom: clamp(32px, 4vw, 56px);
}

.cs4-head__meta {
	font-size: 14px;
	color: var(--cs4-muted);
}

/* 1. Hero ----------------------------------------------------------------- */

.cs4-hero {
	background: var(--cs4-ink);
	color: #fff;
	padding-top: var(--cs4-header-offset);
}

.cs4-hero:not(.cs4-hero--has-media) {
	padding-bottom: var(--cs4-gap);
}

.cs4-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: clamp(20px, 2.4vw, 32px);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}

.cs4-kicker__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cs4-accent);
}

.cs4-hero__title {
	max-width: 1100px;
	font-family: var(--cs4-serif);
	font-weight: 600;
	font-size: clamp(44px, 6.6vw, 104px);
	line-height: 1;
	letter-spacing: -0.015em;
	color: #fff;
}

.cs4-hero__meta {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	margin-top: clamp(32px, 4vw, 56px);
}

.cs4-hero__intro {
	max-width: 560px;
	font-size: clamp(17px, 1.4vw, 20px);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.82);
}

.cs4-facts__row {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid var(--cs4-line-dark);
}

.cs4-facts__row:last-child {
	border-bottom: 1px solid var(--cs4-line-dark);
}

.cs4-facts dt {
	padding-top: 2px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.cs4-facts dd {
	font-size: 16px;
	line-height: 1.5;
	color: #fff;
}

.cs4-facts__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
}

.cs4-facts__tags li:not(:last-child)::after {
	content: ",";
}

@media (min-width: 992px) {
	.cs4-hero__meta {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		gap: clamp(48px, 6vw, 96px);
		align-items: start;
	}
}

/* Image straddles the dark hero and the paper page below it. */
.cs4-hero__stage {
	margin-top: clamp(48px, 5vw, 80px);
	background: linear-gradient(to bottom, var(--cs4-ink) 0 50%, var(--cs4-paper) 50% 100%);
}

.cs4-hero__media {
	overflow: hidden;
	border-radius: var(--cs4-radius);
	aspect-ratio: 4 / 3;
	background: var(--cs4-ink-2);
}

.cs4-hero__media picture {
	display: block;
	height: 100%;
}

.cs4-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (min-width: 576px) {
	.cs4-hero__media {
		aspect-ratio: 16 / 9;
	}
}

@media (min-width: 992px) {
	.cs4-hero__media {
		aspect-ratio: 21 / 9;
	}
}

@media (max-width: 991px) {
	.cs4-hero__media--has-mobile {
		aspect-ratio: auto;
	}

	.cs4-hero__media--has-mobile img {
		height: auto;
		max-height: min(80vh, 640px);
	}
}

/* 2. Results -------------------------------------------------------------- */

.cs4-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px 20px;
}

.cs4-stats--1 {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
	.cs4-stats {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		gap: 32px;
	}
}

.cs4-stat {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-top: 20px;
	border-top: 2px solid var(--cs4-ink);
}

.cs4-stat__value {
	font-size: clamp(40px, 5.6vw, 88px);
	font-weight: 700;
	line-height: 0.95;
	letter-spacing: -0.04em;
	color: var(--cs4-brand-ink);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cs4-stat__label {
	max-width: 24ch;
	font-size: clamp(14px, 1.2vw, 16px);
	line-height: 1.5;
	color: var(--cs4-muted);
}
