/*
 * Insurance line template — Naccarato Insurance
 *
 * Built to the measurements taken from the approved design
 * (SUBPAGES auto -4.pdf, 1366px canvas):
 *
 *   hero        ≈289px tall, title 107.8px, aligned to the narrow container
 *   intro band  375px tall, centred copy at 32.1px on #F4F4F4
 *   sections    titles 83.9px centred, body 21px
 *
 * Depends on tokens.css.
 */

/* ===================================================================
 * Hero
 *
 * The title is live text over the photo, per the design. The art puts no
 * darkening on the photo. A soft dark gradient was added on 2026-10-12 for
 * light photos (Surety Bonds, New York Disability, Inland Marine…) where the
 * outlined white letters all but vanished, and removed on 2026-10-16 because
 * the client found the heroes too dark. Those light photos are still open.
 * =================================================================== */

.line-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(11rem, 21vw, 18rem);
	background-color: var(--nac-black);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

/*
 * No featured image: a flat brand-colour band instead of the photo. Same
 * base class, same min-height, so the hero is exactly as tall either way —
 * only the background changes.
 * Automatic fallback (page-templates/insurance-line.php); never set by hand.
 */
.line-hero--band {
	background-color: var(--color-primary);
}

.line-hero__inner {
	position: relative;
	width: 100%;
	padding-block: var(--space-10);
}

/*
 * The art draws this as outlined type: no fill, thin white stroke, with the
 * photograph showing through the letters. Measured on the design: Inter
 * Black, 992px wide (x 175-1166), ~2px stroke ("Auto Insurance", the
 * template's own reference title). It starts at the narrow container's left
 * edge and runs ~40px past its right edge — the title is not wrapped to the
 * 950px container, see the overhang below.
 *
 * --line-hero-title-ratio/-ceiling default to that measurement and are
 * overridden inline, per title, only when it wouldn't otherwise fit the
 * 1030px available (container + overhang) — see inc/hero-title.php for how
 * the override is computed from the font's real character widths. Auto and
 * Home get no override.
 */
.line-hero__title {
	/* The art's 107.7px (0.0829 of the frame) less 10%, by request. */
	--line-hero-title-ratio: 0.0746;
	--line-hero-title-ceiling: 96.9px;

	margin: 0;
	color: var(--nac-white);
	/*
	 * Inter Black with merged contours (see base.css), the face the design uses.
	 * Deliberately no fallback to the regular Inter: its overlapping contours
	 * would silently reintroduce the stray lines inside the stroked letters.
	 */
	font-family: "Inter Outline", sans-serif;
	/*
	 * The floor is 2.75rem, or less when the longest word would not fit the
	 * screen at that size: --line-hero-title-word is that word's width in em
	 * (inc/hero-title.php), so the screen's text width divided by it is the
	 * largest size at which the word still fits. 4px is the outline. Titles
	 * without the variable divide by 0.01, which leaves the floor at 2.75rem.
	 */
	font-size: clamp(
		min(2.75rem, calc((var(--frame-width) - var(--gutter) * 2 - 4px) / var(--line-hero-title-word, 0.01))),
		calc(var(--frame-width) * var(--line-hero-title-ratio)),
		var(--line-hero-title-ceiling)
	);
	font-weight: 900;
	letter-spacing: 0;
	line-height: var(--lh-tight);
	text-transform: uppercase;
	/*
	 * Long titles wrap instead of overflowing (Task010 decision 1). Most fit
	 * on one line once sized to --line-hero-title-ceiling; titles that still
	 * don't fit wrap onto a 2nd (or, for one real outlier, 3rd) line. Balanced
	 * where supported so a wrap never strands a single short word alone.
	 */
	white-space: normal;
	text-wrap: balance;
}

/*
 * Overhang: the design's title is wider than the 950px container, so the box
 * grows 80px to the right (negative margin on a block = wider box). Only from
 * 1200px up: below that the title is scaled with the frame and always fits the
 * container, and an 80px overhang could push a wrapped title past the screen.
 */
