/*
 * Layout — Naccarato Insurance
 *
 * Structural scaffolding only: containers, section bands, grids and the
 * shared hero pattern. No visual component styling here (see main.css).
 * Depends on tokens.css.
 */

/* ===================================================================
 * Containers
 *
 * The page itself is capped at --frame-max (see base.css); these constrain
 * content within it.
 *
 *   --container-max     1140px  default content width (measured 1146px)
 *   --container-narrow   950px  long-form text (insurance subpages)
 * =================================================================== */

.container {
	width: 100%;
	max-width: calc(var(--container-max) + (var(--gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(var(--container-narrow) + (var(--gutter) * 2));
}

/* ===================================================================
 * Page shell
 *
 * overflow-x: clip keeps full-bleed breakouts from ever producing a
 * horizontal scrollbar without creating a new scroll container.
 * =================================================================== */

.site-main {
	overflow-x: clip;
}

/* ===================================================================
 * Sections
 *
 * Sections are full-width bands; the .container inside them constrains
 * the content. Modifiers set the band background.
 * =================================================================== */

.section {
	padding-block: var(--section-gap);
}

.section--tight {
	padding-block: var(--space-10);
}

.section--flush {
	padding-block: 0;
}

.section--alt {
	background-color: var(--color-bg-alt);
}

.section--subtle {
	background-color: var(--color-bg-subtle);
}

.section--primary {
	background-color: var(--color-primary);
	color: var(--color-on-primary);
}

.section--primary :is(h1, h2, h3, h4, h5, h6) {
	color: var(--color-on-primary);
}

.section--primary a {
	color: var(--color-accent-hover);
}

/*
 * Breakout: lets an element inside a constrained container span the full
 * width of the page. Only needed inside editor content — top-level
 * sections are already full width.
 *
 * Derived from --page-width rather than 100vw: the page is capped at
 * --page-max (see base.css), so breaking out to the viewport would escape it.
 */
.full-bleed {
	width: var(--page-width);
	max-width: var(--page-width);
	margin-inline: calc(50% - var(--page-width) / 2);
}

/* ===================================================================
 * Section titles
 *
 * The design's recurring two-tone heading: the leading word in gold, the
 * remainder in black — e.g. "POLICY COVERAGE", "OPTIONAL COVERAGE".
 * Markup: <h2 class="section-title"><span class="accent">Policy</span> Coverage</h2>
 * =================================================================== */

.section-title {
	margin-bottom: var(--space-8);
}

.section-title .accent {
	color: var(--color-accent);
}

.section-title--center {
	text-align: center;
}

/* ===================================================================
 * Grids
 *
 * Auto-fit grids collapse on their own — no per-breakpoint overrides
 * needed for the common cases (service cards, office list, carrier wall).
 * =================================================================== */

.grid {
	display: grid;
	gap: var(--space-6);
}

.grid--2 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid--4 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.grid--gap-lg {
	gap: var(--space-10);
}

/*
 * Two-column list split with a divider, as used by "POSSIBLE DISCOUNTS"
 * on the auto subpage. Collapses to one column below md.
 */
.list-split {
	display: grid;
	gap: var(--space-4) var(--space-10);
	grid-template-columns: 1fr;
}

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

	.list-split > :nth-child(2) {
		padding-left: var(--space-10);
		border-left: 1px solid var(--color-border-strong);
	}
}

/* ===================================================================
 * Stack — consistent vertical rhythm between arbitrary children
 * =================================================================== */

.stack > * + * {
	margin-top: var(--space-5);
}

.stack--lg > * + * {
	margin-top: var(--space-8);
}

/* ===================================================================
 * Hero
 *
 * Generic page-title banner (used by the developer styleguide). The insurance
 * subpages use .line-hero instead (insurance-line.css). No darkening is drawn
 * over photos, so there is no scrim here either.
 * =================================================================== */

.hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(14rem, 26vw, 22rem);
	background-color: var(--nac-black);
	background-position: center;
	background-size: cover;
	color: var(--nac-white);
}

.hero__inner {
	width: 100%;
	padding-block: var(--space-12);
}

.hero__title {
	margin-bottom: 0;
	color: var(--nac-white);
	font-size: var(--fs-hero);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
	line-height: var(--lh-tight);
	text-transform: uppercase;
}

.hero--center {
	text-align: center;
}

.hero--center .hero__title {
	text-wrap: balance;
}

/* ===================================================================
 * Generic media + text pairing (used across service blocks)
 * =================================================================== */

.media-pair {
	display: grid;
	align-items: center;
	gap: var(--space-8);
	grid-template-columns: 1fr;
}

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

	.media-pair--reverse > :first-child {
		order: 2;
	}
}
