/* ==========================================================================
   Dunes — main stylesheet
   1. Design tokens
   2. Reset
   3. Base typography
   4. Layout
   5. Components (eyebrow, buttons)
   6. Header
   7. Drawer (hamburger menu)
   8. Home: Hero
   9. Home: Intro
   10. Carousel (shared)
   11. Home: Services
   12. Home: Testimonial
   13. FAQ (home + insurance pages)
   14. Page banner
   15. Insurance page template
   16. Forms (Gravity Forms)
   17. Footer
   18. Accessibility
   19. WordPress core classes
   ========================================================================== */

/* 1. Design tokens
   -------------------------------------------------------------------------- */
:root {
	/* Colors */
	--color-bg: #ffffff;
	--color-text: #000000;
	--color-heading: #1f6088;
	--color-accent: #05bdbb;
	--color-button: #edaf42;
	--color-button-text: #ffffff;
	--color-focus: #1f6088;
	--color-surface: #efebe5; /* Warm section background: testimonial, "Other Insurance", and the FAQ above its photo */
	--color-quote: #5f6a75;   /* Testimonial text (4.7:1 on --color-surface) */
	--color-footer-hover: #c5dbea; /* Light blue link hover on the footer (4.8:1) */
	--mobile-bar-h: clamp(4.5rem, 15vw, 5.625rem); /* Fixed call/estimate bar on phones */

	/* Fonts (Adobe Fonts kit mat2vmd) */
	--font-body: "montserrat", sans-serif;
	--font-heading: "hardcover-vf", Georgia, serif;

	/* Layout */
	--container-max: 75rem;
	--gutter: clamp(1rem, 3vw, 2rem);
	--header-h: 5.5rem;

	/* Motion */
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scrollbar-gutter: stable;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-weight: 400;
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); /* 16px mobile → 18px desktop */
	line-height: 1.6;
	color: var(--color-text);
	background: var(--color-bg) url("../images/bg-texture.webp") repeat center top;
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
}

/* 3. Base typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	font-family: var(--font-heading);
	font-weight: 300;
	font-variation-settings: "wght" 300;
	line-height: 1.1;
	color: var(--color-heading);
	text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 5.5rem); }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.6875rem); } /* max 59px */
h3 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem); }
h4 { font-size: 1.375rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p,
ul,
ol {
	margin: 0 0 1em;
}

a {
	color: var(--color-heading);
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 2px;
}

/* 4. Layout
   -------------------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Push page content below the header, which overlays the top of the page.
   The home page hero will override this so it sits behind the header. */
.site-main {
	padding-top: var(--header-h);
}

/* 5. Components
   -------------------------------------------------------------------------- */

/* Eyebrow: small label above a headline. */
.eyebrow {
	display: block;
	margin-bottom: 0.75rem;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1.125rem); /* 14px → 18px */
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-accent);
}

/* Buttons. Use on <a> or <button>. Hover/focus swaps background and text color.
   The top padding is slightly larger than the bottom on purpose: Adobe's
   Montserrat reserves extra space below the baseline for descenders, and
   all-caps text has none, so equal padding makes the text look raised.
   The 0.055em offset re-centers the capital letters. */
.btn {
	--btn-pad-y: 0.8em;
	--btn-optical: 0.055em;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 2.75rem; /* 44px touch target */
	padding:
		calc(var(--btn-pad-y) + var(--btn-optical))
		2.25em
		calc(var(--btn-pad-y) - var(--btn-optical));
	font-family: var(--font-body);
	font-weight: 600;
	font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem); /* 15px → 17px */
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-button-text);
	background-color: var(--color-button);
	border: 2px solid var(--color-button);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
	color: var(--color-button);
	background-color: var(--color-button-text);
}

/* Outline variant (white background, gold border and text). */
.btn--outline {
	color: var(--color-button);
	background-color: var(--color-button-text);
}

.btn--outline:hover,
.btn--outline:focus-visible {
	color: var(--color-button-text);
	background-color: var(--color-button);
}

/* Text link: gold, turns blue on hover (e.g. "Read More Reviews >"). */
.text-link {
	font-weight: 600;
	font-size: 1rem;
	color: var(--color-button);
	text-decoration: none;
	transition: color 0.2s ease;
}

.text-link:hover,
.text-link:focus-visible {
	color: var(--color-heading);
}

/* 6. Header
   -------------------------------------------------------------------------- */
.site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background-color: rgb(255 255 255 / 0.35);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--header-h);
	padding-inline: var(--gutter);
}

.site-header__logo {
	flex-shrink: 0;
}

.site-header__logo img {
	width: clamp(10.375rem, 7rem + 9vw, 17.5rem); /* ~169px at 640, ~242px at 1440, max 280px */
}

.header-nav {
	display: flex;
	align-items: center;
}

.header-nav__list {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-nav__list li {
	position: relative;
}

.header-nav__list a,
.menu-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.5rem 1rem;
	font-family: var(--font-heading);
	font-weight: 400;
	font-variation-settings: "wght" 400;
	font-size: 1.0625rem;
	line-height: 1;
	color: var(--color-heading);
	text-decoration: none;
}

.header-nav__list a:hover,
.header-nav__list a[aria-current="page"],
.menu-toggle:hover .menu-toggle__label {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* Short vertical dividers between items (decorative, not read aloud). */
.header-nav__list li + li::before,
.header-nav__list + .menu-toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	height: 1em;
	border-left: 1px solid var(--color-heading);
	transform: translateY(-50%);
}

