/*
 * Homepage — Naccarato Insurance
 *
 * Measurements come from `HOMEPAGE - with drop down menu 5 A.png`, converted
 * from that file's 1822px canvas to CSS px of the 1300px frame (×0.7135):
 *
 *   hero          570px tall, video behind everything (the art's black panel dropped)
 *   icon row      235px tall, icons ~100px, row 1096px wide
 *   intro band    268px tall, heading ~40px, copy 927px wide over 5 lines
 *   offices       387px tall, block only 527px wide and centred
 *   latest news   218px tall, list 543px wide
 *   logo divider  143px band with a 261×154 logo overlapping it
 *
 * Depends on tokens.css.
 */

/* ===================================================================
 * Hero — manual slider of looping videos (inc/home-hero.php)
 *
 * Art (frame px): 570px tall; eyebrow 30px bold at x=77 on the gold rule's
 * line (y=325);
 * title 88px black, two lines, 75px apart, baseline of INSURANCE at y=515;
 * ‹ › buttons 29px at y=312; chat card 287px wide at x=953, y=56.
 *
 * The video is the background of the whole hero: no dark panel and no
 * darkening (client decision 2026-10-01, overriding the art's black panel),
 * so the eyebrow, title and gold rule sit directly on the moving image. The
 * hero is wider than 16:9, so each slide picks which horizontal slice of its
 * video shows with --hero-video-position (set inline from the slide's focus).
 * Everything is sized against --frame-width, like the rest of the sheet.
 * =================================================================== */

.home-hero {
	--hw: var(--frame-width);
	--hero-video-position: 50% 50%;

	background-color: #161615;
	color: var(--nac-white);
}

.home-hero__stage {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.home-hero__video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	object-position: var(--hero-video-position);
	background-color: #161615;
}

.home-hero__eyebrow {
	margin: 0;
	padding: var(--space-5) var(--space-5) 0;
	color: var(--nac-white);
	font-family: var(--font-display);
	font-size: clamp(1rem, calc(var(--hw) * 0.0234), 1.9rem);
	font-weight: 700;
	/* The art uses Inter's 18pt optical cut, which sets tighter than this file. */
	letter-spacing: -0.037em;
	line-height: 1;
	text-transform: uppercase;
}

.home-hero__title {
	margin: 0;
	padding: var(--space-3) var(--space-5) var(--space-8);
	color: var(--nac-white);
	font-family: var(--font-display);
	font-size: clamp(2.5rem, calc(var(--hw) * 0.0677), 5.5rem);
	font-weight: 900;
	letter-spacing: 0;
	line-height: 0.85;
	text-transform: uppercase;
}

.home-hero__title-link {
	color: inherit;
	text-decoration: none;
}

.home-hero__title-link span {
	display: block;
}

.home-hero__arrow,
.home-hero__toggle {
	position: absolute;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 5px;
	cursor: pointer;
}

.home-hero__arrow {
	background-color: #d9d9d9;
	color: #3a383b;
}

.home-hero__arrow:hover {
	background-color: var(--nac-white);
}

.home-hero__toggle {
	background-color: rgba(255, 255, 255, 0.18);
	color: var(--nac-white);
}

.home-hero__toggle:hover {
	background-color: rgba(255, 255, 255, 0.32);
}

.home-hero__toggle[hidden] {
	display: none;
}

.home-hero__arrow svg,
.home-hero__toggle svg {
	width: 70%;
	height: 70%;
}

.home-hero__toggle .home-hero__icon-play,
.home-hero__toggle[aria-pressed="true"] .home-hero__icon-pause {
	display: none;
}

.home-hero__toggle[aria-pressed="true"] .home-hero__icon-play {
	display: block;
}

.home-hero :focus-visible {
	outline: 2px solid var(--nac-white);
	outline-offset: 2px;
}

/* Below the breakpoint: video on top, text underneath, no chat card. */
.home-hero__slide:not(.is-active) {
	display: none;
}

.home-hero__rule,
.home-hero__chat {
	display: none;
}

.home-hero__arrow {
	/* Centred on the 16:9 video. */
	top: calc(var(--hw) * 0.28125 - 1.125rem);
}

.home-hero__arrow--prev {
	left: var(--space-3);
}

.home-hero__arrow--next {
	right: var(--space-3);
}

