/*
 * A legal document's own page (legal-document.php), over the single-page
 * design in single.css: the text set for reading an act — chapters and
 * articles as clear landmarks, numbered points hanging in the margin — and a
 * side column with the PDF, printing and the table of contents.
 */

/* ------------------------------------------------------------------ text */

.arm-ld__text {
	max-width: 780px;
	font-size: 16.5px;
	line-height: 1.75;
}

.arm-ld__text .doc-lead,
.arm-ld__text > .doc-p:first-child {
	font-size: 18px;
	color: var(--arm-text);
}

.arm-ld__text .doc-p,
.arm-ld__text .doc-pt {
	margin: 0 0 0.75em;
	text-align: start;
}

/* A numbered point: its number hangs in the margin, the text keeps one edge. */
.arm-ld__text .doc-pt {
	position: relative;
	padding-left: 2.6em;
}

.arm-ld__text .doc-n {
	position: absolute;
	left: 0;
	top: 0;
	min-width: 2.1em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--arm-brown);
}

/* Sub-points — 1), 2)… — step in once more. */
.arm-ld__text .doc-pt--sub {
	margin-left: 2.6em;
}

.arm-ld__text .doc-p.doc-pt--sub {
	padding-left: 0;
}

.arm-ld__text .doc-list {
	margin: -0.3em 0 0.9em 2.6em;
	padding-left: 1.1em;
}

.arm-ld__text .doc-list li {
	margin-bottom: 0.25em;
}

.arm-ld__text .doc-list li::marker {
	color: var(--arm-gold);
}

/* Chapters: a gold kicker over a heading in the house display face, with room
   above — the place a reader looks for when scanning. */
.arm-ld__text h2.doc-h2 {
	margin: 2.2em 0 0.9em;
	padding-top: 1.1em;
	border-top: 1px solid var(--arm-line);
	font-size: clamp(24px, 2.4vw, 30px);
	line-height: 1.15;
	scroll-margin-top: calc(var(--arm-header-h) + 20px);
}

.arm-ld__text > h2.doc-h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.arm-ld__text h3.doc-h3 {
	margin: 1.9em 0 0.7em;
	font-family: var(--arm-font-body);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.01em;
	scroll-margin-top: calc(var(--arm-header-h) + 20px);
}

.arm-ld__text .doc-kicker {
	display: block;
	margin-bottom: 6px;
	font-family: var(--arm-font-body);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--arm-gold);
}

.arm-ld__text h3.doc-h3 .doc-kicker {
	display: inline;
	margin: 0 4px 0 0;
	font-size: inherit;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--arm-brown);
}

/* The ethics rules open with a preamble: the verbs in small capitals. */
.arm-ld__text .doc-keyword {
	margin: 1.4em 0 0.2em;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.18em;
	color: var(--arm-brown);
}

.arm-ld__text .doc-keyword:first-child {
	margin-top: 0;
}

.arm-ld__text .doc-proclaim {
	margin: 1.8em 0 0.8em;
	font-family: var(--arm-font-head);
	font-size: 24px;
	letter-spacing: 0.06em;
	text-align: center;
	color: var(--arm-text);
}

/* The signature block at the foot of a law. */
.arm-ld__text .doc-sign {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px 40px;
	margin-top: 2.6em;
	padding-top: 1.4em;
	border-top: 1px solid var(--arm-line);
	font-size: 15px;
	color: var(--arm-muted);
}

.arm-ld__text .doc-sign p {
	margin: 0;
}

.arm-ld__text .doc-sign strong {
	color: var(--arm-text);
}

/* ----------------------------------------------------------- side column */

.arm-ld__actions {
	display: grid;
	gap: 10px;
}

.arm-ld__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
}

.arm-ld__print {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 11px 18px;
	border: 1px solid var(--arm-line);
	border-radius: 999px;
	background: transparent;
	color: var(--arm-text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.arm-ld__print:hover,
.arm-ld__print:focus-visible {
	border-color: var(--arm-brown);
	color: var(--arm-brown);
}

/* The contents scroll on their own inside the sticky column. */
.arm-ld__toc {
	max-height: calc(100vh - var(--arm-header-h) - 220px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.arm-ld__toc-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.arm-ld__toc-item a {
	display: block;
	padding: 6px 8px;
	border-radius: 8px;
	color: var(--arm-text);
	font-size: 13.5px;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.arm-ld__toc-item a:hover,
.arm-ld__toc-item a:focus-visible {
	background: var(--arm-bg-alt);
}

.arm-ld__toc-item--2 + .arm-ld__toc-item--2,
.arm-ld__toc-item--3 + .arm-ld__toc-item--2 {
	margin-top: 6px;
}

.arm-ld__toc-item--2 a {
	font-weight: 700;
}

.arm-ld__toc-item--3 a {
	padding-left: 18px;
	color: #4a443e;
}

.arm-ld__toc-kicker {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--arm-gold);
}

.arm-ld__toc-item--3 .arm-ld__toc-kicker {
	display: inline;
	margin-right: 4px;
	font-size: inherit;
	letter-spacing: 0;
	text-transform: none;
	color: var(--arm-brown);
}

@media (max-width: 900px) {
	/* On one column the PDF and the contents come first, folded short. */
	.arm-ld__layout {
		grid-template-areas:
			"side"
			"content";
	}

	.arm-ld__toc {
		max-height: 320px;
	}
}

@media (max-width: 600px) {
	.arm-ld__text {
		font-size: 15.5px;
	}

	.arm-ld__text .doc-pt {
		padding-left: 2.2em;
	}

	.arm-ld__text .doc-pt--sub,
	.arm-ld__text .doc-list {
		margin-left: 1.2em;
	}
}

/* --------------------------------------------------------------- print */

@media print {
	.arm-header,
	.arm-footer,
	.arm-ld__side,
	.arm-sp__crumbs,
	.arm-sp__scrim,
	.arm-sp__hero-img {
		display: none !important;
	}

	.arm-sp__hero {
		min-height: 0 !important;
		background: none !important;
		color: #000 !important;
	}

	.arm-sp__hero-inner {
		padding: 0 0 12px !important;
	}

	.arm-sp__title,
	.arm-sp__badge,
	.arm-sp__facts {
		color: #000 !important;
	}

	.arm-sp__layout {
		display: block !important;
		padding: 0 !important;
	}

	.arm-ld__text {
		max-width: none;
		font-size: 11.5pt;
		line-height: 1.5;
	}

	.arm-ld__text h2.doc-h2,
	.arm-ld__text h3.doc-h3 {
		break-after: avoid;
	}
}