.menu-toggle {
	position: relative;
	margin: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.menu-toggle__icon {
	width: 1.25rem;
	height: 1.25rem;
}

/* Phones: just the logo and a larger hamburger icon. The header links move
   into the drawer, and the "Menu" label is hidden visually but still read
   by screen readers, so the button keeps its name. */
@media (max-width: 39.99em) {
	:root {
		--header-h: 4rem;
	}

	.site-header__logo img {
		width: 9.75rem;
	}

	.header-nav__list {
		display: none;
	}

	.header-nav__list + .menu-toggle::before {
		display: none;
	}

	.menu-toggle {
		margin-right: -0.5rem; /* Optically align the icon with the page edge. */
		padding: 0.5rem;
	}

	.menu-toggle__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.menu-toggle__icon {
		width: 2.25rem;
		height: 2.25rem;
	}

	.menu-toggle__icon path {
		stroke-width: 2.6; /* Heavier lines, as in the mobile comp. */
	}
}

/* 7. Drawer (hamburger menu)
   -------------------------------------------------------------------------- */
.drawer {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(26rem, 100%);
	max-width: 100%;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	color: var(--color-text);
	background: var(--color-bg) url("../images/bg-texture.webp") repeat center top;
	border: 0;
	box-shadow: -0.5rem 0 2rem rgb(0 0 0 / 0.15);
	transform: translateX(100%);
	transition:
		transform 0.35s var(--ease),
		overlay 0.35s allow-discrete,
		display 0.35s allow-discrete;
}

.drawer[open] {
	transform: translateX(0);
}

/* Slide-in starting point (browsers without support simply show it). */
@starting-style {
	.drawer[open] {
		transform: translateX(100%);
	}
}

.drawer::backdrop {
	background-color: rgb(0 0 0 / 0);
	transition:
		background-color 0.35s ease,
		overlay 0.35s allow-discrete,
		display 0.35s allow-discrete;
}

.drawer[open]::backdrop {
	background-color: rgb(0 0 0 / 0.45);
}

@starting-style {
	.drawer[open]::backdrop {
		background-color: rgb(0 0 0 / 0);
	}
}

/* Stop the page behind from scrolling while the drawer is open. */
html:has(.drawer[open]) {
	overflow: hidden;
}

.drawer__inner {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	padding: 1.25rem 2rem 3rem;
}

.drawer__close {
	display: grid;
	place-items: center;
	align-self: flex-end;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0 -0.5rem 1rem 0;
	padding: 0;
	color: var(--color-heading);
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.drawer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.drawer__list a {
	display: block;
	padding: 0.5rem 0;
	font-family: var(--font-heading);
	font-weight: 300;
	font-variation-settings: "wght" 300;
	font-size: 1.75rem;
	line-height: 1.2;
	color: var(--color-heading);
	text-decoration: none;
}

.drawer__list a:hover,
.drawer__list a[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

.drawer__list .sub-menu {
	margin: 0 0 0.5rem;
	padding-left: 1rem;
	list-style: none;
}

.drawer__list .sub-menu a {
	padding: 0.375rem 0;
	font-size: 1.25rem;
}

/* Header links only appear in the drawer on small screens. */
.drawer__list--primary {
	display: none;
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid rgb(31 96 136 / 0.25);
}

@media (max-width: 39.99em) {
	.drawer__list--primary {
		display: block;
	}
}

/* 8. Home: Hero
   -------------------------------------------------------------------------- */

/* The hero sits behind the header on the home page. */
.home .site-main {
	padding-top: 0;
}

.hero {
	/* Lets children size things relative to the hero's width (cqw units). */
	container-type: inline-size;
	position: relative;
	display: grid;
	align-items: center;
	min-height: clamp(38rem, 52vw, 62rem);
}

/* --------------------------------------------------------------------------
   Background media + wave mask
   The mask has two layers: a solid block for everything above the wave, and
   the wave SVG along the bottom. The wave keeps its proportions at any width
   (120 / 1717 = 6.99% of the width tall) instead of stretching.
   -------------------------------------------------------------------------- */
/* The same wave also shapes the bottom of the page banner (section 14). */
.hero__media,
.page-banner__media {
	--wave-h: 6.99cqw;

	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;

	-webkit-mask-image: linear-gradient(#000 0 0), url("../images/hero-wave.svg");
	mask-image: linear-gradient(#000 0 0), url("../images/hero-wave.svg");
	-webkit-mask-size: 100% calc(100% - var(--wave-h) + 1px), 100% var(--wave-h);
	mask-size: 100% calc(100% - var(--wave-h) + 1px), 100% var(--wave-h);
	-webkit-mask-position: top left, bottom left;
	mask-position: top left, bottom left;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.hero__poster,
.hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Video fades in over the poster once it's actually playing. */
.hero__video {
	opacity: 0;
	transition: opacity 0.6s ease;
}

.hero__video.is-ready {
	opacity: 1;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 2.5rem;
	width: 100%;
	max-width: calc(95.3125rem + 2 * var(--gutter)); /* 1525px of content */
	margin-inline: auto;
	padding:
		calc(var(--header-h) + clamp(2rem, 5vw, 4rem))
		var(--gutter)
		calc(6.99cqw + clamp(2.5rem, 5vw, 5rem));
}

.hero__title {
	margin: 0;
	font-size: clamp(3.25rem, 1.25rem + 5.6vw, 7.5rem); /* max 120px (phones set their own size below) */
	line-height: 1;
}

.hero__title-line {
	display: block;
}

/* Note: the Adobe Fonts kit needs Hardcover's italic style for a true italic. */
.hero__title-line--accent {
	margin-left: -0.08em; /* Optical alignment: italics lean, so pull it left. */
	font-style: italic;
	color: var(--color-accent);
}

.hero__content {
	max-width: 43.75rem; /* 700px */
}

.hero__content .eyebrow {
	margin-bottom: 1.875rem;
}

.hero__heading {
	margin-bottom: 0.6em;
	font-size: clamp(1.75rem, 1rem + 2.1vw, 3.0625rem); /* max 49px */
}

.hero__text {
	margin-bottom: 3.25rem;
}

.hero__text > :last-child {
	margin-bottom: 0;
}

@media (min-width: 60em) {
	.hero__inner {
		/* Side padding grows with the screen (32px up to 96px) instead of
		   staying at the page gutter, so the headline and content never hug
		   the edges as the window narrows. At 1920px the layout is unchanged:
		   the box max-width grows by the same amount as the padding. */
		--hero-pad: clamp(2rem, 7vw, 6rem);

		grid-template-columns: 1.1fr 1fr;
		align-items: end; /* Content bottom lines up with "Local." as in the comp. */
		gap: 4rem;
		max-width: calc(95.3125rem + 2 * var(--hero-pad));
		padding-inline: var(--hero-pad);
	}

	.hero__content {
		justify-self: end;
	}
}

/* Phones (home page): the H1 stays over the video, and the intro text and
   button move below the wave, centered. The hero becomes a two-row grid;
   .hero__inner steps aside (display: contents) so its children can sit in
   different rows, and the video is pinned to the first row only. */
@media (max-width: 39.99em) {
	.hero {
		grid-template-areas:
			"top"
			"content";
		align-items: stretch;
		min-height: 0;
	}

	.hero__inner {
		display: contents;
	}

	.hero__media,
	.hero__video-toggle {
		grid-area: top;
	}

	.hero__title,
	.hero__content {
		position: relative;
		z-index: 1; /* Above the video. */
	}

	.hero__title {
		grid-area: top;
		font-size: clamp(3rem, 12.8vw, 5rem); /* Larger relative to the screen than on desktop. */
		line-height: 0.95;
		padding:
			calc(var(--header-h) + clamp(2rem, 8vw, 3rem))
			clamp(1.5rem, 10vw, 4rem)
			calc(6.99cqw + clamp(1rem, 4vw, 1.75rem));
	}

	.hero__content {
		grid-area: content;
		justify-self: center;
		max-width: 34rem;
		padding: clamp(2rem, 9vw, 3.25rem) var(--gutter) clamp(2rem, 7vw, 3rem);
		text-align: center;
	}

	.hero__content .eyebrow {
		font-size: clamp(0.875rem, 2.75vw, 1.125rem);
	}

	.hero__heading {
		font-size: clamp(1.375rem, 5.8vw, 2.25rem); /* Stays on one line, as in the comp. */
	}

	.hero__text {
		margin-bottom: 2rem;
	}
}

/* --------------------------------------------------------------------------
   Video pause/play button
   -------------------------------------------------------------------------- */
.hero__video-toggle {
	position: absolute;
	right: var(--gutter);
	bottom: calc(6.99cqw + 1rem);
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	color: var(--color-heading);
	background-color: rgb(255 255 255 / 0.8);
	border: 1px solid rgb(31 96 136 / 0.3);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.hero__video-toggle[hidden] {
	display: none;
}

.hero__video-toggle:hover {
	background-color: #ffffff;
}

.hero__video-toggle[data-state="playing"] .hero__icon-play,
.hero__video-toggle[data-state="paused"] .hero__icon-pause {
	display: none;
}

/* 9. Home: Intro ("Securing Your Peace of Mind")
   -------------------------------------------------------------------------- */
.intro {
	--intro-radius: clamp(1.25rem, 0.5rem + 2vw, 2.3125rem); /* 37px on desktop */

	position: relative;
	z-index: 1; /* Sits above the hero's video where the two overlap. */
	padding-bottom: clamp(4rem, 6vw, 7rem);
}

.intro__inner {
	display: grid;
	width: 100%;
	max-width: calc(82.25rem + 2 * var(--gutter)); /* 1316px of content */
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.intro__image {
	width: 100%;
	height: auto;
	object-fit: cover;
	border-radius: var(--intro-radius);
}

.intro__image--landscape {
	aspect-ratio: 800 / 564;
}

/* Photoshop drop shadow: 14% black, distance 7px, spread 18%, size 43px. */
.intro__image--portrait {
	position: relative;
	z-index: 1; /* Overlaps the landscape photo. */
	aspect-ratio: 652 / 864;
	box-shadow: 0 7px 35px 8px rgb(0 0 0 / 0.14);
}

.intro__heading {
	margin-bottom: 0.55em;
}

.intro__text {
	margin-bottom: 2.75rem;
}

.intro__text > :last-child {
	margin-bottom: 0;
}

/* Phones and tablets: landscape photo, then text. The portrait photo is
   hidden; it's lazy-loaded, so hidden means it's never downloaded either. */
@media (max-width: 55.99em) {
	.intro__inner {
		gap: 2.5rem;
	}

	.intro__image--portrait {
		display: none;
	}
}

/* Phones: centered, to match the hero content just above it. */
@media (max-width: 39.99em) {
	.intro__content {
		text-align: center;
	}
}

/* Desktop: overlapping layout from the comp.
   Columns (at 1316px): 664px | 136px | 516px
   - Landscape spans columns 1–2 (800px).
   - Portrait spans columns 2–3 (652px), overlapping the landscape by 136px.
   - Text sits in column 1, under the landscape. */
@media (min-width: 56em) {
	.intro {
		--intro-parallax: 6rem; /* How far the portrait drifts each way. */

		/* Pull the section up so the landscape photo overlaps the hero's wave. */
		margin-top: -6.99vw;
	}

	.intro__inner {
		grid-template-columns: 664fr 136fr 516fr;
		/* Row 1 hugs the landscape photo; any extra height the portrait
		   needs goes to row 2, so the text keeps its spacing. */
		grid-template-rows: auto 1fr;
	}

	.intro__image--landscape {
		grid-column: 1 / 3;
		grid-row: 1;
	}

	.intro__image--portrait {
		grid-column: 2 / 4;
		grid-row: 1 / 3;
		align-self: start;
		margin-top: 46.93%; /* 306px down from the landscape's top (306 / 652). */
	}

	.intro__content {
		grid-column: 1;
		grid-row: 2;
		max-width: 34.25rem; /* 548px */
		padding-top: clamp(3rem, 5.8vw, 7rem);
	}
}

/* Portrait photo (desktop only): drifts upward while scrolling.
   Uses CSS scroll-driven animations (no JavaScript). Browsers without
   support, and visitors with reduced motion turned on, see the photo
   in place with no effect. */
@supports (animation-timeline: view()) {
	@media (min-width: 56em) and (prefers-reduced-motion: no-preference) {
		.intro__image--portrait {
			animation: intro-parallax linear both;
			animation-timeline: view();
			animation-range: cover 0% cover 100%;
		}
	}
}

@keyframes intro-parallax {
	from { translate: 0 var(--intro-parallax); }
	to   { translate: 0 calc(-1 * var(--intro-parallax)); }
}

/* 10. Carousel (shared)
   Native horizontal scrolling with scroll-snap. Works with touch swipe,
   trackpads, and keyboard (Tab moves through links and scrolls them into
   view). JS adds the dots. Set how many slides show with --carousel-per-view.
   -------------------------------------------------------------------------- */
.carousel {
	--carousel-gap: 1rem;
	--carousel-per-view: 1;
	--carousel-focus-room: 0.375rem; /* Space so focus outlines aren't clipped. */
}

.carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(
		(100% - (var(--carousel-per-view) - 1) * var(--carousel-gap)) / var(--carousel-per-view)
	);
	gap: var(--carousel-gap);
	margin: calc(-1 * var(--carousel-focus-room));
	padding: var(--carousel-focus-room);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--carousel-focus-room);
	scrollbar-width: none;
	list-style: none;
}

.carousel__track::-webkit-scrollbar {
	display: none;
}

.carousel__track > * {
	scroll-snap-align: start;
}

@media (prefers-reduced-motion: no-preference) {
	.carousel__track {
		scroll-behavior: smooth;
	}
}

.carousel__dots {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-top: clamp(2.5rem, 4vw, 4.75rem);
}

.carousel__dots[hidden] {
	display: none;
}

/* 24×24px click target (WCAG 2.5.8) with a 10px visible dot. */
.carousel__dot {
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.carousel__dot::before {
	content: "";
	width: 0.625rem;
	height: 0.625rem;
	background-color: #dcdcdc;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.carousel__dot:hover::before {
	background-color: #c4c4c4;
}

.carousel__dot[aria-current="true"]::before {
	background-color: var(--color-button);
}

/* 11. Home: Services
   -------------------------------------------------------------------------- */
.services {
	padding-block: clamp(1rem, 3vw, 3.5rem) clamp(2.5rem, 5vw, 5rem);
}

.services__inner {
	width: 100%;
	max-width: calc(95.3125rem + 2 * var(--gutter)); /* 1525px, same as the hero */
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.services .carousel,
.ins-other .carousel,
.ins-cards .carousel {
	--carousel-gap: clamp(1rem, 3.2vw, 3.875rem); /* 62px on desktop */
	--carousel-per-view: 1.15; /* A peek of the next card hints that it scrolls. */
}

/* Phones and tablets: let the track run to the screen edges so the
   peeking card isn't cut off by the page margin. */
@media (max-width: 63.99em) {
	.services .carousel__track {
		margin-inline: calc(-1 * var(--gutter));
		padding-inline: var(--gutter);
		scroll-padding-inline: var(--gutter);
	}
}

/* Phones: one card centered, with a sliver of the cards on either side.
   Cards are 80% of the screen width; the 10% padding on each end lets the
   first and last cards center too. */
@media (max-width: 39.99em) {
	.services .carousel__track,
	.ins-other .carousel__track,
	.ins-cards .carousel__track {
		grid-auto-columns: 80vw;
		margin-inline: calc(-1 * var(--gutter)); /* Run to the screen edges */
		padding-inline: 10vw;
		scroll-padding-inline: 0;
	}

	.services .carousel__track > *,
	.ins-other .carousel__track > *,
	.ins-cards .carousel__track > * {
		scroll-snap-align: center;
	}
}

@media (min-width: 40em) {
	.services .carousel {
		--carousel-per-view: 2.15;
	}
}

@media (min-width: 64em) {
	.services .carousel {
		--carousel-per-view: 3;
	}
}

.service-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2rem clamp(1.5rem, 3vw, 2.75rem) 2.25rem;
	text-align: center;
	background-color: rgb(255 255 255 / 0.6);
	border: 1px solid rgb(31 96 136 / 0.18);
	border-radius: clamp(1.25rem, 0.5rem + 2vw, 2.5rem);
	transition: border-color 0.2s ease;
}

.service-card:hover {
	border-color: rgb(31 96 136 / 0.4);
}

.service-card__icon {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 5rem;
	height: 5rem;
	margin-bottom: 1.25rem;
	font-size: 2.25rem;
	color: var(--color-heading);
	background-color: #e4edf3;
	border-radius: 50%;
}

.service-card__title {
	margin-bottom: 0.4em;
	font-size: clamp(1.75rem, 1.5rem + 0.6vw, 2.25rem);
}

.service-card__text {
	margin-bottom: 0.75rem;
	line-height: 1.5;
}

.service-card__link {
	margin-top: auto; /* Keeps links lined up when card text lengths differ. */
	font-weight: 600;
	font-size: 1rem;
	color: var(--color-button);
	text-decoration: none;
	transition: color 0.2s ease;
}

/* Makes the whole card clickable through the one link. */
.service-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.service-card:hover .service-card__link,
.service-card__link:focus-visible {
	color: var(--color-heading);
}

/* Show keyboard focus around the whole card instead of just the link text. */
.service-card__link:focus-visible {
	outline: none;
}

.service-card:has(.service-card__link:focus-visible) {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* 12. Home: Testimonial
   -------------------------------------------------------------------------- */
/* .ins-other (insurance pages) shares this wave-top background. */
.testimonial,
.ins-other {
	/* Lets children size things relative to the section's width (cqw units). */
	container-type: inline-size;
	position: relative;
	isolation: isolate;
	text-align: center;
}

/* The background color sits on its own layer so the wave mask shapes
   only the background, never the content. Wave: 128 / 1920 = 6.667%. */
.testimonial::before,
.ins-other::before {
	--wave-h: 6.667cqw;

	content: "";
	position: absolute;
	inset: 0 0 -1px; /* 1px overlap so no sliver of page shows at the seam below */
	z-index: -1;
	background-color: var(--color-surface);

	-webkit-mask-image: url("../images/testimonial-wave.svg"), linear-gradient(#000 0 0);
	mask-image: url("../images/testimonial-wave.svg"), linear-gradient(#000 0 0);
	-webkit-mask-size: 100% var(--wave-h), 100% calc(100% - var(--wave-h) + 1px);
	mask-size: 100% var(--wave-h), 100% calc(100% - var(--wave-h) + 1px);
	-webkit-mask-position: top left, bottom left;
	mask-position: top left, bottom left;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.testimonial__inner {
	max-width: calc(68.25rem + 2 * var(--gutter)); /* ~1090px quote, as in the comp */
	margin-inline: auto;
	padding:
		calc(6.667cqw + clamp(2rem, 3.5vw, 3.75rem))
		var(--gutter)
		clamp(4rem, 7vw, 7rem);
}

.testimonial__icon {
	width: 4.0625rem; /* 65px */
	height: auto;
	margin: 0 auto clamp(2rem, 3.5vw, 3.5rem);
	color: var(--color-heading);
}

.testimonial__figure {
	margin: 0;
}

/* All quotes share one spot (stacked in the same grid cell), so the section
   is always as tall as the longest quote and nothing jumps when they change. */
.testimonial__rotator {
	margin-bottom: clamp(2.25rem, 3.8vw, 4rem);
}

.testimonial__slides {
	display: grid;
	align-items: center; /* Shorter quotes sit centered in the shared space. */
}

.testimonial__slides > .testimonial__figure {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden; /* Hidden quotes are skipped by screen readers too. */
	transition:
		opacity 0.6s ease,
		visibility 0s linear 0.6s;
}

.testimonial__slides > .testimonial__figure.is-active {
	opacity: 1;
	visibility: visible;
	transition:
		opacity 0.7s ease 0.6s, /* Waits until the old quote has faded out, so they never overlap. */
		visibility 0s;
}

.testimonial__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: clamp(1.5rem, 2.5vw, 2.25rem);
}

.testimonial__controls[hidden] {
	display: none;
}

.testimonial__dots {
	display: flex;
	gap: 0.25rem;
}

/* Pause/play: small circle beside the dots. */
.testimonial__toggle {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	color: var(--color-heading);
	background: #ffffff;
	border: 1px solid rgb(31 96 136 / 0.3);
	border-radius: 50%;
	cursor: pointer;
}

.testimonial__toggle:hover {
	border-color: var(--color-heading);
}

.testimonial__toggle[data-state="playing"] .testimonial__icon-play,
.testimonial__toggle[data-state="paused"] .testimonial__icon-pause {
	display: none;
}

.testimonial__quote {
	margin: 0;
	font-family: var(--font-heading);
	font-style: italic;
	font-weight: 300;
	font-variation-settings: "wght" 300;
	font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem); /* 22px → 30px */
	line-height: 1.65;
	color: var(--color-quote);
	text-wrap: pretty;
}

.testimonial__quote p {
	margin: 0;
}

/* Curly quotes added here so editors never have to type them. */
.testimonial__quote p::before,
.testimonial__quote p::after {
	position: relative;
	top: -0.05em;
	font-size: 1.3em;
	font-weight: 600;
	font-variation-settings: "wght" 600;
	line-height: 0;
}

.testimonial__quote p::before {
	content: "\201C";
	margin-right: 0.05em;
}

.testimonial__quote p::after {
	content: "\201D";
	margin-left: 0.15em;
}

.testimonial__name {
	margin-top: 1.25rem;
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
	color: var(--color-quote);
}

.testimonial .text-link {
	font-size: 1.125rem;
}

/* 13. FAQ (home page and Insurance Page template)
   -------------------------------------------------------------------------- */
.faq {
	position: relative;
	isolation: isolate;
	padding: clamp(2rem, 3.5vw, 3.5rem) var(--gutter) clamp(6rem, 13vw, 15.5rem);
	background-color: var(--color-surface); /* Continues the testimonial background. */
}

/* Background photo: starts a little below the top of the box and fades in
   from the section color, so there's no hard edge. */
.faq__bg {
	position: absolute;
	inset: clamp(3rem, 6vw, 7.5rem) 0 0;
	z-index: -1;
	width: 100%;
	height: calc(100% - clamp(3rem, 6vw, 7.5rem));
	object-fit: cover;
	object-position: center bottom;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
	mask-image: linear-gradient(to bottom, transparent, #000 30%);
}

.faq__inner {
	max-width: 82rem; /* 1312px box */
	margin-inline: auto;
}

/* Translucent white box (26%) around the questions. */
.faq__box {
	padding: clamp(2rem, 3vw, 3.5rem) clamp(0.75rem, 5vw - 0.5rem, 8.5rem) clamp(2.5rem, 5vw, 6rem);
	background-color: rgb(255 255 255 / 0.26);
	border-radius: clamp(1.25rem, 0.5rem + 2vw, 2rem);
}

.faq__heading {
	margin-bottom: clamp(1.25rem, 2vw, 1.75rem);
	font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); /* max 40px */
	text-align: center;
}

.faq__list {
	display: grid;
	gap: 1.25rem;
	max-width: 65.25rem; /* 1044px */
	margin-inline: auto;
	interpolate-size: allow-keywords; /* Lets the open/close height animate. */
}

.faq__item {
	background-color: rgb(255 255 255 / 0.7);
	border: 1px solid rgb(31 96 136 / 0.2);
	border-radius: 2.375rem; /* Pill shape when closed (76px tall). */
	transition: background-color 0.2s ease;
}

.faq__item[open] {
	background-color: rgb(255 255 255 / 0.85);
}

/* On phones the photo crops so the questions sit over the darker marsh
   grass; a more solid background keeps the text readable. */
@media (max-width: 39.99em) {
	.faq__item {
		background-color: rgb(255 255 255 / 0.88);
	}
}

.faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: calc(4.75rem - 2px); /* 76px including the border */
	padding: 1rem clamp(1.25rem, 3vw, 3.875rem) 1rem clamp(1.25rem, 3vw, 3.375rem);
	font-weight: 600;
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem); /* 16px → 20px */
	line-height: 1.35;
	color: var(--color-button);
	cursor: pointer;
	list-style: none;
	border-radius: inherit;
	transition: color 0.2s ease;
}

/* Hide the browser's default triangle. */
.faq__question::-webkit-details-marker {
	display: none;
}

.faq__question:hover {
	color: var(--color-heading);
}

.faq__question:focus-visible {
	outline-offset: -3px;
}

.faq__chevron {
	flex-shrink: 0;
	width: 1.625rem;
	height: 1.625rem;
	transition: transform 0.3s ease;
}

.faq__item[open] .faq__chevron {
	transform: rotate(180deg);
}

.faq__answer {
	padding: 0 clamp(1.25rem, 3vw, 3.875rem) 1.75rem clamp(1.25rem, 3vw, 3.375rem);
}

.faq__answer > :last-child {
	margin-bottom: 0;
}

/* Smooth open/close where supported (Chrome/Edge today). Other browsers
   open instantly, which works just as well. */
.faq__item::details-content {
	block-size: 0;
	overflow: hidden;
	transition:
		block-size 0.3s ease,
		content-visibility 0.3s allow-discrete;
}

.faq__item[open]::details-content {
	block-size: auto;
}

/* 14. Page banner (standard pages)
   Photo + wave, with the eyebrow and H1. Banner photos are faded by the
   designer before upload, so the theme shows them exactly as exported.
   -------------------------------------------------------------------------- */
.page-banner {
	/* Lets children size things relative to the banner's width (cqw units). */
	container-type: inline-size;
	position: relative;
	display: grid;
	align-items: center;
	min-height: clamp(18rem, 32vw, 38.5rem); /* ~615px at 1920 */
	margin-top: calc(-1 * var(--header-h)); /* Sits behind the header, like the hero. */
}

/* Wave mask comes from the shared .hero__media rule above. */
.page-banner__media {
	background-color: var(--color-surface); /* Shows if there's no image at all. */
}

.page-banner__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.page-banner__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* 1566px of content */
	margin-inline: auto;
	padding:
		calc(var(--header-h) + clamp(1.5rem, 3vw, 3rem))
		var(--gutter)
		calc(6.99cqw + clamp(2rem, 4vw, 4.5rem));
}

.page-banner .eyebrow {
	margin-bottom: 0.6rem;
}

.page-banner__title {
	margin: 0;
	font-size: clamp(2.25rem, 1.4rem + 2.4vw, 3.6875rem); /* max 59px */
}

/* Page content area (under the banner)
   A centered column capped at a comfortable reading width (~90 characters
   per line); wide and full-width blocks can still go wider.
   -------------------------------------------------------------------------- */
.page-content {
	padding-block: clamp(2.5rem, 5vw, 5rem) clamp(4rem, 8vw, 7.5rem);
}

.page-content__inner {
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as .page-banner__inner */
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Content column is centered on the page; text stays left-aligned. */
.page-content__inner > :not(.alignwide):not(.alignfull) {
	max-width: 60rem;
	margin-inline: auto;
}

.page-content__inner > :first-child {
	margin-top: 0;
}

.page-content__inner > :last-child {
	margin-bottom: 0;
}

/* Breathing room above headings inside the content. */
.page-content__inner > :is(h2, h3, h4) {
	margin-top: 1.6em;
}

/* 15. Insurance page template
   -------------------------------------------------------------------------- */

/* Intro: page content on the left, portrait photo on the right that
   overlaps the bottom of the banner. Matches the comp at 1920px:
   750px text | 164px space | 652px photo (same width as the banner text). */
.ins-intro {
	--ins-pad-top: clamp(2.5rem, 5.4vw, 6.5rem);

	position: relative;
	z-index: 1; /* Photo sits above the banner where they overlap. */
	padding-block: var(--ins-pad-top) clamp(3rem, 6.6vw, 8rem);
}

.ins-intro__inner {
	display: grid;
	gap: 2.5rem;
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as the banner text */
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.ins-intro__content {
	max-width: 46.875rem; /* 750px */
}

.ins-intro__content > :first-child {
	margin-top: 0;
}

.ins-intro__content > :last-child {
	margin-bottom: 0;
}

.ins-intro__content h2 {
	margin: 1.4em 0 0.7em;
	font-size: clamp(1.75rem, 1rem + 2.1vw, 3.125rem); /* max 50px */
}

.ins-intro__content p {
	margin-bottom: 1.6em;
}

.ins-intro__image {
	justify-self: center;
	width: 100%;
	max-width: 26rem;
	aspect-ratio: 652 / 864;
	object-fit: cover;
	border-radius: clamp(1.25rem, 0.5rem + 2vw, 2.3125rem);
	box-shadow: 0 7px 35px 8px rgb(0 0 0 / 0.14); /* Same shadow as the home page photo */
}

@media (min-width: 56em) {
	.ins-intro__inner {
		grid-template-columns: minmax(0, 46.875rem) minmax(2rem, 1fr) minmax(0, 40.75rem);
		align-items: start;
		gap: 0;
	}

	.ins-intro__content {
		grid-column: 1;
		grid-row: 1;
	}

	/* Pull the photo up into the banner: past this section's top padding,
	   plus 12.5vw (240px at 1920, as in the comp). */
	.ins-intro__image {
		grid-column: 3;
		grid-row: 1;
		max-width: none;
		margin-top: calc(-1 * (var(--ins-pad-top) + 12.5vw));
	}
}

/* Quote CTA band: divider lines above and below; eyebrow, heading and
   button on the left half, text on the right half. Matches the comp:
   lines span the banner's content width, content inset ~133px inside them. */
.ins-cta {
	padding-bottom: clamp(3rem, 6.6vw, 8rem);
}

.ins-cta__inner {
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as the banner text */
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.ins-cta__box {
	display: grid;
	padding: clamp(2.5rem, 5vw, 5.75rem) clamp(0rem, 7vw, 8.3rem) clamp(2.5rem, 4.4vw, 5.25rem);
	border-block: 1px solid #d5d5d5;
}

.ins-cta__main .eyebrow {
	margin-bottom: 1.1rem;
}

.ins-cta__heading {
	margin-bottom: 0.9em;
	font-size: clamp(1.75rem, 1rem + 2.1vw, 3.125rem); /* max 50px */
}

.ins-cta__text > :last-child {
	margin-bottom: 0;
}

/* Stacked (phones and tablets): eyebrow, heading, text, then the button,
   so the button comes after the text that explains it. */
@media (max-width: 55.99em) {
	.ins-cta__box {
		gap: 0;
	}

	.ins-cta__main {
		display: contents;
	}

	.ins-cta__box .btn {
		order: 1;
		justify-self: start;
		margin-top: 1.75rem;
	}
}

@media (min-width: 56em) {
	.ins-cta__box {
		grid-template-columns: 1fr 1fr; /* Text starts halfway across, as in the comp */
		align-items: center;
	}
}

/* Phones: centered, like the other stacked sections. */
@media (max-width: 39.99em) {
	.ins-cta__box {
		text-align: center;
	}

	.ins-cta__box .btn {
		justify-self: center;
	}
}

/* Other Personal Insurance: wave-top background (shared with the
   testimonial above), centered heading, and the same cards as the home page.
   Phones: swipeable carousel (shared rules in section 11).
   Tablet: 2-column grid. Desktop: 3-column grid, ~483px cards. */
.ins-other__inner {
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as the banner text */
	margin-inline: auto;
	padding:
		calc(6.667cqw + clamp(1.5rem, 2.5vw, 3rem))
		var(--gutter)
		clamp(4rem, 7vw, 7rem);
}

.ins-other__heading {
	margin-bottom: clamp(2rem, 4vw, 4.25rem);
	font-size: clamp(1.75rem, 1rem + 2.1vw, 3.125rem); /* max 50px */
}

.ins-other .service-card__title {
	text-wrap: balance; /* "Secondary Home" breaks evenly if it wraps. */
}

@media (min-width: 40em) {
	.ins-other .carousel__track {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: clamp(1.5rem, 2.9vw, 3.5rem);
		overflow: visible;
		scroll-snap-type: none;
	}
}

@media (min-width: 64em) {
	.ins-other .carousel__track {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* FAQ photo reaching up behind the "Other Personal Insurance" cards, as in
   the comp. The cards section stays on top (z-index), its background fades
   out over its lower part, and the FAQ photo extends up underneath it and
   fades in. --ins-faq-reach is how far up the photo reaches
   (~515px at 1920: the gap above the FAQ plus the second row of cards). */
.ins-other {
	--ins-faq-reach: clamp(12rem, 27vw, 33rem);

	z-index: 1;
}

.ins-other:has(+ .faq)::before {
	background-color: transparent;
	background-image: linear-gradient(
		to bottom,
		var(--color-surface) calc(100% - var(--ins-faq-reach)),
		rgb(239 235 229 / 0) 100%
	);
}

.ins-other + .faq .faq__bg {
	--ins-faq-reach: clamp(12rem, 27vw, 33rem);

	top: calc(-1 * var(--ins-faq-reach));
	height: calc(100% + var(--ins-faq-reach));
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--ins-faq-reach) * 0.7));
	mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--ins-faq-reach) * 0.7));
}

/* Insurance Overview template: all insurance cards
   No background. Rows are centered (flexbox instead of grid), so a last
   row with fewer cards, like the 7th card, sits in the middle.
   Phones: swipeable carousel (shared rules in section 11). */
.ins-cards__inner {
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as the banner text */
	margin-inline: auto;
	padding: 0 var(--gutter) clamp(3rem, 6.6vw, 8rem);
	text-align: center;
}

.ins-cards__heading {
	margin-bottom: clamp(2rem, 4vw, 4.25rem);
	font-size: clamp(1.75rem, 1rem + 2.1vw, 3.125rem); /* max 50px */
}

.ins-cards .service-card__title {
	text-wrap: balance;
}

@media (min-width: 40em) {
	.ins-cards .carousel__track {
		--cards-per-row: 2;

		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		row-gap: clamp(1.5rem, 2.9vw, 3.5rem);
		overflow: visible;
		scroll-snap-type: none;
	}

	/* Each card is exactly one column wide, so full rows line up like a grid. */
	.ins-cards .carousel__track > * {
		flex: 0 0 calc(
			(100% - (var(--cards-per-row) - 1) * var(--carousel-gap)) / var(--cards-per-row)
		);
	}
}

@media (min-width: 64em) {
	.ins-cards .carousel__track {
		--cards-per-row: 3;
	}
}

/* News page and archives: 3-across grid of cards, then pagination.
   -------------------------------------------------------------------------- */
.news__inner {
	width: 100%;
	max-width: calc(97.875rem + 2 * var(--gutter)); /* Same as the banner text */
	margin-inline: auto;
	padding: clamp(2.5rem, 5vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7.5rem);
}

.news__grid {
	display: grid;
	gap: clamp(1.5rem, 3.2vw, 3.875rem); /* 62px on desktop, like the service cards */
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40em) {
	.news__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.news__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Card: same look as the service cards, left-aligned for reading. */
.post-card__article {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	height: 100%;
	padding: clamp(1.75rem, 2.5vw, 2.5rem);
	background-color: rgb(255 255 255 / 0.6);
	border: 1px solid rgb(31 96 136 / 0.18);
	border-radius: clamp(1.25rem, 0.5rem + 2vw, 2.5rem);
	transition: border-color 0.2s ease;
}

.post-card__article:hover {
	border-color: rgb(31 96 136 / 0.4);
}

.post-card__date {
	margin-bottom: 0.75rem;
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	color: var(--color-quote);
}

/* Long headlines stop after three lines with "…". */
.post-card__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	margin-bottom: 0.75rem;
	font-size: clamp(1.5rem, 1.25rem + 0.6vw, 1.875rem); /* max 30px */
	line-height: 1.2;
}

.post-card__summary {
	margin-bottom: 1.75rem;
	line-height: 1.55;
}

/* Button stays at the bottom so buttons line up across a row. */
.post-card__more {
	margin-top: auto;
}

/* Makes the whole card clickable through its one link. */
.post-card__more::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* Keyboard focus outlines the whole card. */
.post-card__more:focus-visible {
	outline: none;
}

.post-card__article:has(.post-card__more:focus-visible) {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

.news__empty {
	text-align: center;
}

/* Pagination: round page numbers; the current page is solid blue. */
.news-pagination {
	margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.news-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.news-pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding-inline: 0.5rem;
	font-weight: 600;
	color: var(--color-heading);
	text-decoration: none;
	background-color: rgb(255 255 255 / 0.6);
	border: 1px solid rgb(31 96 136 / 0.3);
	border-radius: 999px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.news-pagination a.page-numbers:hover {
	border-color: var(--color-heading);
}

.news-pagination .page-numbers.current {
	color: #ffffff;
	background-color: var(--color-heading);
	border-color: var(--color-heading);
}

.news-pagination .page-numbers.dots {
	background: none;
	border: 0;
}

.news-pagination :is(.prev, .next) {
	font-size: 1.5rem;
	line-height: 1;
}

/* 16. Forms (Gravity Forms)
   Orbital theme (Gravity Forms' default since 2.7) is styled through its
   CSS API variables, so Gravity Forms keeps handling layout, spacing,
   validation and accessibility, just in our colors and fonts. The submit
   button gets the same styles as .btn so it matches every other button;
   that part also covers forms set to the older "Gravity Forms 2.5" theme.
   -------------------------------------------------------------------------- */
.gform_wrapper.gform-theme--framework {
	/* Colors */
	--gf-color-primary: var(--color-heading);         /* Focus rings, checked boxes */
	--gf-color-primary-darker: #174a69;
	--gf-color-in-ctrl-primary: var(--color-heading);
	--gf-ctrl-label-color-primary: var(--color-text);
	--gf-ctrl-desc-color: #4a4a4a;                    /* 8.9:1 on white */
	--gf-ctrl-outline-color-focus: rgb(31 96 136 / 0.35);

	/* Fields */
	--gf-ctrl-bg-color: #ffffff;
	--gf-ctrl-border-color: rgb(31 96 136 / 0.35);
	--gf-ctrl-radius: 0.625rem;
	--gf-ctrl-shadow: none;
	--gf-ctrl-font-size: 1rem;
	--gf-ctrl-label-font-size-primary: 1rem;

	/* Submit button (the direct rule below finishes the match) */
	--gf-ctrl-btn-bg-color-primary: var(--color-button);
	--gf-ctrl-btn-bg-color-hover-primary: var(--color-button-text);
	--gf-ctrl-btn-color-primary: var(--color-button-text);
	--gf-ctrl-btn-color-hover-primary: var(--color-heading);
	--gf-ctrl-btn-border-color-hover-primary: var(--color-button);
	--gf-ctrl-btn-radius: 999px;
	--gf-ctrl-btn-shadow: none;
	--gf-ctrl-btn-shadow-hover: none;
	--gf-ctrl-btn-font-weight: 600;
	--gf-ctrl-btn-text-transform: uppercase;

	font-family: var(--font-body);
}

/* Fields use the theme font (some browsers don't inherit it into inputs). */
.gform_wrapper :is(input, select, textarea, button) {
	font-family: var(--font-body);
}

.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
	font-weight: 600;
}

/* Section and page titles inside forms use the heading font. */
.gform_wrapper :is(.gsection_title, .gf_progressbar_title) {
	font-family: var(--font-heading);
	font-weight: 300;
	font-variation-settings: "wght" 300;
	color: var(--color-heading);
}

/* Submit / Next buttons: identical to .btn, including the hover swap and
   the optical centering of the capital letters. (.gform_wrapper is doubled
   on purpose: it raises specificity just enough to beat Gravity Forms' own
   button styles without needing !important.) */
.gform_wrapper.gform_wrapper :is(.gform_footer, .gform-footer, .gform_page_footer, .gform-page-footer)
	:is(input[type="submit"], button[type="submit"], .gform_button, .gform_next_button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: calc(0.8em + 0.055em) 2.25em calc(0.8em - 0.055em);
	font-family: var(--font-body);
	font-weight: 600;
	font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-button-text);
	background-color: var(--color-button);
	border: 2px solid var(--color-button);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover/focus: white background with blue text. (Gold text on white was
   too faint here, and Gravity Forms reads its own text color from a
   variable, so both are set.) */
.gform_wrapper.gform_wrapper :is(.gform_footer, .gform-footer, .gform_page_footer, .gform-page-footer)
	:is(input[type="submit"], button[type="submit"], .gform_button, .gform_next_button):is(:hover, :focus-visible) {
	--gf-local-color: var(--color-heading);

	color: var(--color-heading);
	background-color: var(--color-button-text);
}

/* "Previous" on multi-page forms: the outline button style. */
.gform_wrapper.gform_wrapper :is(.gform_page_footer, .gform-page-footer) .gform_previous_button {
	min-height: 2.75rem;
	padding: calc(0.8em + 0.055em) 2.25em calc(0.8em - 0.055em);
	font-family: var(--font-body);
	font-weight: 600;
	font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-button);
	background-color: var(--color-button-text);
	border: 2px solid var(--color-button);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.gform_wrapper.gform_wrapper :is(.gform_page_footer, .gform-page-footer) .gform_previous_button:is(:hover, :focus-visible) {
	color: var(--color-button-text);
	background-color: var(--color-button);
}

/* Keyboard focus ring on buttons, same as the rest of the site. */
.gform_wrapper.gform_wrapper :is(input[type="submit"], button[type="submit"], .gform_button, .gform_next_button, .gform_previous_button):focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* 17. Footer
   -------------------------------------------------------------------------- */
.site-footer {
	--footer-text: #ffffff;
	--color-focus: #ffffff; /* Blue focus outlines wouldn't show on the blue footer. */

	color: var(--footer-text);
	background-color: var(--color-heading);
}

.site-footer__inner {
	padding: clamp(2.5rem, 3.5vw, 3rem) clamp(var(--gutter), 4.25vw, 5.125rem) clamp(2.5rem, 4vw, 3.5rem);
}

.site-footer a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.site-footer a:hover {
	color: var(--color-footer-hover);
}

.site-footer__top {
	display: grid;
	gap: 2.5rem;
}

.site-footer__info {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem clamp(2.5rem, 5vw, 5rem);
}

.site-footer__heading {
	margin-bottom: 0.9rem;
	font-size: clamp(1.375rem, 1.2rem + 0.4vw, 1.5625rem); /* max 25px */
	color: inherit;
}

.site-footer__list {
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	line-height: 1.6;
	list-style: none;
}

.site-footer__list li + li {
	margin-top: 0.45rem;
}

/* Cities fill top-to-bottom in columns of two, like the comp. */
.site-footer__locations {
	display: grid;
	grid-template-rows: repeat(2, auto);
	grid-auto-flow: column;
	column-gap: 3.25rem;
	row-gap: 0.45rem;
	justify-content: start;
}

.site-footer__locations li + li {
	margin-top: 0;
}

/* Footer button: white outline, sentence case, smaller than the main button. */
.btn--footer {
	--btn-pad-y: 0.6em;

	min-height: 2.25rem;
	margin-top: 1.25rem;
	padding-inline: 1.9em;
	font-weight: 500;
	font-size: 0.875rem;
	letter-spacing: 0;
	text-transform: none;
	color: var(--footer-text);
	background-color: transparent;
	border-width: 1px;
	border-color: var(--footer-text);
}

.site-footer .btn--footer:hover,
.site-footer .btn--footer:focus-visible {
	color: var(--color-heading);
	background-color: var(--footer-text);
}

.site-footer__social {
	display: flex;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.site-footer__social a {
	display: grid;
	place-items: center;
	width: 2.25rem; /* 36px circles */
	height: 2.25rem;
	font-size: 1.125rem;
	color: var(--color-heading);
	background-color: var(--footer-text);
	border-radius: 50%;
}

.site-footer__social a:hover {
	color: var(--color-heading);
	background-color: var(--color-footer-hover);
}

/* Two link columns, filled top to bottom (About, Claims... then Contact...). */
.site-footer__menu {
	columns: 2;
	column-gap: 2.5rem;
	width: 20rem;
	max-width: 100%;
	margin: 0;
	padding: 0;
	font-family: var(--font-heading);
	font-variation-settings: "wght" 400;
	font-size: 1.0625rem;
	line-height: 1.4;
	list-style: none;
}

.site-footer__menu li {
	break-inside: avoid;
	padding-bottom: 0.8rem;
}

.site-footer__menu a[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.site-footer__legal {
	margin: clamp(2.5rem, 4vw, 3.5rem) 0 0;
	font-family: var(--font-heading);
	font-variation-settings: "wght" 400;
	font-size: 0.9375rem;
}

.site-footer__sep {
	margin-inline: 0.75em;
}

.site-footer__legal a,
.site-footer__legal em {
	font-style: italic;
}

.site-footer__legal a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Phones: everything centered. The copyright and credit go on separate
   lines, so the divider is hidden. */
@media (max-width: 39.99em) {
	.site-footer {
		text-align: center;
	}

	.site-footer__info {
		flex-direction: column;
		align-items: center;
	}

	.site-footer__locations,
	.site-footer__social {
		justify-content: center;
	}

	.site-footer__nav {
		display: flex;
		justify-content: center;
	}

	.site-footer__sep {
		display: none;
	}

	.site-footer__copyright,
	.site-footer__credit {
		display: block;
	}

	.site-footer__credit {
		margin-top: 0.35rem;
	}
}

/* Desktop: contact + locations on the left, link columns against the
   right edge, as in the comp. */
@media (min-width: 64em) {
	.site-footer__top {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: start;
		column-gap: 4rem;
	}

	.site-footer__nav {
		justify-self: end;
		padding-top: 0.4rem; /* Lines the first link up with the column headings. */
	}
}

/* Mobile bar: "Give Us A Call" and "Free Estimate", fixed to the bottom
   of the screen on phones only. */
.mobile-bar {
	display: none;
}

@media (max-width: 39.99em) {
	.mobile-bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 90; /* Below the header (100); the menu drawer opens above everything. */
		display: grid;
		grid-auto-columns: 1fr;
		grid-auto-flow: column;
		box-shadow: 0 -2px 12px rgb(0 0 0 / 0.12);
	}

	/* Keep the bar from covering the end of the page. */
	body:has(.mobile-bar) {
		padding-bottom: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom, 0px));
	}
}

.mobile-bar__link {
	--color-focus: #ffffff;

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: var(--mobile-bar-h);
	/* Extra bottom padding clears the iPhone home indicator. */
	padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
	font-weight: 600;
	font-size: clamp(0.9375rem, 3vw, 1.125rem);
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	transition: filter 0.2s ease;
}

.mobile-bar__link i {
	font-size: clamp(1.75rem, 6vw, 2.25rem);
}

.mobile-bar__link:active {
	filter: brightness(0.9);
}

.mobile-bar__link:focus-visible {
	outline-offset: -6px;
}

.mobile-bar__link--call {
	background-color: var(--color-heading);
}

.mobile-bar__link--estimate {
	background-color: var(--color-accent);
}

/* Thin divider between the two buttons. */
.mobile-bar__link + .mobile-bar__link {
	border-left: 1px solid rgb(255 255 255 / 0.5);
}

/* 18. Accessibility
   -------------------------------------------------------------------------- */

/* Visible keyboard focus on every interactive element. */
:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

/* Main gets focus from the skip link; no outline needed there. */
.site-main:focus {
	outline: none;
}

/* Skip link: hidden until focused with the keyboard. */
.skip-link {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1000;
	padding: 0.75rem 1rem;
	font-weight: 600;
	color: var(--color-heading);
	background: var(--color-bg);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: translateY(0);
}

/* Hidden visually, still read by screen readers (WordPress core class). */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	clip: auto;
	white-space: normal;
}

/* Respect users who've asked their OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* 19. WordPress core classes
   -------------------------------------------------------------------------- */
.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.aligncenter {
	margin-inline: auto;
}

.wp-caption-text {
	font-size: 0.875rem;
}