.home-hero__toggle {
	top: var(--space-3);
	right: var(--space-3);
}

@media (min-width: 1024px) {
	/*
	 * The stage is as wide as the page (the video fills it edge to edge) but as
	 * tall as the art frame's hero, and everything laid over it keeps the art's
	 * positions inside the centred --hw (1300px) frame: --hero-inset is the
	 * margin each side of that frame, 0 until the page is wider than it.
	 */
	.home-hero__stage {
		--hero-inset: calc((100% - var(--hw)) / 2);

		height: calc(var(--hw) * 570 / 1300);
	}

	.home-hero__slide {
		position: absolute;
		inset: 0;
		display: block;
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--transition-base), visibility 0s linear 250ms;
	}

	.home-hero__slide.is-active {
		opacity: 1;
		visibility: visible;
		transition-delay: 0s;
	}

	@media (prefers-reduced-motion: reduce) {
		.home-hero__slide {
			transition: none;
		}
	}

	.home-hero__slide:not(.is-active) {
		display: block;
	}

	.home-hero__video {
		position: absolute;
		inset: 0;
		z-index: 0;
		height: 100%;
		aspect-ratio: auto;
	}

	.home-hero__eyebrow,
	.home-hero__title {
		position: absolute;
		z-index: 2;
		left: calc(var(--hero-inset) + var(--hw) * 0.0592);
		padding: 0;
	}

	.home-hero__eyebrow {
		top: calc(var(--hw) * 0.239);
	}

	.home-hero__title {
		top: calc(var(--hw) * 0.2851);
	}

	/* Gold dot and line from the eyebrow to the chat card. */
	.home-hero__rule {
		position: absolute;
		z-index: 2;
		top: calc(var(--hw) * 0.2497);
		left: calc(var(--hero-inset) + var(--hw) * 0.447);
		display: block;
		width: calc(var(--hw) * 0.2896);
		height: 2px;
		background: var(--nac-gold) linear-gradient(var(--nac-gold), var(--nac-gold)) no-repeat;
		transform: translateY(-50%);
	}

	.home-hero__rule::before {
		position: absolute;
		top: 50%;
		left: 0;
		width: calc(var(--hw) * 0.0108);
		aspect-ratio: 1;
		border-radius: 50%;
		background: var(--nac-gold);
		content: "";
		transform: translateY(-50%);
	}

	.home-hero__chat {
		position: absolute;
		z-index: 2;
		top: 4.28%;
		left: calc(var(--hero-inset) + var(--hw) * 0.733);
		display: block;
		width: calc(var(--hw) * 0.2207);
	}

	.home-hero__chat img {
		display: block;
		width: 100%;
		height: auto;
	}

	.home-hero__arrow {
		top: calc(var(--hw) * 0.2396);
		width: calc(var(--hw) * 0.0223);
		height: calc(var(--hw) * 0.0223);
		min-width: 1.5rem;
		min-height: 1.5rem;
	}

	.home-hero__arrow--prev {
		left: calc(var(--hero-inset) + var(--hw) * 0.0208);
	}

	.home-hero__arrow--next {
		right: calc(var(--hero-inset) + var(--hw) * 0.0148);
	}

	.home-hero__toggle {
		top: auto;
		right: calc(var(--hero-inset) + var(--hw) * 0.0148);
		bottom: 4%;
		width: calc(var(--hw) * 0.0223);
		height: calc(var(--hw) * 0.0223);
		min-width: 1.5rem;
		min-height: 1.5rem;
	}
}

/* ===================================================================
 * Two-tone headings
 *
 * The homepage pairs burgundy with gold and swaps which leads — unlike the
 * insurance subpages, which are gold + black. See
 * naccarato_insurance_two_tone_title().
 * =================================================================== */

.home-heading {
	margin-bottom: var(--space-6);
	font-family: var(--font-display);
	/* ~44px at full frame width. */
	font-size: clamp(1.75rem, calc(var(--frame-width) * 0.0338), 2.75rem);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
	line-height: var(--lh-heading);
	text-align: center;
	text-transform: uppercase;
}

.home-heading .tone-primary {
	color: var(--color-primary);
}

.home-heading .tone-gold {
	color: var(--color-accent);
}

/* ===================================================================
 * Section 2 — service icons
 * =================================================================== */

.home-services-nav {
	padding-block: clamp(var(--space-8), calc(var(--frame-width) * 0.028), 36px);
}