@media (min-width: 1200px) {
	.line-hero__title {
		margin-right: -80px;
	}
}

/*
 * Guarded: without text-stroke support a transparent fill would leave the
 * title invisible, so the solid white above stays as the fallback.
 */
@supports (-webkit-text-stroke: 2px white) {
	.line-hero__title {
		-webkit-text-stroke: 2px var(--nac-white);
		color: transparent;
	}
}

/* ===================================================================
 * Intro band
 * =================================================================== */

/*
 * A photo between the hero and the intro band (Long Term Care, Disability:
 * the old site put it under the title, centred, 640px wide). The files are
 * large, so it is capped by max-width rather than left to fill the column.
 */
.line-lead-image {
	padding-block: var(--space-10) 0;
	text-align: center;
}

.line-lead-image .wp-block-image {
	margin: 0;
}

.line-lead-image img {
	display: inline-block;
	max-width: min(100%, 720px);
	height: auto;
	border-radius: var(--radius-sm);
}

/* White air between the photo and the grey band. */
.line-lead-image + .line-intro {
	margin-top: var(--space-10);
}

/*
 * Measured on the design: band 379px tall, 6 lines of ~30.5px type at 46.4px
 * line spacing, running to ~1125px wide, with 70px of padding above and 45px
 * below.
 */
.line-intro {
	background-color: var(--color-bg-alt);
	padding-block:
		clamp(var(--space-8), calc(var(--frame-width) * 0.0538), 70px)
		clamp(var(--space-6), calc(var(--frame-width) * 0.0346), 45px);
	text-align: center;
}

/*
 * Full content width, not a narrow column: the design runs the intro to
 * ~1125px. Constraining it to a comfortable reading measure pushed the band
 * 30% taller than the art.
 *
 * The 1125px is the measured width, not an attempt to force a line count —
 * where the lines actually break depends on font rendering.
 */
.line-intro__inner {
	max-width: 1125px;
}

.line-intro p {
	font-size: clamp(1.375rem, calc(var(--frame-width) * 0.0235), 1.90625rem);
	line-height: 1.52;
}

/*
 * The art sets the two paragraphs as one continuous block — the spacing
 * between them is the same 46.4px as between lines within them.
 */
.line-intro p:not(:last-child) {
	margin-bottom: 0;
}

/*
 * Three paragraphs or more no longer read as one block: run together at this
 * size they became a wall of text (New York Disability has four). Those
 * intros get space between paragraphs; the design's two-paragraph intros
 * keep running on (Task015, approved 2026-10-12).
 */
.line-intro__inner:has(> p:nth-of-type(3)) p:not(:last-child) {
	margin-bottom: 0.75em;
}

/*
 * A paragraph that has to stand apart from the one before it: the prompt over
 * the quote tiles on /get-a-free-quote/ (client request, 2026-10-15). Set in
 * the block editor as "Additional CSS class(es)", so it travels with the page
 * content.
 */
.line-intro p.intro-gap {
	margin-top: 1em;
}

/*
 * A call to action closing the intro (load_groups.php `cta`, Referrals): the
 * office phone, set like the form sections' phone line, then a button.
 */
.line-intro .page-cta__phone a {
	color: var(--color-primary);
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-display);
	text-decoration: none;
}

.line-intro .page-cta__phone a:hover,
.line-intro .page-cta__phone a:focus-visible {
	text-decoration: underline;
}

.line-intro .page-cta {
	margin-top: var(--space-6);
}

/* ===================================================================
 * Sections
 * =================================================================== */

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

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

/* -------------------------------------------------------------------
 * Default layout — centred term + description pairs
 * ------------------------------------------------------------------- */

.coverage-list {
	max-width: 760px;
	margin-inline: auto;
	text-align: center;
}

.coverage-list__item + .coverage-list__item {
	margin-top: var(--space-6);
}

