/*
 * How It Works page sections.
 *
 * Loaded only on the How It Works page (see inc/enqueue.php) and additive to srp.css in the
 * same way srp-location.css is: everything is scoped to a .srp-hiw-* class or to the
 * .hs-section--srp-hiw-* wrapper the section renderer prints.
 *
 * Measurements come from the approved concept's inline styles at its 1280px artboard. The
 * concept has no responsive behaviour, so every breakpoint below was chosen for this build.
 */

/* ================================================================ hero */

/*
 * Same trick as the homepage hero: the photograph runs to the container's right edge, so the
 * container drops its gutter and the copy column pays it back as padding.
 */
.hs-section--srp-hiw-hero .hs-container {
	padding-inline: 0;
}

.srp-hiw-hero {
	display: grid;
	grid-template-columns: 1.04fr 0.96fr;
	align-items: stretch;
	min-height: 36.25rem; /* 580px */
}

.srp-hiw-hero__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 4.5rem 3.5rem 4.5rem var(--srp-gutter);
	color: var(--srp-white);
}

.srp-hiw-hero__title {
	margin: 0 0 1.25rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-semibold);
	font-size: var(--srp-text-h1);
	line-height: var(--srp-leading-display);
	letter-spacing: -0.01em;
	color: var(--srp-white);
	text-wrap: balance;
}

.srp-hiw-hero__body {
	margin: 0 0 2rem;
	max-width: 31.25rem;
	font-size: var(--srp-text-body-lg);
	line-height: 1.6;
	color: var(--srp-ondark-200);
}

.srp-hiw-hero__buttons {
	margin-bottom: 2.25rem;
}

/* A wrapping row rather than a grid: there are three of them, and a grid orphans the third. */
.srp-hiw-hero__points {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 1.875rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.srp-hiw-hero__points li {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.875rem;
	font-weight: var(--srp-weight-semibold);
	color: var(--srp-ondark-100);
}

.srp-hiw-hero__points .srp-icon {
	flex: none;
	color: var(--srp-accent);
}

.srp-hiw-hero__media {
	position: relative;
	min-height: 36.25rem;
	isolation: isolate;
}

.srp-hiw-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.srp-hiw-hero__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		var(--srp-ink-800) 0%,
		rgba(35, 38, 43, 0.35) 22%,
		rgba(35, 38, 43, 0) 55%
	);
}

/* Belongs to the photograph, so it hangs off the bottom-right rather than the copy column. */
.srp-hiw-hero__stat {
	position: absolute;
	left: 1.625rem;
	bottom: 1.625rem;
	display: flex;
	align-items: center;
	gap: 0.9375rem;
	padding: 1.0625rem 1.375rem;
	border-radius: var(--srp-radius-lg);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: var(--srp-shadow-image-md);
}

.srp-hiw-hero__stat-value {
	margin: 0;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-bold);
	font-size: 2rem;
	line-height: 1;
	color: var(--srp-accent);
}

.srp-hiw-hero__stat-title {
	margin: 0;
	font-weight: var(--srp-weight-black);
	font-size: 0.9375rem;
	color: var(--srp-text-heading);
}

.srp-hiw-hero__stat-note {
	margin: 0.125rem 0 0;
	font-size: 0.78125rem;
	font-weight: var(--srp-weight-semibold);
	color: var(--srp-gray-600);
}

/* ================================================================ steps */

.srp-hiw-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 2.75rem;
}

.srp-hiw-head .srp-intro {
	max-width: 38.75rem;
}

.srp-hiw-head .hs-section__heading {
	margin-bottom: 0;
}

.srp-hiw-head__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex: none;
	padding-bottom: 0.375rem;
	font-weight: var(--srp-weight-black);
	font-size: 1rem;
}

/*
 * One card holding every step as a row. The rules live on the rows rather than the container
 * so the first row never doubles up with the card's own border.
 */
.srp-hiw-steps {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--srp-border);
	border-radius: var(--srp-radius-2xl);
	background: var(--srp-white);
	box-shadow: var(--srp-shadow-card);
	overflow: hidden;
}

.srp-hiw-step {
	display: grid;
	grid-template-columns: 9.375rem minmax(0, 1fr);
	gap: 2.125rem;
	align-items: start;
	padding: 2.25rem 2.125rem;
	border-top: 1px solid var(--srp-border);
}

.srp-hiw-step:first-child {
	border-top: 0;
}

/* Alternating tint, starting with the first row, so a seven-row list stays scannable. */
.srp-hiw-step:nth-child(odd) {
	background: var(--srp-gray-250);
}

.srp-hiw-step__rail {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.srp-hiw-step__num {
	margin: 0;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-bold);
	font-size: var(--srp-text-num);
	line-height: 1;
	color: var(--srp-accent);
}

