/* Legal (18.0 to 21.0), after the user's references (2026-10-20): a short
   red band with the h1 (H1) and its line centred, then
   on the grey page the text at the
   left (section headings H5, text 16px) and a white contents
   card at the right that stays in view. Phones and tablets: heading, card,
   text. template-parts/legal/page.php. */

body.acs-legal .lg-page {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* lets the card's one-line label truncate instead of widening the page */
	gap: 2.5rem;
	max-width: var(--l-wrap);
	margin: 2.5rem auto 0; /* closer to the hero (user, 2026-10-20); 64px from 1024 */
	padding: 0 var(--acs-gutter);
	color: var(--acs-ink);
}

/* ---------- The contents card ---------- */
body.acs-legal .lg-toc {
	min-width: 0;
	padding: 0.5rem; /* 8px all round (user, 2026-10-20) */
	border-radius: 0.75rem; /* as the header dropdowns (user, 2026-10-20; was 16px) */
	background: var(--acs-white);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.acs-legal .lg-toc__title {
	margin: 0 0 0.25rem;
	padding: 0.5rem 0.75rem; /* in line with the links' text */
	font-family: var(--acs-font-body);
	font-weight: 700;
	font-size: 1rem;      /* 16px bold at every width (user, 2026-10-20) */
	line-height: 1.5rem;
}

/* the title is the dropdown's button below 1024; on desktop it reads as a
   plain heading */
body.acs-legal .lg-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

body.acs-legal .lg-toc__toggle svg {
	flex: none;
	color: var(--acs-ink);
}

/* the arrow turns only once the card has settled (legal.js), so it does
   not spin as the card closes itself on load */
body.acs-legal .lg-toc.is-ready .lg-toc__toggle svg {
	transition: transform 0.2s ease;
}

body.acs-legal .lg-toc__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

body.acs-legal .lg-toc__toggle:focus-visible {
	outline: 3px solid var(--acs-ink);
	outline-offset: 4px;
	border-radius: 4px;
}

/* Phones and tablets: the button shows the section in view, ink, bold,
   one line then an ellipsis, centred on the arrow (user, 2026-10-20);
   "Table of contents" stays for screen readers. Desktop: the name, no
   current section. */
body.acs-legal .lg-toc__current {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	color: var(--acs-ink);
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
	position: relative;
	top: 0.125em; /* the capitals sit 0.125em above the line's middle (the site's button rule), so they centre on the arrow */
}

body.acs-legal .lg-toc__name {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* closed: the button only (legal.js; without JS the list shows) */
body.acs-legal .lg-toc.is-closed .lg-toc__title {
	margin-bottom: 0;
}

body.acs-legal .lg-toc.is-closed .lg-toc__list {
	display: none;
}

body.acs-legal .lg-toc__list {
	display: grid;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.acs-legal .lg-toc__link {
	display: block;
	padding: 0.625rem 0.75rem;
	border-radius: 0.375rem; /* inside the card's 12px corner */
	color: var(--acs-ink-soft);
	font-size: 0.875rem;
	line-height: 1.375rem;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

body.acs-legal .lg-toc__link:hover {
	color: var(--acs-red);
}

/* the section in view */
body.acs-legal .lg-toc__link[aria-current="true"] {
	background: rgba(var(--l-red-rgb), 0.08);
	color: var(--acs-red);
	font-weight: 700;
}

body.acs-legal .lg-toc__link:focus-visible {
	outline: 3px solid var(--acs-ink);
	outline-offset: 2px;
}

/* ---------- The text ---------- */
body.acs-legal .lg-page__text {
	max-width: 48rem;
	font-size: 1rem;      /* 16px (user, 2026-10-20) */
	line-height: 1.5rem;
	overflow-wrap: anywhere; /* long addresses and references on phones */
}

/* section headings at H5, the style guide's display face (user, 2026-10-20) */
body.acs-legal .lg-page__text h2 {
	margin: 3rem 0 0; /* 48px from the text above (user, 2026-10-20) */
	font-family: var(--acs-font-display);
	font-weight: 400;
	font-size: var(--acs-h5-size);
	line-height: var(--acs-h5-lh);
	text-transform: uppercase;
	text-wrap: balance;
	overflow-wrap: normal;
	scroll-margin-top: calc(var(--acs-pin-h) + 1.5rem);
}

/* sub-headings at Body XL bold (user, 2026-10-20) */
body.acs-legal .lg-page__text h3 {
	margin: 3rem 0 0; /* 48px from the text above (user, 2026-10-20) */
	font-family: var(--acs-font-body);
	font-weight: 700;
	font-size: var(--acs-text-xl-size);
	line-height: var(--acs-text-xl-lh);
	text-wrap: balance;
}

body.acs-legal .lg-page__text > :first-child {
	margin-top: 0;
}

body.acs-legal .lg-page__text p,
body.acs-legal .lg-page__text ul,
body.acs-legal .lg-page__text ol {
	margin: 0.75rem 0 0;
}

/* 12px from a heading to what follows it, a sub-heading too (user, 2026-10-20) */
body.acs-legal .lg-page__text h2 + *,
body.acs-legal .lg-page__text h3 + * {
	margin-top: 0.75rem;
}

/* a section heading straight over a sub-heading: 16px (user, 2026-10-20) */
body.acs-legal .lg-page__text h2 + h3 {
	margin-top: 1rem;
}

body.acs-legal .lg-page__text ul,
body.acs-legal .lg-page__text ol {
	padding-left: 1.25rem;
}

/* bullets: a 6px red circle, centred on the item's first line (user,
   2026-10-20; the browser's dot was 5px) */
body.acs-legal .lg-page__text ul {
	padding-left: 0;
	list-style: none;
}

body.acs-legal .lg-page__text ul > li {
	position: relative;
	padding-left: 1.5rem;
}

body.acs-legal .lg-page__text ul > li::before {
	content: "";
	position: absolute;
	top: calc((1.5rem - 0.375rem) / 2);
	left: 0.375rem;
	width: 0.375rem;
	height: 0.375rem;
	border-radius: 50%;
	background: var(--acs-red);
}

body.acs-legal .lg-page__text li + li {
	margin-top: 0.75rem;
}

body.acs-legal .lg-page__text a {
	color: var(--acs-red);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

body.acs-legal .lg-page__text a:hover {
	color: var(--acs-red-deep);
}

body.acs-legal .lg-page__text a:focus-visible {
	outline: 3px solid var(--acs-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ================= Desktop (built at 1440) ================= */
@media (min-width: 1024px) {
	body.acs-legal .lg-page {
		grid-template-columns: minmax(0, 1fr) 26.25rem; /* the card 420px (user, 2026-10-20) */
		column-gap: 5rem;
		margin-top: 4rem;
	}


	body.acs-legal .lg-page__text {
		grid-column: 1;
		grid-row: 1;
	}

	/* desktop: always open, the title a plain heading */
	body.acs-legal .lg-toc__toggle {
		cursor: default;
		pointer-events: none;
	}

	body.acs-legal .lg-toc__toggle svg {
		display: none;
	}

	body.acs-legal .lg-toc__name {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
		white-space: normal;
	}

	body.acs-legal .lg-toc__current {
		display: none;
	}

	/* the card beside the text, in view while it scrolls */
	body.acs-legal .lg-toc {
		grid-column: 2;
		grid-row: 1;
		position: sticky;
		top: calc(var(--acs-pin-h) + 1.5rem);
		align-self: start;
	}
}
