/**
 * Legal pages (page-templates/legal.php, inc/legal.php): the header with the last-updated date, the
 * reading column with numbered sections, the "In short" card and tables, and the sticky "On this page" and
 * "Legal" lists beside the text (a disclosure above the text on small screens). Loads on the legal
 * template only.
 */
.entry--legal {
	--wt-legal-line: var(--wp--preset--color--border);
	--wt-legal-soft: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
}

/* ---------- Header ---------- */
.entry--legal .entry-title {
	font-weight: 300;
}
.wt-legal__updated {
	display: inline-block;
	margin: 1rem 0 0;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--wt-legal-line);
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Layout: lists beside the text from 64rem ---------- */
.wt-legal {
	display: grid;
	gap: var(--wp--preset--spacing--50, 2.5rem);
	padding-bottom: var(--wp--preset--spacing--60);
}
.wt-legal__main {
	min-width: 0;
	max-width: 48rem;
}
.wt-legal__aside {
	order: 2; /* Small screens: the "Legal" list after the text; "On this page" is the disclosure above it. */
}
.wt-legal__toc {
	display: none;
}
@media (min-width: 64rem) {
	.wt-legal {
		grid-template-columns: 15rem minmax(0, 48rem);
		gap: clamp(3rem, 6vw, 6rem);
		align-items: start;
	}
	.wt-legal__aside {
		position: sticky;
		top: calc(var(--wt-site-header-h, 5rem) + 1.5rem);
		order: 0;
		max-height: calc(100vh - var(--wt-site-header-h, 5rem) - 3rem);
		overflow-y: auto;
		scrollbar-width: thin;
	}
	.wt-legal__toc {
		display: block;
		margin-bottom: 2rem;
	}
	.wt-legal__toc-inline {
		display: none;
	}
}

/* ---------- On this page, Legal ---------- */
.entry--legal .wt-toc__title {
	margin: 0 0 0.75rem;
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.entry--legal .wt-toc__list,
.wt-legal__pages ul {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}
.entry--legal .wt-toc__list a,
.wt-legal__pages a {
	display: block;
	padding: 0.35rem 0.875rem;
	border-inline-start: 2px solid var(--wt-legal-line);
	color: var(--wp--preset--color--muted);
	line-height: 1.4;
	text-decoration: none;
}
.entry--legal .wt-toc__list a:hover,
.wt-legal__pages a:hover {
	color: var(--wp--preset--color--ink);
}
.entry--legal .wt-toc__list a.is-active,
.wt-legal__pages a[aria-current="page"] {
	border-inline-start-color: var(--wp--preset--color--primary);
	background: var(--wt-legal-soft);
	color: var(--wp--preset--color--primary-strong);
	font-weight: 600;
}
.wt-legal__toc-inline {
	margin: 0 0 2rem;
	border: 1px solid var(--wt-legal-line);
	border-radius: 1rem;
	background: #fff;
}
.wt-legal__toc-inline summary {
	min-height: 2.75rem;
	padding: 0.75rem 1.125rem;
	font-weight: 600;
	cursor: pointer;
}
.wt-legal__toc-inline .wt-toc__list {
	padding: 0 1rem 1rem;
}
.wt-legal__pages {
	padding-top: 1.5rem;
	border-top: 1px solid var(--wt-legal-line);
}
@media (min-width: 64rem) {
	.wt-legal__pages {
		padding-top: 0;
		border-top: 0;
	}
}

/* ---------- Text: numbered sections ---------- */
.entry--legal .entry-content {
	counter-reset: wt-legal;
	color: var(--wp--preset--color--ink-soft, var(--wp--preset--color--ink));
	font-size: 1.0625rem;
	line-height: 1.75;
}
.entry--legal .entry-content > * {
	margin-block: 0;
}
.entry--legal .entry-content > * + * {
	margin-top: 1.25rem;
}
.entry--legal .entry-content h2 {
	position: relative;
	margin-top: 3.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--wt-legal-line);
	color: var(--wp--preset--color--ink);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	font-weight: 650;
	letter-spacing: -0.03em;
	line-height: 1.15;
	counter-increment: wt-legal;
	scroll-margin-top: calc(var(--wt-site-header-h, 5rem) + 1.5rem);
}
.entry--legal .entry-content h2::before {
	content: counter(wt-legal, decimal-leading-zero);
	display: block;
	margin-bottom: 0.5rem;
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}
.entry--legal .entry-content h3 {
	margin-top: 2rem;
	color: var(--wp--preset--color--ink);
	font-size: 1.25rem;
	font-weight: 650;
	letter-spacing: -0.02em;
}
.entry--legal .entry-content h3 + * {
	margin-top: 0.75rem;
}
.entry--legal .entry-content strong {
	color: var(--wp--preset--color--ink);
}
.entry--legal .entry-content a {
	color: var(--wp--preset--color--primary-strong);
	text-underline-offset: 0.2em;
}
.entry--legal .entry-content ul {
	padding: 0;
	list-style: none;
}
.entry--legal .entry-content ul > li {
	position: relative;
	padding-left: 1.5rem;
}
.entry--legal .entry-content ul > li + li {
	margin-top: 0.625rem;
}
.entry--legal .entry-content ul > li::before {
	content: "";
	position: absolute;
	top: 0.7em;
	left: 0.25rem;
	width: 0.4375rem;
	height: 0.4375rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
}