/* .service-icons lives in main.css: the quote hubs use it too. */

/* ===================================================================
 * Section 3 — "Live More, Worry Less"
 * =================================================================== */

.home-intro {
	background-color: var(--color-bg-alt);
	/* Medido en el arte: 45px arriba, 36px abajo. */
	padding-block:
		clamp(var(--space-6), calc(var(--frame-width) * 0.0346), 45px)
		clamp(var(--space-5), calc(var(--frame-width) * 0.0277), 36px);
	text-align: center;
}

/*
 * 927px in the art — wide, not a narrow reading measure. The same lesson as
 * the subpage intro: constraining it adds lines and stretches the band.
 */
.home-intro__text {
	max-width: 930px;
	margin-inline: auto;
	font-size: var(--fs-sm);
	line-height: 1.5;
}

.home-intro__cta {
	color: var(--color-text);
	font-weight: var(--fw-bold);
	text-decoration: underline;
}

.home-intro__cta:hover,
.home-intro__cta:focus {
	color: var(--color-primary);
}

/* ===================================================================
 * Section 4 — offices and hours
 *
 * A narrow two-column table centred in the page: 527px wide in the art, not
 * spread across the full container.
 * =================================================================== */

.home-offices {
	/* Medido en el arte: 59px arriba, 55px abajo. */
	padding-block:
		clamp(var(--space-8), calc(var(--frame-width) * 0.0454), 59px)
		clamp(var(--space-8), calc(var(--frame-width) * 0.0423), 55px);
}

.office-table {
	display: grid;
	gap: var(--space-4) var(--space-8);
	grid-template-columns: 1fr;
	max-width: 560px;
	margin-inline: auto;
	text-align: center;
}

.office-table__heading {
	margin: 0;
	color: var(--color-primary);
	font-family: var(--font-display);
	font-size: var(--fs-h5);
	font-weight: var(--fw-black);
	text-transform: none;
}

.office-table__address {
	display: flex;
	flex-direction: column;
	font-size: var(--fs-sm);
	font-style: normal;
	line-height: 1.4;
}

.office-table__address a {
	color: var(--color-text);
	text-decoration: none;
}

.office-table__address a:hover,
.office-table__address a:focus {
	color: var(--color-primary);
}

.office-table__hours {
	margin: 0;
	font-size: var(--fs-sm);
	line-height: 1.4;
}

@media (min-width: 768px) {
	.office-table {
		grid-template-columns: 1fr 1fr;
	}

	/*
	 * Client round 2026-12-01: headings and copy centred under each other,
	 * with a wider gutter so the two columns read as separate blocks.
	 * Addresses and hours still line up in rows (shared grid rows).
	 */
	.office-table {
		max-width: 720px;
		column-gap: clamp(var(--space-8), 8vw, 120px);
	}

	.office-table__address,
	.office-table__hours {
		align-items: center;
		text-align: center;
	}

	.office-table__hours {
		text-wrap: balance;
	}

	.office-table__heading {
		text-align: center;
	}
}

/* ===================================================================
 * Section 5 — Latest News
 * =================================================================== */

.home-news {
	background-color: var(--color-bg-alt);
	padding-block: clamp(var(--space-8), calc(var(--frame-width) * 0.035), 46px);
}

.news-list {
	display: grid;
	gap: var(--space-2);
	max-width: 560px;
	margin-inline: auto;
	padding: 0;
	list-style: none;
	font-size: var(--fs-sm);
}

.news-list__item {
	display: grid;
	gap: var(--space-3);
	/* Dates align in their own column; titles wrap under themselves. */
	grid-template-columns: auto 1fr;
	margin: 0;
	line-height: 1.35;
}

.news-list__date {
	color: var(--color-text);
	white-space: nowrap;
}

.news-list__link {
	color: var(--color-text);
	text-decoration: none;
}

.news-list__link:hover,
.news-list__link:focus {
	color: var(--color-primary);
	text-decoration: underline;
}

/* ===================================================================
 * Logo divider
 *
 * The same device that sits above the footer: a light band with the badge
 * centred on it, slightly taller than the band so it overlaps both edges.
 * =================================================================== */

.logo-divider {
	display: flex;
	justify-content: center;
	background-color: var(--color-bg-alt);
	padding-block: var(--space-4);
}

