/*
 * Section components for the product pages migrated off the old site.
 *
 * Those pages are built from a handful of repeating shapes: an arced hero band,
 * alternating copy cards, a row of numbered cards over a photograph, a quote on
 * a gradient, a numbered flow, and a grid of grouped lists. Rebuilding the
 * shapes from this theme's own tokens keeps one design system on the site
 * instead of importing the old builder's generated markup.
 *
 * The markup lives in each page's post content, so these class names are a
 * contract with what is stored in the database: rename one and the pages using
 * it lose their styling silently. Background images are attached by modifier
 * classes rather than inline styles, because KSES strips custom properties out
 * of post content as soon as a non-administrator saves the page.
 */

.page--product {
	overflow-x: clip;
}

/* --- Arced hero ----------------------------------------------------------- */

.pg-hero {
	position: relative;
	padding: var(--space-80) 0 var(--space-64);
	/* The band's foot is an arc, as on the old site. A horizontal radius wider
	   than the box flattens the curve into a shallow sweep rather than a dome. */
	border-radius: 0 0 50% 50% / 0 0 var(--space-64) var(--space-64);
	background: linear-gradient(100deg, #E8663A 0%, #A048C8 45%, #5B2BC4 100%);
	color: var(--color-text-inverse);
	text-align: center;
	isolation: isolate;
	overflow: hidden;
}

/* The photograph sits under the wash rather than replacing it, so the band
   keeps the same colour identity on every page. */
.pg-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--pg-hero-img, none) center/cover no-repeat;
	opacity: 0.55;
	mix-blend-mode: overlay;
}

.pg-hero--usdb::before { background-image: url("../img/media/pages/usdb-hero.webp"); }
.pg-hero--roofage::before { background-image: url("../img/media/pages/roofage-hero.webp"); }
.pg-hero--platform::before { background-image: url("../img/media/pages/platform-hero.webp"); }
.pg-hero--vacancy::before { background-image: url("../img/media/pages/vacancy-hero.webp"); }
.pg-hero--partners::before { background-image: url("../img/media/pages/partners-hero.webp"); }

.pg-hero__title {
	max-width: 16ch;
	margin: 0 auto var(--space-16);
	font-size: var(--text-display-fluid);
	line-height: var(--lh-display);
	color: inherit;
	text-wrap: balance;
}

.pg-hero__lead {
	max-width: 56ch;
	margin: 0 auto var(--space-32);
	font-size: var(--text-body-lg);
	line-height: var(--lh-body);
	color: rgb(255 255 255 / 88%);
}

.pg-hero__art {
	display: block;
	width: min(520px, 78%);
	height: auto;
	margin: 0 auto var(--space-32);
}

.pg-hero__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-12);
}

/* On the gradient the outline button has to read against the band, not the
   page, so it borrows white rather than the theme's dark border. */
.pg-hero .btn-ghost {
	border-color: rgb(255 255 255 / 70%);
	color: var(--color-text-inverse);
}

.pg-hero .btn-ghost:hover {
	background: rgb(255 255 255 / 14%);
}

/* --- Alternating copy cards ----------------------------------------------- */

.pg-alt {
	display: flex;
	flex-direction: column;
	gap: var(--space-48);
	padding-block: var(--section-y);
}

/* Copy panel and photograph share the row and the same height, so the two
   rounded blocks read as one band rather than a card with a picture parked
   next to it. */
.pg-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: stretch;
	gap: var(--space-24);
}

.pg-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--space-48);
	border-radius: var(--radius-2xl);
	background: var(--color-bg-warm);
}

.pg-card__media {
	width: 100%;
	height: 100%;
	/* The two source photographs have different aspect ratios, so they are
	   cropped to the row rather than allowed to set its height. */
	object-fit: cover;
	border-radius: var(--radius-2xl);
}

.pg-card__title {
	margin: 0 0 var(--space-16);
	font-size: var(--text-h5);
	font-weight: 600;
}

.pg-card p {
	margin: 0;
	line-height: var(--lh-body);
	color: var(--color-text-muted);
}

/* --- Numbered cards over a photograph ------------------------------------- */

.pg-showcase {
	position: relative;
	padding-block: var(--space-80);
	background: var(--color-primary) center/cover no-repeat;
	isolation: isolate;
}

.pg-showcase--rooftops {
	background-image: url("../img/media/pages/usdb-rooftops.webp");
}

.pg-showcase::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		115deg,
		rgb(232 102 58 / 62%) 0%,
		rgb(160 72 200 / 68%) 52%,
		rgb(91 43 196 / 72%) 100%
	);
}

.pg-showcase__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--space-24);
	align-items: start;
}

.pg-step {
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
	padding: var(--space-42) var(--space-32);
	border-radius: var(--radius-2xl);
	background: rgb(255 255 255 / 74%);
	backdrop-filter: blur(10px);
	text-align: center;
}

.pg-step__n {
	font-family: var(--font-display);
	font-size: var(--text-h6);
	font-weight: 400;
	color: var(--color-text-heading);
	font-variant-numeric: tabular-nums;
}

.pg-step__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-body-lg);
	font-weight: 600;
	color: var(--color-text-heading);
}

.pg-step p {
	margin: 0;
	line-height: var(--lh-body);
	color: var(--color-text-primary);
}

/* --- Quote on a gradient -------------------------------------------------- */

.pg-quote {
	position: relative;
	padding-block: var(--space-64);
	background: linear-gradient(100deg, #5B2BC4 0%, #A048C8 50%, #E8663A 100%);
	isolation: isolate;
}

.pg-quote::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url("../img/media/pages/roofage-quote.webp") center/cover no-repeat;
	opacity: 0.35;
	mix-blend-mode: overlay;
}