.srp-hiw-step__meta {
	margin: 0;
	font-weight: var(--srp-weight-bold);
	font-size: var(--srp-text-tiny);
	letter-spacing: var(--srp-tracking-badge);
	text-transform: uppercase;
	color: var(--srp-text-faint);
}

.srp-hiw-step__title {
	margin: 0 0 0.5rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-semibold);
	font-size: var(--srp-text-h3);
	line-height: 1.2;
	color: var(--srp-text-heading);
}

.srp-hiw-step__text {
	margin: 0;
	max-width: 46.875rem;
	font-size: var(--srp-text-body-md);
	line-height: 1.65;
	color: var(--srp-text-body);
}

.srp-hiw-step__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	margin: 1.125rem 0 0;
	padding: 0;
	list-style: none;
}

.srp-hiw-tag {
	padding: 0.5rem 0.9375rem;
	border: 1px solid var(--srp-border);
	border-radius: var(--srp-radius-pill);
	background: var(--srp-surface-muted);
	color: var(--srp-text-heading);
	font-weight: var(--srp-weight-semibold);
	font-size: 0.84375rem; /* 13.5px */
}

/* ================================================================ project walkthrough */

.srp-hiw-project__intro {
	margin-bottom: 3rem;
}

.srp-hiw-project {
	display: grid;
	grid-template-columns: 1fr 1.02fr;
	gap: 3.5rem;
	align-items: center;
}

/* Media first in the source order stays second for screen readers; only the columns swap. */
.srp-hiw-project--flip .srp-hiw-project__content {
	order: 2;
}

.srp-hiw-project__pill {
	display: inline-block;
	margin: 0 0 1.125rem;
	padding: 0.5rem 1rem;
	border-radius: var(--srp-radius-pill);
	background: var(--srp-accent-tint);
	color: var(--srp-accent-hover);
	font-weight: var(--srp-weight-black);
	font-size: 0.78125rem; /* 12.5px */
	letter-spacing: var(--srp-tracking-badge);
	text-transform: uppercase;
}

.srp-hiw-project__title {
	margin: 0 0 1rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-semibold);
	font-size: clamp(1.75rem, 1.4rem + 1.1vw, 2.125rem); /* 34px */
	line-height: 1.12;
	color: var(--srp-text-heading);
	text-wrap: balance;
}

.srp-hiw-project__body {
	margin: 0 0 1.625rem;
	font-size: var(--srp-text-body-md);
	line-height: 1.65;
	color: var(--srp-text-body);
}

.srp-hiw-project__points {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.875rem 1.375rem;
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
}

.srp-hiw-project__points li {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	font-size: 0.9375rem;
	font-weight: var(--srp-weight-semibold);
	color: var(--srp-text-heading);
}

.srp-hiw-project__points .srp-icon {
	flex: none;
	margin-top: 0.0625rem;
	color: var(--srp-accent);
}

/* A strip rather than a grid: the dividers do the separating, so widths stay content-sized. */
.srp-hiw-project__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 2.125rem;
	margin: 0;
	padding: 1.375rem 1.625rem;
	border: 1px solid var(--srp-border);
	border-radius: var(--srp-radius-xl);
	background: var(--srp-white);
}

.hs-section[data-theme="white"] .srp-hiw-project__stats {
	background: var(--srp-surface-muted);
}

.srp-hiw-project__stat + .srp-hiw-project__stat {
	padding-left: 2.125rem;
	border-left: 1px solid var(--srp-border);
}

.srp-hiw-project__stat-value {
	margin: 0 0 0.25rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-bold);
	font-size: 2rem;
	line-height: 1;
	color: var(--srp-accent);
}

.srp-hiw-project__stat-label {
	margin: 0;
	font-weight: var(--srp-weight-bold);
	font-size: var(--srp-text-caption);
	color: var(--srp-text-muted);
}

/*
 * The lead photograph spans both columns; the two below it are supporting detail. Fixed
 * heights rather than aspect ratios, because the three images have to line up as one block.
 */
.srp-hiw-project__media {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.125rem;
}

.srp-hiw-project__figure {
	position: relative;
	margin: 0;
	height: 14.375rem; /* 230px */
	border-radius: var(--srp-radius-xl);
	overflow: hidden;
	box-shadow: var(--srp-shadow-image-md);
	isolation: isolate;
}

.srp-hiw-project__figure--lead {
	grid-column: 1 / -1;
	height: 18.75rem; /* 300px */
}

.srp-hiw-project__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Only under the lead pill, so white-on-white can never happen on a bright photograph. */
.srp-hiw-project__scrim {
	position: absolute;
	inset: 0 0 auto;
	height: 40%;
	background: linear-gradient(180deg, rgba(17, 20, 24, 0.45), rgba(17, 20, 24, 0));
}

