/**
 * Legal pages: page-templates/legal.php (Terms 2190:997, Privacy 2191:1116,
 * Cookie policy).
 * From 1280: title card with "Last updated" (219px); 320px "On this page"
 * list, 80px gap, the content beside it; 140px under the body.
 * List (2190:1541): white, line border, radius 20, 24px top, 12px sides and
 * bottom; head 12px semibold muted (0.5px), 14px in, 10px under; items 10 /
 * 14px padding, radius 7, 2px apart, 16px semibold muted; the current item
 * ink on cream with an 8px orange dot. "Sticky on scroll."
 * Content (2190:1565): the intro paragraph Body/L ink, 860px wide; 44px
 * between sections; H2 Heading/H3 bold black, 12px to the paragraphs in
 * Body/L muted, 12px apart. Then the compact contact card (cta-card.css).
 * 1024-1279 (not designed): a 260px list, 40px gap.
 * Below 1024 (not designed): the list folds into an "On this page" box above
 * the content (closed on phones, assets/js/toc.js keeps it open on wide
 * screens).
 */

.legal-page__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
	padding-bottom: clamp(64px, 40.6537px + 6.2257vw, 140px);
}

.legal-page__main {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: var(--space-xl);
	min-width: 0;
}

/* On this page */
.legal-toc {
	box-sizing: border-box;
	border: 1px solid var(--color-line);
	border-radius: 20px;
	background: var(--color-white);
}

.legal-toc__head {
	display: flex;
	gap: var(--space-xs);
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 0 20px;
	color: var(--color-muted);
	font-size: var(--text-label-s);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-label-s);
	line-height: var(--leading-label-s);
	cursor: pointer;
	list-style: none;
}

.legal-toc__head::-webkit-details-marker {
	display: none;
}

.legal-toc__caret {
	transition: transform 0.2s ease;
}

.legal-toc__details[open] .legal-toc__caret {
	transform: rotate(180deg);
}

.legal-toc__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0 12px 12px;
	list-style: none;
}

.legal-toc__link {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px 14px;
	border-radius: 7px;
	color: var(--color-muted);
	font-size: var(--text-body-m);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-label-m);
	text-decoration: none;
}

.legal-toc__link:hover {
	color: var(--color-ink);
}

.legal-toc__link.is-active {
	background: var(--color-cream);
	color: var(--color-ink);
}

.legal-toc__link.is-active::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: var(--radius-pill);
	background: var(--color-orange);
}

/* Content from the editor */
.legal-content {
	max-width: 860px;
	color: var(--color-muted);
	font-size: var(--text-body-l);
	line-height: var(--leading-body-l);
}

.legal-content > * {
	margin: 12px 0 0;
}

.legal-content > :first-child {
	margin-top: 0;
}

/* The intro: everything before the first section heading. */
.legal-content > :not(h2, h2 ~ *) {
	color: var(--color-ink);
}

.legal-content h2 {
	margin-top: 25px; /* phones (client, 19 Oct 2026); 44px from 768 */
	color: var(--color-black);
	font-family: var(--font-display);
	font-size: var(--text-h3);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-h3);
	line-height: var(--leading-h3);
}

.legal-content h3 {
	margin-top: var(--space-md);
	color: var(--color-ink);
	font-family: var(--font-display);
	font-size: var(--text-h4);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-h4);
	line-height: var(--leading-h4);
}

.legal-content ul,
.legal-content ol {
	padding-left: 1.2em;
}

.legal-content li + li {
	margin-top: 6px;
}

.legal-content a {
	color: var(--color-ink);
	text-decoration: underline;
}

.legal-content a:hover {
	color: var(--color-orange);
}

.legal-content strong {
	color: var(--color-ink);
}

@media (prefers-reduced-motion: reduce) {
	.legal-toc__caret {
		transition: none;
	}
}

@media (min-width: 768px) {
	.legal-content h2 {
		margin-top: 44px;
	}
}

@media (min-width: 1024px) {
	.legal-page__body {
		flex-direction: row;
		gap: var(--space-lg);
		align-items: flex-start;
	}

	.legal-toc {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-stuck-height, 88px) + var(--space-md));
		flex: none;
		width: 260px;
		padding-top: 24px;
	}

	/* Always open on wide screens: the head is a label, not a toggle. */
	.legal-toc__head {
		min-height: 0;
		padding: 0 0 10px 26px;
		cursor: default;
		pointer-events: none;
	}

	.legal-toc__caret {
		display: none;
	}
}

@media (min-width: 1280px) {
	.legal-page__body {
		gap: 80px;
	}

	.legal-toc {
		width: 320px;
	}

	.legal-page__main {
		gap: 44px;
	}
}