/* ---------- "In short" card ---------- */
.entry--legal .entry-content .wt-legal-summary {
	position: relative;
	overflow: hidden;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border-radius: 1.5rem;
	background: radial-gradient(120% 110% at 85% 0%, var(--wp--preset--color--stage-raised), var(--wp--preset--color--stage) 62%);
	color: var(--wp--preset--color--stage-muted);
	font-size: 1rem;
}
.entry--legal .entry-content .wt-legal-summary > * {
	max-width: none;
}
.entry--legal .entry-content .wt-legal-summary__title {
	margin: 0 0 1rem;
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.entry--legal .entry-content .wt-legal-summary strong,
.entry--legal .entry-content .wt-legal-summary a {
	color: #fff;
}
.entry--legal .entry-content .wt-legal-summary a {
	text-decoration-color: var(--wp--preset--color--accent);
}
.entry--legal .entry-content .wt-legal-summary ul {
	margin: 0;
}
.entry--legal .entry-content .wt-legal-summary li::before {
	background: var(--wp--preset--color--accent);
}

/* ---------- Tables ---------- */
.entry--legal .entry-content .wp-block-table {
	overflow-x: auto;
	border: 1px solid var(--wt-legal-line);
	border-radius: 1rem;
	background: #fff;
}
.entry--legal .entry-content .wp-block-table table {
	width: 100%;
	min-width: 32rem;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.5;
}
.entry--legal .entry-content .wp-block-table :is(th, td) {
	padding: 0.75rem 1rem;
	border: 0;
	border-bottom: 1px solid var(--wt-legal-line);
	text-align: left;
	vertical-align: top;
}
.entry--legal .entry-content .wp-block-table thead {
	border-bottom: 0;
}
.entry--legal .entry-content .wp-block-table thead th {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.entry--legal .entry-content .wp-block-table tbody tr:last-child td {
	border-bottom: 0;
}
.entry--legal .entry-content .wp-block-table td:first-child {
	color: var(--wp--preset--color--ink);
	font-weight: 600;
}
@media (max-width: 40rem) {
	/* Phones: each row as a short card (its first cell in bold, the others under it) instead of a table to scroll. */
	.entry--legal .entry-content .wp-block-table table {
		min-width: 0;
	}
	.entry--legal .entry-content .wp-block-table thead {
		display: none;
	}
	.entry--legal .entry-content .wp-block-table tr {
		display: block;
		padding: 0.875rem 1rem;
		border-bottom: 1px solid var(--wt-legal-line);
	}
	.entry--legal .entry-content .wp-block-table tbody tr:last-child {
		border-bottom: 0;
	}
	.entry--legal .entry-content .wp-block-table td {
		display: block;
		padding: 0;
		border: 0;
	}
	.entry--legal .entry-content .wp-block-table td + td {
		margin-top: 0.25rem;
		color: var(--wp--preset--color--muted);
	}
}