.coverage-list__term {
	margin-bottom: var(--space-1);
	font-weight: var(--fw-bold);
}

.coverage-list__text {
	margin: 0;
}

/* -------------------------------------------------------------------
 * Bullet lists (media, columns and plain layouts)
 * ------------------------------------------------------------------- */

.bullet-list {
	margin: 0;
	padding-left: var(--space-6);
}

.bullet-list li {
	margin-bottom: var(--space-2);
}

/*
 * Two-column layout with the vertical divider from the design. CSS columns
 * handle any number of items without the markup needing to know the split.
 */
.bullet-list--columns {
	max-width: 900px;
	margin-inline: auto;
}

@media (min-width: 768px) {
	.bullet-list--columns {
		column-count: 2;
		column-gap: var(--space-12);
		column-rule: 1px solid var(--color-border-strong);
	}

	/* Keeps an item from being split across the two columns. */
	.bullet-list--columns li {
		break-inside: avoid;
	}
}

/* -------------------------------------------------------------------
 * Media layout — image beside the list
 * ------------------------------------------------------------------- */

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

.line-section__figure {
	margin: 0;
}

.line-section__figure img {
	width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
	/* Roughly the 382:481 split measured in the design. */
	.line-section__media {
		grid-template-columns: 2fr 3fr;
	}
}

/* Line index
 * -------------------------------------------------------------------
 * The grid of lines on the two group index pages. Cards rather than a
 * plain list: a group holds 14 or 26 entries, and at that length a bare
 * list of links reads as a wall of text.
 * ------------------------------------------------------------------- */

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

.line-index__item {
	display: flex;
}

.line-index__link {
	display: flex;
	align-items: center;
	width: 100%;
	padding: var(--space-5) var(--space-6);
	border: 1px solid var(--color-border);
	border-left: 4px solid var(--color-primary);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
	color: var(--color-heading);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.line-index__link:hover,
.line-index__link:focus-visible {
	background: var(--color-bg-subtle);
	border-color: var(--color-primary);
}

/* Page form
 * -------------------------------------------------------------------
 * The section around a page's form (template-parts/forms/form-section).
 * The form's own fields are styled in forms.css.
 * ------------------------------------------------------------------- */

.page-form__phone,
.page-form__text {
	margin: 0 0 var(--space-6);
	text-align: center;
}

.page-form__phone a {
	color: var(--color-primary);
	font-family: var(--font-display);
	font-size: var(--fs-h4);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-display);
	text-decoration: none;
}

.page-form__phone a:hover,
.page-form__phone a:focus-visible {
	text-decoration: underline;
}

/* Page body
 * -------------------------------------------------------------------
 * Free-form content in a reading column: the content past <!--more--> on a
 * group page (/claims/), posts, generic pages and the 404.
 * ------------------------------------------------------------------- */

/* Same column as .container--narrow, which lines it up with the hero title. */
.page-body .container {
	max-width: calc(var(--container-narrow) + (var(--gutter) * 2));
}

.page-body h2 {
	margin: var(--space-12) 0 var(--space-4);
	font-size: var(--fs-h4);
	text-transform: uppercase;
}

.page-body h3 {
	margin: var(--space-8) 0 var(--space-3);
	color: var(--color-primary);
	font-size: var(--fs-h5);
}

.page-body h2:first-child,
.page-body h3:first-child {
	margin-top: 0;
}

.page-body .wp-block-list {
	margin: 0;
	padding-left: var(--space-6);
}

.page-body a:not(.button) {
	color: var(--color-primary);
}

/*
 * A picture in the body (the owners' photo on /about-naccarato/, client
 * request 2026-10-15): centred at its natural size. The file is 540px wide;
 * stretching it to the column would soften it, so it never grows past that.
 */
.page-body .wp-block-image {
	margin: 0;
	text-align: center;
}

.page-body .wp-block-image img {
	display: inline-block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}