.srp-hiw-project__label {
	position: absolute;
	top: 0.875rem;
	left: 0.875rem;
	padding: 0.3125rem 0.75rem;
	border-radius: var(--srp-radius-pill);
	background: rgba(255, 255, 255, 0.94);
	color: var(--srp-text-heading);
	font-weight: var(--srp-weight-black);
	font-size: var(--srp-text-tiny);
	letter-spacing: var(--srp-tracking-badge);
	text-transform: uppercase;
}

.srp-hiw-project__label--accent {
	background: var(--srp-accent);
	color: var(--srp-white);
}

/* ================================================================ install-day timeline */

.srp-hiw-timeline__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 2.875rem;
}

.srp-hiw-timeline__intro {
	max-width: 38.75rem;
}

.srp-hiw-timeline__intro .hs-section__heading {
	margin-bottom: 0;
}

/* Reads as a footnote to the heading, which is why it is bottom-aligned with it. */
.srp-hiw-timeline__note {
	flex: none;
	margin: 0;
	max-width: 23.75rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--srp-text-on-dark-body);
}

.srp-hiw-timeline {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.375rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.srp-hiw-timeline__card {
	padding: 1.75rem;
	border: 1px solid var(--srp-border-dark);
	border-radius: var(--srp-radius-xl);
	background: var(--srp-surface-dark-card);
}

.srp-hiw-timeline__time {
	margin: 0 0 0.75rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-bold);
	font-size: 1.875rem;
	line-height: 1;
	color: var(--srp-accent);
}

.srp-hiw-timeline__title {
	margin: 0 0 0.5rem;
	font-family: var(--srp-font-display);
	font-weight: var(--srp-weight-semibold);
	font-size: 1.25rem;
	line-height: 1.2;
	color: var(--srp-white);
}

.srp-hiw-timeline__text {
	margin: 0;
	font-size: var(--srp-text-body-sm);
	line-height: 1.55;
	color: var(--srp-text-on-dark-body);
}

/* ================================================================ responsive */

@media (max-width: 68.75rem) {
	.srp-hiw-hero__content {
		padding-right: 2.25rem;
	}

	.srp-hiw-step {
		grid-template-columns: 7rem minmax(0, 1fr);
		gap: 1.5rem;
		padding: 1.625rem 1.75rem;
	}

	.srp-hiw-project {
		gap: 2.5rem;
	}

	/* Four across becomes two-by-two well before the cards get too narrow to read. */
	.srp-hiw-timeline {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 61.25rem) {
	.srp-hiw-hero {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.srp-hiw-hero__content {
		order: 2;
		padding: 2.75rem var(--srp-gutter) 3.25rem;
	}

	.srp-hiw-hero__media {
		order: 1;
		min-height: 21.875rem; /* 350px */
	}

	/* Stacked, the gradient has to fade downward into the copy instead of sideways. */
	.srp-hiw-hero__scrim {
		background: linear-gradient(
			180deg,
			rgba(35, 38, 43, 0.15) 0%,
			rgba(35, 38, 43, 0.55) 100%
		);
	}

	.srp-hiw-hero__stat {
		left: var(--srp-gutter);
		bottom: 1.125rem;
	}

	.srp-hiw-head,
	.srp-hiw-timeline__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.125rem;
	}

	.srp-hiw-project,
	.srp-hiw-project--flip {
		grid-template-columns: 1fr;
		gap: 2.25rem;
	}

	/* Stacked, the copy leads regardless of which side the media sat on. */
	.srp-hiw-project--flip .srp-hiw-project__content {
		order: 0;
	}
}

@media (max-width: 40rem) {
	.srp-hiw-hero__points {
		flex-direction: column;
	}

	.srp-hiw-project__points {
		grid-template-columns: 1fr;
	}

	.srp-hiw-hero__stat {
		right: var(--srp-gutter);
		padding: 0.875rem 1.125rem;
	}

	.srp-hiw-hero__stat-value {
		font-size: 1.75rem;
	}

	/* The number rail stops being a column and becomes a line above the step. */
	.srp-hiw-step {
		grid-template-columns: 1fr;
		gap: 0.875rem;
		padding: 1.5rem 1.25rem;
	}

	.srp-hiw-step__rail {
		flex-direction: row;
		align-items: baseline;
		gap: 0.75rem;
	}

	.srp-hiw-step__num {
		font-size: 1.75rem;
	}

	.srp-hiw-project__stats {
		flex-direction: column;
		gap: 1.125rem;
	}

	.srp-hiw-project__stat + .srp-hiw-project__stat {
		padding-left: 0;
		padding-top: 1.125rem;
		border-left: 0;
		border-top: 1px solid var(--srp-border);
	}

	.srp-hiw-project__figure,
	.srp-hiw-project__figure--lead {
		height: 13.75rem;
	}

	.srp-hiw-timeline {
		grid-template-columns: 1fr;
	}
}
