/**
 * GVA — legal document presentation. Every selector is namespaced under
 * `.legal-page` (page-templates/legal.php only); refines content.css's
 * `.entry-content` inside that scope without touching it elsewhere.
 *
 * Enqueued as `gva-legal` behind `is_page_template('page-templates/legal.php')`,
 * after `gva-content`. No rule here depends on a script or interaction.
 */

/* ==========================================================================
   1. Page shell and reading measure
   ========================================================================== */

.legal-page {
	/* Wider than content.css's 68ch measure (~78 characters at 18px); scoped
	   here, not on `:root`, so other templates' measure is untouched. */
	--content-measure: 800px;

	padding-block: clamp(56px, 9vw, 120px);
	background: var(--bone);
}

.legal-page__inner {
	display: flow-root;
}

.legal-page__article {
	max-width: var(--content-measure);
	margin-inline: auto;
}

/* ==========================================================================
   2. Document header
   The eyebrow is main.css's shared `.eyebrow` (mono, uppercase, behind the
   design's 38px red rule) — the same idiom the front page and the Field Notes
   index use, so a legal page reads as part of the site.
   ========================================================================== */

.legal-page__header {
	margin-bottom: clamp(36px, 5vw, 56px);
	padding-bottom: clamp(28px, 4vw, 40px);
	border-bottom: 1px solid var(--line);
}

.legal-page__title {
	font-size: clamp(32px, 4.6vw, 48px);
	line-height: 1.12;
	letter-spacing: -0.03em;
	overflow-wrap: break-word;
}

/* ==========================================================================
   3. Long-form content — native editor output
   Refinements over content.css's `.entry-content`, all inside `.legal-page`.
   ========================================================================== */

.legal-page__content {
	font-size: 1.125rem;
	line-height: 1.75;
	color: #2b2b2b;
}

/* ---- Headings ---------------------------------------------------------- */

/* The template owns the only H1; each H2 opens a numbered section and gets
   a hairline above it so a reader can scan the structure. */
.legal-page__content h2 {
	margin-top: 2.6em;
	padding-top: 1.4em;
	border-top: 1px solid var(--line);
	font-size: 1.5em;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.legal-page__content > h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.legal-page__content h3 {
	margin-top: 2em;
	font-size: 1.18em;
	line-height: 1.3;
}

.legal-page__content h4 {
	margin-top: 1.8em;
	font-size: 1.02em;
}

/* ---- Prose ------------------------------------------------------------- */

.legal-page__content p {
	margin-block: 0 1.35em;
}

.legal-page__content strong {
	font-weight: 700;
	color: var(--text);
}

.legal-page__content em {
	font-style: italic;
}

/* `--red-dark` instead of the global `--red`: on the bone ground `--red`
   measures 3.98:1 (fails WCAG AA for body text), `--red-dark` measures 6.09:1.
   Scoped to legal documents only; hover signals with weight, not colour. */
.legal-page__content a {
	color: var(--red-dark);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.18em;
}

.legal-page__content a:hover,
.legal-page__content a:focus-visible {
	color: var(--red-dark);
	text-decoration-thickness: 3px;
}

/* ---- Lists ------------------------------------------------------------- */

.legal-page__content ul,
.legal-page__content ol {
	margin-block: 0 1.35em;
	padding-left: 1.6em;
}

.legal-page__content li {
	margin-bottom: 0.65em;
	padding-left: 0.2em;
}

/* The restrained red accent: list markers, not another block of colour. */
.legal-page__content ul > li::marker {
	color: var(--red);
}

.legal-page__content ol > li::marker {
	color: var(--text-muted);
	font-family: var(--font-mono);
	font-size: 0.9em;
}

/* ---- Tables ------------------------------------------------------------ */

/* content.css already keeps a wide table from forcing page scroll; these add
   comfortable spacing and row banding for a legal table. */
.legal-page__content figure.wp-block-table {
	margin-block: 0 1.6em;
	margin-inline: 0;
}

.legal-page__content table {
	font-size: 0.92em;
	line-height: 1.55;
}

.legal-page__content th,
.legal-page__content td {
	padding: 0.7em 0.9em;
}

.legal-page__content thead th {
	font-family: var(--font-mono);
	font-size: 0.86em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: bottom;
}

.legal-page__content tbody tr:nth-child(odd) {
	background: var(--white);
}

/* ---- Quotes, separators ------------------------------------------------ */

/* content.css supplies the red left rule; the legal scope only opens it up. */
.legal-page__content blockquote {
	margin-block: 0 1.6em;
	padding-block: 0.3em;
	padding-left: 1.4em;
	font-size: 1.02em;
}

.legal-page__content hr {
	margin-block: 2.4em;
}

/* ==========================================================================
   4. Responsive
   The measure is already fluid; these relax type and spacing on small
   screens. Tables, if used, continue to scroll inside their own figure rather
   than widening the page.
   ========================================================================== */

@media (max-width: 700px) {
	.legal-page__content {
		font-size: 1.0625rem;
		line-height: 1.7;
	}

	.legal-page__content h2 {
		margin-top: 2.2em;
		padding-top: 1.2em;
		font-size: 1.35em;
	}

	.legal-page__content ul,
	.legal-page__content ol {
		padding-left: 1.3em;
	}
}

@media (max-width: 420px) {
	.legal-page__title {
		letter-spacing: -0.02em;
	}

	.legal-page__content th,
	.legal-page__content td {
		padding: 0.6em 0.7em;
	}
}