.pg-quote__inner {
	max-width: 760px;
	margin-inline: auto;
	padding: var(--space-64) var(--space-48);
	border-radius: var(--radius-2xl);
	background: var(--color-bg-default);
	text-align: center;
}

/* A quotation mark set as text rather than an image, so it takes the brand
   colour and scales with the type. */
.pg-quote__inner::before {
	content: "\201C";
	display: block;
	font-family: var(--font-display);
	font-size: 64px;
	line-height: 0.8;
	color: var(--color-primary);
}

.pg-quote__text {
	margin: var(--space-16) 0 var(--space-12);
	font-size: var(--text-subtitle);
	line-height: var(--lh-subtitle);
	color: var(--color-text-heading);
}

.pg-quote__cite {
	display: block;
	margin-bottom: var(--space-24);
	font-style: italic;
	font-size: var(--text-body-sm);
	color: var(--color-text-muted);
}

/* --- Centred band --------------------------------------------------------- */

.pg-band {
	padding-block: var(--space-80);
	background: var(--color-bg-warm);
	text-align: center;
}

.pg-band__title {
	margin: 0 0 var(--space-16);
	font-size: var(--text-h3-fluid);
	color: var(--color-primary);
}

.pg-band__lead {
	max-width: 46ch;
	margin: 0 auto;
	font-size: var(--text-subtitle);
	line-height: var(--lh-subtitle);
	color: var(--color-primary);
}

/* --- Numbered flow -------------------------------------------------------- */

.pg-flow {
	padding-block: var(--section-y);
	background: var(--color-bg-warm);
}

.pg-flow__title {
	margin: 0 0 var(--space-32);
	font-size: var(--text-h3-fluid);
}

.pg-flow__list {
	max-width: 780px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: flow;
}

/* The arrow is positioned rather than laid out as a grid or flex child. Both of
   those turn the run of text after <strong> into an item of its own, which then
   lands in the 32px column and wraps one word per line. */
.pg-flow__list li {
	position: relative;
	padding: var(--space-16) 0 var(--space-16) 48px;
	border-bottom: 1px solid var(--color-border-default);
	line-height: var(--lh-body);
	color: var(--color-text-muted);
}

.pg-flow__list li::before {
	content: "\2193";
	position: absolute;
	top: var(--space-16);
	left: 0;
	font-size: var(--text-body-lg);
	line-height: inherit;
	color: var(--color-text-heading);
}

.pg-flow__list strong {
	color: var(--color-text-heading);
}

/* --- Grouped attribute lists ---------------------------------------------- */

.pg-groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--space-24);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg-group {
	padding: var(--space-32) var(--space-24);
	border-radius: var(--radius-lg);
	background: var(--color-primary);
	color: var(--color-text-inverse);
}

.pg-group__title {
	margin: 0 0 var(--space-16);
	padding-bottom: var(--space-12);
	border-bottom: 2px solid var(--color-secondary);
	font-family: var(--font-display);
	font-size: var(--text-body-lg);
	font-weight: 600;
	color: inherit;
}

.pg-group ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg-group li {
	margin-bottom: var(--space-8);
	font-size: var(--text-body-sm);
	line-height: var(--lh-body);
	color: rgb(255 255 255 / 82%);
}

/* --- Feature grid --------------------------------------------------------- */

.pg-features {
	padding-block: var(--section-y);
}

.pg-features__title {
	margin: 0 0 var(--space-32);
	font-size: var(--text-h3-fluid);
}

.pg-features__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--space-24);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg-feature {
	padding: var(--space-32);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-lg);
	background: var(--color-bg-default);
}

.pg-feature h3 {
	margin: 0 0 var(--space-8);
	font-size: var(--text-body-lg);
	font-weight: 600;
}

.pg-feature p {
	margin: 0;
	line-height: var(--lh-body);
	color: var(--color-text-muted);
}

/* --- Plain reading column ------------------------------------------------- */

/* For a page that is prose rather than a set of blocks. The column is capped
   in characters, not pixels, so the measure stays readable whatever the type
   scale does at a given viewport. */
.pg-copy {
	padding-block: var(--section-y);
}

.pg-copy .container {
	max-width: 68ch;
}

.pg-copy p {
	margin: 0 0 var(--space-24);
	font-size: var(--text-body-lg);
	line-height: var(--lh-body);
	color: var(--color-text-primary);
}

.pg-copy p:last-child {
	margin-bottom: 0;
}

/* --- Split: copy beside an image ------------------------------------------ */

.pg-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: var(--space-48);
	align-items: center;
	padding-block: var(--section-y);
}

.pg-split__title {
	margin: 0 0 var(--space-16);
	font-size: var(--text-h4);
}

.pg-split p {
	margin: 0;
	line-height: var(--lh-body);
	color: var(--color-text-muted);
}

.pg-split img {
	width: 100%;
	height: auto;
	border-radius: var(--radius-lg);
}

@media (max-width: 767px) {
	.pg-hero {
		padding-block: var(--space-48) var(--space-42);
		border-radius: 0 0 50% 50% / 0 0 var(--space-32) var(--space-32);
	}

	.pg-showcase,
	.pg-band,
	.pg-quote {
		padding-block: var(--space-48);
	}

	.pg-card {
		grid-template-columns: 1fr;
	}

	.pg-card__body {
		padding: var(--space-32) var(--space-24);
	}

	/* Stacked, the photograph has no row height to fill, so it gets one. */
	.pg-card__media {
		height: auto;
		aspect-ratio: 16 / 10;
	}

	.pg-quote__inner {
		padding: var(--space-42) var(--space-24);
	}

	.pg-step {
		padding: var(--space-32) var(--space-24);
	}
}