.logo-divider img {
	width: auto;
	max-height: 110px;
}

/* ===================================================================
 * Section 6 — SERVICES
 *
 * Measuring the seven photos in the art showed a system, not seven bespoke
 * layouts: two columns with the right one offset 120–160px lower; left blocks
 * carry a label rotated 90° in its own gutter beside the photo, right blocks a
 * horizontal label beneath it.
 *
 * Measured band and cells (frame px): band x 175 → 1170 = 995 wide; left cell
 * 452 (gutter 124 + photo 328), gap 56, right cell 487.
 * =================================================================== */

.home-services {
	position: relative;   /* the decorative line is absolute against this */
	padding-block: clamp(var(--space-10), calc(var(--frame-width) * 0.05), 66px);
}

/*
 * The art's own content band. 995px wide and NOT centred in the 1300px frame:
 * 175px of air on the left, 130px on the right. The asymmetry is deliberate —
 * the extra room on the left is where the decorative line runs — so it is easy
 * to mistake for a mistake later.
 *
 * Deliberately not .container: that is 1140px centred, and shared with the
 * header, the footer and the other homepage sections.
 */
.services-band {
	width: min(100% - 2 * var(--space-5), 995px);
	margin-inline: auto;
}

/*
 * Outlined display type, like the subpage hero: Inter Black with its
 * overlapping contours merged (see base.css), the face the design uses.
 * Measured on the art: "SERVICES" is ~793px wide with ~114px letters, which is
 * Inter Black at ~157px (0.1208 of the 1300px frame).
 */
.services-title {
	margin-bottom: var(--space-10);
	color: transparent;
	font-family: "Inter Outline", sans-serif;
	font-size: clamp(3rem, calc(var(--frame-width) * 0.1208), 9.8rem);
	font-weight: 900;
	letter-spacing: 0;
	line-height: 1;
	text-align: center;
	text-transform: uppercase;
}

@supports (-webkit-text-stroke: 2px white) {
	.services-title {
		-webkit-text-stroke: 2px var(--color-primary);
	}
}

/* Fallback where text-stroke is unsupported: solid rather than invisible. */
@supports not (-webkit-text-stroke: 2px white) {
	.services-title {
		color: var(--color-primary);
	}
}

.services-grid {
	display: grid;
	gap: var(--space-12);
	grid-template-columns: 1fr;
}

.services-row {
	display: grid;
	gap: var(--space-12);
	grid-template-columns: 1fr;
}

