/* =============================================================================
   Hive Mind Legal page — body styling for templates/legal.php.

   The .policy-hero at the top reuses the shared .policy-* rules in style.css.
   This file styles the document body only: the table of contents, the
   converted-markdown prose, tables, and section dividers. Everything is
   scoped to .legal-page so it never leaks into the rest of the site.

   Enqueued conditionally in functions.php (only on the Legal template).
   ============================================================================= */

/* ── Hero meta line ──────────────────────────────────────────────────────── */
.legal-page .legal-meta {
	margin: 20px 0 0;
	font-family: var(--f-mono);
	font-size: 12px;
	line-height: 1.7;
	letter-spacing: 0.04em;
	color: var(--fg-dim);
}
.legal-page .legal-meta a { color: var(--fg-dim); text-decoration: underline; text-underline-offset: 2px; }
.legal-page .legal-meta a:hover { color: var(--accent-fg); }

/* ── Table of contents ───────────────────────────────────────────────────── */
.legal-page .legal-toc {
	margin: 0 0 56px;
	padding: 24px 28px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: color-mix(in oklch, var(--fg) 3%, transparent);
}
.legal-page .legal-toc-title {
	margin: 0 0 14px;
	font-family: var(--f-mono);
	font-size: var(--t-eyebrow);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-dim);
}
.legal-page .legal-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.legal-page .legal-toc li {
	counter-increment: toc;
	position: relative;
	margin: 0 0 9px;
	padding-left: 30px;
}
.legal-page .legal-toc li:last-child { margin-bottom: 0; }
.legal-page .legal-toc li::before {
	content: counter(toc, decimal-leading-zero);
	position: absolute; left: 0; top: 2px;
	font-family: var(--f-mono); font-size: 12px; color: var(--yellow);
}
.legal-page .legal-toc a {
	font-family: var(--f-sans); font-size: 16px;
	color: var(--fg); text-decoration: none;
	border-bottom: 1px solid var(--line);
}
.legal-page .legal-toc a:hover { color: var(--accent-fg); border-color: var(--accent-fg); }

/* ── Document sections ───────────────────────────────────────────────────── */
.legal-page .legal-doc {
	padding: 56px 0;
	border-top: 1px solid var(--line);
	scroll-margin-top: 32px;
}
.legal-page .legal-doc:first-of-type { padding-top: 0; border-top: 0; }

/* ── Prose (converted markdown) ──────────────────────────────────────────── */
.legal-page .legal-doc h2 {
	font-family: var(--f-serif); font-weight: 600;
	font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.015em;
	margin: 0 0 10px; color: var(--fg);
}
.legal-page .legal-doc h3 {
	font-family: var(--f-sans); font-weight: 600;
	font-size: clamp(20px, 2.4vw, 26px); line-height: 1.2;
	margin: 44px 0 12px; color: var(--fg);
}
.legal-page .legal-doc h4 {
	font-family: var(--f-sans); font-weight: 600;
	font-size: 17px; line-height: 1.3; margin: 28px 0 8px; color: var(--fg);
}
.legal-page .legal-doc p,
.legal-page .legal-doc li {
	font-family: var(--f-sans); font-size: 16px; line-height: 1.7;
	color: color-mix(in oklch, var(--fg) 88%, transparent);
}
.legal-page .legal-doc p { margin: 0 0 16px; }
.legal-page .legal-doc ul,
.legal-page .legal-doc ol { margin: 0 0 18px; padding-left: 24px; }
.legal-page .legal-doc li { margin: 0 0 8px; }
.legal-page .legal-doc li:last-child { margin-bottom: 0; }
.legal-page .legal-doc a {
	color: var(--fg); text-decoration: underline;
	text-underline-offset: 2px; text-decoration-color: var(--fg-dim);
}
.legal-page .legal-doc a:hover { color: var(--accent-fg); text-decoration-color: var(--accent-fg); }
.legal-page .legal-doc strong { font-weight: 600; color: var(--fg); }
.legal-page .legal-doc em { font-style: italic; }
.legal-page .legal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.legal-page .legal-doc blockquote {
	margin: 0 0 18px; padding: 14px 20px;
	border-left: 3px solid var(--yellow);
	background: color-mix(in oklch, var(--fg) 3%, transparent);
	border-radius: 0 8px 8px 0;
}
.legal-page .legal-doc blockquote p { margin: 0 0 8px; font-size: 15px; color: var(--fg-dim); }
.legal-page .legal-doc blockquote p:last-child { margin-bottom: 0; }
.legal-page .legal-doc code {
	font-family: var(--f-mono); font-size: 0.88em;
	background: color-mix(in oklch, var(--fg) 6%, transparent);
	padding: 1px 6px; border-radius: 4px;
	overflow-wrap: anywhere;
}

/* ── Tables (GFM) ────────────────────────────────────────────────────────── */
.legal-page .legal-doc .legal-table-wrap,
.legal-page .legal-doc table { width: 100%; }
.legal-page .legal-doc table {
	border-collapse: collapse; margin: 0 0 24px;
	font-family: var(--f-sans); font-size: 14px;
}
.legal-page .legal-doc th,
.legal-page .legal-doc td {
	text-align: left; padding: 10px 14px;
	border: 1px solid var(--line); vertical-align: top; line-height: 1.5;
}
.legal-page .legal-doc th {
	font-weight: 600; color: var(--fg);
	background: color-mix(in oklch, var(--fg) 4%, transparent);
}

/* ── Back-to-top ─────────────────────────────────────────────────────────── */
.legal-page .legal-doc-top { margin: 32px 0 0; }
.legal-page .legal-doc-top a {
	font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--fg-dim); text-decoration: none;
}
.legal-page .legal-doc-top a:hover { color: var(--accent-fg); }