.service-block {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.service-block__figure {
	margin: 0;
}

.service-block__figure img {
	width: 100%;
	height: auto;
}

.service-block__label {
	display: flex;
	flex-direction: column;
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(2.25rem, calc(var(--frame-width) * 0.055), 4.5rem);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
	line-height: 0.95;
	text-transform: uppercase;
}

.service-block__label--primary .service-block__word {
	color: var(--color-primary);
}

.service-block__label--gold .service-block__word {
	color: var(--color-accent);
}

.service-block__label--dark .service-block__word {
	color: var(--nac-black-pure);
}

/* "DISCOUNT" over "AUTO", and "PET" over "INSURANCE" — the art pairs a
   smaller word with the main one in a contrasting colour. */
.service-block__eyebrow {
	color: var(--color-primary);
	font-size: 0.6em;
}

.service-block__subtitle {
	font-size: 0.62em;
}

/* The art varies this per block, so it cannot follow the main word's tone:
   black under Discount, burgundy under Pet. */
.service-block__subtitle--primary {
	color: var(--color-primary);
}

.service-block__subtitle--dark {
	color: var(--nac-black-pure);
}

.service-block__body {
	font-size: var(--fs-sm);
	line-height: 1.45;
}

.service-block__cta {
	color: var(--color-text);
	font-weight: var(--fw-bold);
	text-decoration: underline;
	white-space: nowrap;
}

.service-block__cta:hover,
.service-block__cta:focus {
	color: var(--color-primary);
}

/* -------------------------------------------------------------------
 * Desktop: the two-column staggered composition from the art.
 *
 * Below this the blocks simply stack in one column with horizontal
 * labels — the rotated text and the stagger do not survive a narrow
 * screen, and the art offers no mobile version.
 * ------------------------------------------------------------------- */

@media (min-width: 900px) {
	/*
	 * Placed inside the 1300px art frame, not across the page: the frame is
	 * centred, so a page wider than it adds the same inset on each side.
	 * Below 1300px the inset is 0 and this is the old 76.5385% / 13.4615%.
	 */
	.services-band {
		width: calc(var(--frame-width) * 0.765385);                          /* 995 / 1300 */
		margin-inline: calc((100% - var(--frame-width)) / 2 + var(--frame-width) * 0.134615) auto;   /* 175 / 1300 — offset right, not centred */
	}

	/*
	 * The decorative line, drawn as background layers on each row.
	 *
	 * The art runs one continuous line down the section: down the left of the
	 * first row, across its foot, down the right of the second, across, and so
	 * on, closing on a dot under the last pair. Every crossing therefore sits
	 * at a row's foot, and a row's height is whichever of its two blocks is
	 * taller — which is why the line is drawn here and not as an overlay. An
	 * overlay placed the crossings by proportion and two of the four landed
	 * inside a photo.
	 *
	 * The box is widened past the content band with equal negative margin and
	 * padding, so the rules reach the art's x 111 → 1188 while the blocks stay
	 * inside the 995px band.
	 */
	.services-row {
		position: relative;
		margin-inline: -64px -18px;    /* band 175 → the rule's 111, and 1170 → 1188 */
		padding-inline: 64px 18px;
		padding-bottom: var(--space-12);   /* the crossing sits this far under the blocks */
		/* Measured off the art: 452px and 487px cells with 56px between. */
		grid-template-columns: 452fr 487fr;
		column-gap: 5.6281%;            /* 56 / 995 */
		align-items: start;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			linear-gradient(var(--color-primary), var(--color-primary));
		background-repeat: no-repeat;
		/* the vertical, then the crossing at the row's foot */
		background-size: 1px 100%, 100% 1px;
	}

	.services-row--rule-left {
		background-position: left top, left bottom;
	}

	.services-row--rule-right {
		background-position: right top, left bottom;
	}

	/* The last crossing stops half way and drops to the closing dot. */
	.services-row--closes {
		background-size: 1px 100%, 50.14% 1px;   /* 540 / 1077 */
	}

	/*
	 * Where the line starts: a dot beside the SERVICES title, a short run left,
	 * then down into the first row. 100px above the row, and the dot 126px to
	 * the right of the vertical, as measured.
	 */
	.services-row:first-child::before {
		position: absolute;
		bottom: 100%;
		left: 0;
		width: 134px;
		height: 108px;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			linear-gradient(var(--color-primary), var(--color-primary)),
			radial-gradient(circle at 50% 50%, var(--color-primary) 7px, transparent 7.5px);
		background-position: left 8px, left 8px, left 118px top 0;
		background-repeat: no-repeat;
		background-size: 1px 100px, 126px 1px, 16px 16px;
		content: "";
	}

	/* Where it ends: a drop from the half-width crossing to the closing dot. */
	.services-row--closes::after {
		position: absolute;
		top: 100%;
		left: calc(50.14% - 8px);
		width: 16px;
		height: 71px;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			radial-gradient(circle at 50% 50%, var(--color-primary) 7px, transparent 7.5px);
		background-position: 50% 0, left 0 top 55px;
		background-repeat: no-repeat;
		background-size: 1px 63px, 16px 16px;
		content: "";
	}

	.service-block--left {
		grid-column: 1;
	}

	.service-block--right {
		grid-column: 2;
		/* The right column sits lower, as measured in the art. */
		margin-top: var(--space-16);
	}

	/*
	 * Business spans the band. The art gives it the same 124px left gutter the
	 * rotated labels create, then a 468px photo and a 341px text column, with
	 * ~13px of slack at the right that the ragged text absorbs.
	 *
	 * It used to carry `border: 1px solid` here, on the reading that Business
	 * was "a wider block inside a thin rule". It is not: that rule is one run
	 * of the section-wide decorative line, which belongs to .services-row.
	 */
	.service-block--wide {
		grid-column: 1 / -1;
		display: grid;
		/* Percentages of the block's content box, i.e. the band less the
		   gutter: 871px. */
		grid-template-columns: 53.73% 39.15%;
		column-gap: 5.63%;
		align-items: start;
		padding-left: 12.4623%;         /* 124 / 995 */
		row-gap: var(--space-4);
	}

	.service-block--wide .service-block__figure {
		grid-row: 1;
	}

	.service-block--wide .service-block__label {
		grid-row: 2;
	}

	.service-block--wide .service-block__body {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	/*
	 * Left blocks put the label on its side, reading bottom-to-top in its own
	 * gutter beside the photo — the art's most distinctive device.
	 *
	 * The 124fr / 328fr split is load-bearing. This was `auto 1fr`, so the
	 * photo took every pixel left in the container and rendered 461px wide
	 * instead of 328, swallowing the gutter and pushing the label against it.
	 */
	.service-block--left {
		display: grid;
		grid-template-columns: 124fr 328fr;
		column-gap: 0;
		row-gap: var(--space-4);
	}

	/*
	 * The rotation lives on the word, never on the <h3>.
	 *
	 * `writing-mode` is inherited, so setting it on the heading rotated the
	 * eyebrow and the subtitle along with it — which is what stacked all three
	 * parts of the Discount label vertically and clipped the final E of
	 * "DEFENSIVE DRIVING COURSE". Keeping it on the word makes that class of
	 * bug unreachable.
	 */
	.service-block--left .service-block__word {
		writing-mode: vertical-rl;
		transform: rotate(180deg);
	}

	.service-block--left:not(.service-block--split) .service-block__label {
		grid-column: 1;
		grid-row: 1;
		align-self: end;
	}

	.service-block--left:not(.service-block--split) .service-block__figure {
		grid-column: 2;
		grid-row: 1;
	}

	.service-block--left:not(.service-block--split) .service-block__body {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	/*
	 * Discount: the one block where the art splits the label's three parts
	 * across three positions — "Discount" horizontal above the photo, "Auto"
	 * rotated in the gutter, "Defensive Driving Course" horizontal below.
	 *
	 * `display: contents` drops the <h3> as a box so its spans become grid
	 * items of the block itself. That keeps one semantic heading per block
	 * (and one accessible name, "Discount Auto Defensive Driving Course")
	 * rather than breaking the three parts out as loose sibling elements.
	 */
	.service-block--split .service-block__label {
		display: contents;
	}

	.service-block--split .service-block__eyebrow {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.service-block--split .service-block__word {
		grid-column: 1;
		grid-row: 2;
		align-self: end;
	}

	.service-block--split .service-block__figure {
		grid-column: 2;
		grid-row: 2;
	}

	.service-block--split .service-block__subtitle {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	.service-block--split .service-block__body {
		grid-column: 1 / -1;
		grid-row: 4;
	}
}

/* ===================================================================
 * Section 8 — FROM OUR HAPPY CLIENTS
 *
 * The art pastes Google's review UI rather than restyling it, so both the
 * arrangement and the type sizes here are Google's, measured off the art in
 * frame px:
 *
 *   section      166 from its top to the heading's cap; 800 tall overall
 *   frame rule   top at 278, bottom at 696, x 111 → 1189 (1078 wide)
 *   wordmark     191×64, its top 55 below the top rule
 *   stars        117×20, 6 below the wordmark, 91 above the cards
 *   cards        311 wide, 47 apart, the row 1027
 *   card type    name 12 (cap 8.6), body 10 (cap 7.1) / 14 line, stars 9
 *   avatar       23
 *
 * Those card sizes are ~40% smaller than the body copy elsewhere in the SAME
 * artwork (~17px), because the card is a paste of Google's interface at
 * whatever scale the designer's screenshot had. They are reproduced anyway, on
 * an explicit instruction to match the design. If that is ever revisited, the
 * values to change are the four font-sizes in the desktop block below.
 *
 * Only the desktop composition uses them: below the breakpoint the cards go
 * full width, there is no art to match, and 10px body copy on a phone would be
 * indefensible, so the type falls back to the site's own scale.
 * =================================================================== */

/*
 * No max width of its own, deliberately: the decorative frame inside is
 * 1078px and centres itself against the full 1300px sheet, so constraining
 * this wrapper would offset it. The inline padding is only a gutter for
 * narrow screens, and being symmetric it does not move the frame's centre.
 */
.reviews-band {
	padding-inline: var(--space-5);
}

.home-reviews {
	padding-block:
		clamp(var(--space-12), calc(var(--frame-width) * 0.12), 156px)
		clamp(var(--space-10), calc(var(--frame-width) * 0.08), 104px);
}

/*
 * Attribution, not a rating: the wordmark and five stars say "these are Google
 * reviews". There is no aggregate score behind them — by decision they are
 * neither editable nor computed — which is why the star row is passed as
 * decorative and carries no accessible name.
 */
.reviews-source {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin-block: 0 var(--space-10);
}

.reviews-source__logo {
	width: 191px;
	height: auto;
}

.review-stars {
	display: inline-flex;
	gap: 1px;
	line-height: 0;
}

.review-stars__star {
	width: 1em;
	height: 1em;
	fill: #f2bf42;   /* sampled from the art; not a brand token */
}

.review-stars__star--empty {
	fill: var(--nac-gray-300);
}

.review-stars--attribution {
	font-size: 23px;   /* 117 / 5 in the art */
}

.review-stars--card {
	font-size: 9px;
}

.review-cards {
	display: grid;
	gap: var(--space-8);
	grid-template-columns: 1fr;
	margin: 0;
	padding: 0;
	list-style: none;
}

.review-card__head {
	display: grid;
	align-items: center;
	column-gap: var(--space-2);
	grid-template-columns: 23px 1fr auto;
	row-gap: var(--space-1);
	margin-bottom: var(--space-3);
}

.review-card__avatar {
	grid-column: 1;
	grid-row: 1;
	width: 23px;
	height: 23px;
	border-radius: 50%;
	object-fit: cover;
}

/*
 * Google's generated avatar when no image was uploaded: a flat coloured circle
 * with the initial. Drawn here rather than shipped as an image so it stays
 * sharp at any pixel density — the art's own are 33px rasters.
 */
.review-card__avatar--initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--avatar-colour, var(--color-primary));
	color: var(--nac-white);
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: var(--fw-bold);
	line-height: 1;
}

.review-card__name {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
}

/*
 * Google's overflow menu, copied because the art copies it. It links to
 * nothing, so it is hidden from assistive tech in the markup rather than left
 * as an unlabelled control, and it is not focusable.
 */
.review-card__menu {
	grid-column: 3;
	grid-row: 1;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background-color: var(--color-text-muted);
	box-shadow:
		0 -5px 0 var(--color-text-muted),
		0 5px 0 var(--color-text-muted);
}

/* Stars and date share a row, as the art pairs them. */
.review-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	grid-column: 1 / -1;
	grid-row: 2;
	margin: 0;
}

.review-card__date {
	color: var(--color-text-muted);
	font-size: var(--fs-xs);
}

.review-card__text {
	font-size: var(--fs-xs);
	line-height: 1.45;
}

.review-card__text p {
	margin-block: 0 var(--space-3);
}

.review-card__text p:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------
 * Desktop: the art's own measurements, and the decorative line.
 * ------------------------------------------------------------------- */

@media (min-width: 900px) {
	/* Cap bottom 201 to the top rule at 278, less the line box's descent. */
	.reviews-heading {
		margin-bottom: 67px;
	}

	/*
	 * The decorative line, drawn as background layers on the element it
	 * frames rather than as an overlay positioned over the section.
	 *
	 * This is the whole point of the construction: the art puts the bottom
	 * rule 76px BELOW the tallest card, which is a relation to the content,
	 * not a position in the section. An overlay stretched over the section
	 * placed it proportionally, and it crossed straight through a review.
	 * Here the bottom rule is this element's own bottom edge, so it cannot.
	 *
	 * Fixed measurements stay in px (the 116 and 72px stubs, the 16px dots);
	 * everything that follows the content is a percentage.
	 */
	.reviews-frame {
		position: relative;
		width: 1078px;          /* art: x 111 → 1189 */
		max-width: 100%;
		margin-inline: auto;
		padding: 55px 25px 76px;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			linear-gradient(var(--color-primary), var(--color-primary)),
			linear-gradient(var(--color-primary), var(--color-primary));
		background-position: left top, left top, left bottom;
		background-repeat: no-repeat;
		/* top rule, left rule, bottom rule (stopping at the art's x 651). */
		background-size: 100% 1px, 1px 100%, 50.09% 1px;
	}

	/* The stub up to the dot beside the heading, at the frame's right edge. */
	.reviews-frame::before {
		position: absolute;
		top: -116px;
		right: -8px;
		width: 16px;
		height: 116px;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			radial-gradient(circle at 50% 8px, var(--color-primary) 7px, transparent 7.5px);
		background-position: 50% 0, 0 0;
		background-repeat: no-repeat;
		background-size: 1px 100%, 100% 16px;
		content: "";
	}

	/* The stub down to the closing dot, where the bottom rule ends. */
	.reviews-frame::after {
		position: absolute;
		bottom: -72px;
		left: calc(50.09% - 8px);
		width: 16px;
		height: 72px;
		background-image:
			linear-gradient(var(--color-primary), var(--color-primary)),
			radial-gradient(circle at 50% calc(100% - 8px), var(--color-primary) 7px, transparent 7.5px);
		background-position: 50% 0, 0 100%;
		background-repeat: no-repeat;
		background-size: 1px 100%, 100% 16px;
		content: "";
	}

	.reviews-source {
		margin-bottom: 91px;
	}

	.review-cards {
		grid-template-columns: repeat(3, 1fr);
		column-gap: 4.574%;   /* 47 / 1027 */
		align-items: start;
	}

	/* The art's card type sizes — see the note at the top of this section. */
	.review-card__name {
		font-size: 12px;
	}

	.review-card__date,
	.review-card__text {
		font-size: 10px;
	}

	.review-card__text {
		line-height: 1.4;   /* 14 / 10 in the art */
	}

	.review-card__head {
		margin-bottom: 17px;
		row-gap: 4px;
	}

	.review-card__text p {
		margin-block: 0 var(--space-2);
	}
}

/* -------------------------------------------------------------------
 * Slider: more reviews than fit the row (main.js, reviewSlider)
 *
 * Every card sits in row 1 of the same grid and only the active group is
 * visible. Stacking them, rather than moving them, is what keeps the height
 * still: the row is as tall as the tallest card, whatever group is showing.
 *
 * From 900px the grid has six columns and a card spans two of them, which is
 * the art's three-up row (the gap is the same column-gap, so each card comes
 * out the same width). That is what lets a last group of one or two cards be
 * centred: main.js writes each card's start column into --review-start.
 * Below 900px one card shows at a time, in the single column.
 *
 * The old group fades out, then the new one fades in, so two reviews never
 * overlap as text.
 * ------------------------------------------------------------------- */

.review-cards.is-slider .review-card {
	grid-row: 1;
	grid-column: 1;
	opacity: 0;
	transition:
		opacity 400ms ease,
		visibility 400ms;
	visibility: hidden;
}

.review-cards.is-slider .review-card.is-active {
	opacity: 1;
	transition-delay: 400ms;
	visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
	.review-cards.is-slider .review-card,
	.review-cards.is-slider .review-card.is-active {
		transition-duration: 0ms;
		transition-delay: 0ms;
	}
}

@media (min-width: 900px) {
	.review-cards.is-slider {
		grid-template-columns: repeat(6, 1fr);
	}

	.review-cards.is-slider .review-card {
		grid-column: var(--review-start, 1) / span 2;
	}
}

.review-slider__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-4);
	margin-top: var(--space-8);
}

.review-slider__dots {
	display: flex;
	gap: 2px;
}

/* 24px hit area around a 10px dot. */
.review-slider__dot,
.review-slider__pause {
	display: grid;
	width: 24px;
	height: 24px;
	place-items: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-primary);
	cursor: pointer;
}

.review-slider__dot::before {
	width: 10px;
	height: 10px;
	box-sizing: border-box;
	border: 1px solid currentColor;
	border-radius: 50%;
	content: "";
	transition: background-color var(--transition-fast);
}

.review-slider__dot[aria-current="true"]::before {
	background-color: currentColor;
}

/* Pause is two bars, play a triangle; both drawn so they stay sharp. */
.review-slider__pause::before {
	width: 10px;
	height: 12px;
	background:
		linear-gradient(currentColor, currentColor) left / 3px 100% no-repeat,
		linear-gradient(currentColor, currentColor) right / 3px 100% no-repeat;
	content: "";
}

.review-slider__pause[aria-pressed="true"]::before {
	background: currentColor;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Section 9 — REPRESENTING OVER 50 CARRIERS
 * -------------------------------------------------------------------
 * The wall itself (.carrier-wall) is in main.css: /carriers/ uses it too.
 * ------------------------------------------------------------------- */

.home-carriers {
	padding-block: var(--space-16);
}

