/**
 * The Responsible Armed Citizen — public reading layout.
 *
 * Design direction: statutory annotation. This is a legal reference a student
 * consults under pressure, not a marketing page, so the work goes into
 * legibility, scanability and a sense of authority — the same navy, the same
 * serif measure and the same "why it matters" device as the printed edition,
 * with a timeline rail as the one memorable structural gesture.
 *
 * Two constraints shape the implementation:
 *
 * 1. It renders inside whatever theme the site runs, so anything that affects
 *    reading is re-declared rather than inherited. Everything is scoped under
 *    .racg-doc and the resets are narrow — no global element selectors, no
 *    !important sprays that a theme then has to fight.
 *
 * 2. No webfont is loaded. Forcing a font download on someone else's site for
 *    a body-text serif is a poor trade; the stack below prefers genuinely
 *    well-drawn faces already present on the reader's machine and degrades to
 *    Georgia, which is on essentially everything.
 */

.racg-doc {
	/* Palette — mirrors the PDF, driven by the plugin's accent setting.
	   The "-set" values are injected on :root by the plugin; the literals here
	   are the fallbacks. They must be consumed through var() like this rather
	   than declared directly, because a declaration on .racg-doc shadows the
	   same property on :root and the setting would never take effect. */
	--racg-accent: var(--racg-accent-set, #163052);
	--racg-accent-soft: var(--racg-accent-soft-set, #eaf0f6);
	--racg-ink: #16202b;
	--racg-body: #2a3542;

	/* Secondary text. The previous values (#66727f / #97a1ac) sat at 4.9:1 and
	   2.6:1 on white — the second failing AA outright — and both read as washed
	   out next to the body copy. These are 6.9:1 and 4.9:1. */
	--racg-muted: #4f5b68;
	--racg-faint: #67727f;

	/* Derived from the accent by the plugin and injected inline; the values
	   here are the fallbacks for the default navy. The accent itself is a
	   print colour, and at 13:1 on white it is so dark that against body text
	   it reads as black rather than blue — 1.07:1 apart, which is why headings
	   and links stopped announcing themselves. These sit at 9:1 and 7:1 on
	   white while staying clearly in the same hue family. */
	--racg-heading: var(--racg-heading-set, #1a4a7f);
	--racg-link: var(--racg-link-set, #0f5aa0);
	--racg-rule: #d9e0e8;
	--racg-hair: #e9edf2;
	--racg-page: #fff;
	--racg-warn: #8c281c;
	--racg-warn-bg: #fdf3f1;
	--racg-warn-line: #d3a49b;

	/* Font stack, chosen by measurement rather than taste.
	   The previous stack led with Iowan Old Style and Palatino Linotype. Iowan
	   and Charter are macOS-only, so Windows — most of this audience — fell
	   through to Palatino Linotype, which measured as the lightest and
	   smallest-x-height face of every candidate (ink density 5.02 vs Georgia's
	   5.58, x-height 46 vs 48). That is why the page read faint no matter what
	   the contrast ratios said: the problem was stroke weight, not colour.
	   Palatino is gone. macOS gets Charter, everything else lands on Georgia —
	   the densest of the universally installed serifs, and drawn for screens. */
	--racg-serif: Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
	--racg-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

	--racg-measure: 66ch;
	--racg-rail-w: 16.5rem;
	--racg-gap: clamp(2rem, 4vw, 4rem);

	/* Set per-instance via the shortcode's offset attribute, for themes with a
	   fixed header that would otherwise sit on top of the sticky rail and on
	   anything scrolled to from the contents. */
	--racg-offset: 0px;

	position: relative;
	color: var(--racg-body);
	font-family: var(--racg-serif);
	font-size: clamp(1.06rem, 1.01rem + 0.22vw, 1.15rem);
	line-height: 1.7;
	font-kerning: normal;

	/* Lining, tabular figures. Old-style numerals sit below the baseline at
	   varying heights, which is charming in prose and actively unhelpful in a
	   document whose content is years and statute numbers — "1911", "§ 265.01-e",
	   "18-Hour" all became harder to pick out. */
	font-variant-numeric: lining-nums tabular-nums;
}

/* -webkit-font-smoothing: antialiased is deliberately NOT set. It thins
   strokes wherever it is honoured, which is the opposite of what long-form
   body text needs — it was making this page look faint. */

.racg-doc *,
.racg-doc *::before,
.racg-doc *::after {
	box-sizing: border-box;
}

/* Narrow, deliberate resets — themes love to style these. */
.racg-doc p,
.racg-doc ul,
.racg-doc ol,
.racg-doc li,
.racg-doc h1,
.racg-doc h2,
.racg-doc h3,
.racg-doc h4,
.racg-doc figure,
.racg-doc table {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* Body links carry an underline as well as colour. Themes routinely strip
   underlines, and colour alone is not a sufficient signal (WCAG 1.4.1). */
.racg-doc a {
	color: var(--racg-link);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.14em;
	text-decoration-color: color-mix(in srgb, var(--racg-link) 45%, transparent);
}

.racg-doc a:hover,
.racg-doc a:focus {
	text-decoration-thickness: 2px;
	text-decoration-color: currentColor;
}

/* Navigation and buttons are identifiable by position and shape, so they do
   not need the underline that inline prose links do. */
.racg-doc .racg-toc a,
.racg-doc .racg-download-button,
.racg-doc .racg-skip {
	text-decoration-line: none;
}

.racg-doc :focus-visible {
	outline: 2px solid var(--racg-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Accessibility helpers */

.racg-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 20;
	background: var(--racg-accent);
	color: #fff;
	padding: 0.7em 1.2em;
	font-family: var(--racg-sans);
	font-size: 0.85rem;
	text-decoration: none;
}

.racg-skip:focus {
	left: 0;
}

.racg-doc .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Reading progress — a hairline, not a candy bar. */

.racg-progress {
	position: sticky;
	top: var(--racg-offset);
	z-index: 12;
	height: 2px;
	background: var(--racg-hair);
	margin-bottom: -2px;
}

.racg-progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--racg-accent);
	transform-origin: left;
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */

.racg-doc-header {
	padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
	border-bottom: 1px solid var(--racg-rule);
	margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.racg-masthead {
	max-width: 52rem;
	margin-inline: auto;
	text-align: center;
	padding-inline: 1.25rem;
}

.racg-doc-title {
	font-family: var(--racg-sans);
	font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.4rem);
	line-height: 1.06;
	font-weight: 600;
	letter-spacing: 0.015em;
	text-transform: uppercase;
	color: var(--racg-heading);
	margin: 0 0 0.6em;
	text-wrap: balance;
}

.racg-doc-subtitle {
	font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
	line-height: 1.45;
	font-style: italic;
	color: var(--racg-muted);
	margin: 0 auto 2rem;
	max-width: 44rem;
	text-wrap: balance;
}

.racg-cover-box {
	background: var(--racg-accent-soft);
	border: 1px solid color-mix(in srgb, var(--racg-accent) 22%, transparent);
	padding: 1.35rem 1.75rem;
	margin-bottom: 1.25rem;
}

.racg-prepared {
	font-family: var(--racg-sans);
	font-weight: 600;
	font-size: 0.98rem;
	line-height: 1.45;
	color: var(--racg-heading);
	margin: 0 0 0.4em;
	text-wrap: balance;
}

.racg-org {
	margin: 0;
	color: var(--racg-muted);
	font-size: 0.92rem;
}

.racg-disclaimer {
	border: 1px solid var(--racg-warn-line);
	background: var(--racg-warn-bg);
	padding: 1rem 1.35rem;
}

.racg-disclaimer-title {
	font-family: var(--racg-sans);
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--racg-warn);
	margin: 0 0 0.4em;
}

.racg-disclaimer-body {
	margin: 0;
	color: #5c2a24;
	font-size: 0.92rem;
	line-height: 1.55;
}

/* Reading font, switchable per instance with the shortcode's font attribute.
   Some readers simply find a sans easier on screen; this is not a judgement
   about which is better, it is a knob so the site owner can decide. */
.racg-font-sans {
	--racg-serif: var(--racg-sans);
	font-size: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
}

.racg-font-system {
	--racg-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
}

/* ── Dark surfaces ────────────────────────────────────────────────────────────
   The guide inherits the page background, and the palette above assumes that
   background is light. On a dark theme every value inverts into unreadability:
   on handgunlearning.com's #001731 the body text measured 1.45:1, which is
   effectively invisible.

   This block is applied when the shortcode is given surface="dark", or when the
   script detects a dark background behind the guide at runtime. Colours are
   measured against #001731; all clear AAA. */
.racg-doc.racg-theme-dark {
	--racg-ink: #f4f8fc;          /* 16.9:1 */
	--racg-body: #d6dfe9;         /* 13.4:1 */
	--racg-muted: #aebcca;        /*  9.3:1 */
	--racg-faint: #8b9bab;        /*  6.3:1 */

	--racg-heading: var(--racg-heading-dark-set, #8cbcec);  /* 9.0:1 */
	--racg-link: var(--racg-link-dark-set, #8cc4f5);        /* 9.7:1 */

	--racg-rule: rgba(255, 255, 255, 0.20);
	--racg-hair: rgba(255, 255, 255, 0.10);
	--racg-page: #0d1b2b;
	--racg-accent-soft: rgba(255, 255, 255, 0.07);

	--racg-warn: #ffb9ab;
	--racg-warn-bg: rgba(255, 96, 64, 0.10);
	--racg-warn-line: rgba(255, 150, 130, 0.45);
}

/* Hard-coded light values elsewhere in the sheet have to be answered here. */
.racg-doc.racg-theme-dark .racg-disclaimer-body {
	color: #f0cfc7;
}

.racg-doc.racg-theme-dark .racg-section-callout,
.racg-doc.racg-theme-dark .racg-toc-inline .racg-doc-main > .racg-toc {
	background: rgba(255, 255, 255, 0.04);
	border-color: var(--racg-rule);
}

.racg-doc.racg-theme-dark tbody tr:nth-child(even) td {
	background: rgba(255, 255, 255, 0.03);
}

.racg-doc.racg-theme-dark .racg-cover-box {
	border-color: var(--racg-rule);
}

/* On a dark page a deep navy button disappears; invert it. */
.racg-doc.racg-theme-dark .racg-download-button {
	background: var(--racg-heading);
	color: #08121d;
}

.racg-doc.racg-theme-dark .racg-download-button:hover,
.racg-doc.racg-theme-dark .racg-download-button:focus {
	background: color-mix(in srgb, var(--racg-heading) 82%, #fff);
	color: #08121d;
}

.racg-doc.racg-theme-dark .racg-top {
	background: var(--racg-page);
	border-color: var(--racg-rule);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.racg-doc.racg-theme-dark .racg-progress span,
.racg-doc.racg-theme-dark .racg-skip {
	background: var(--racg-heading);
}

.racg-doc.racg-theme-dark .racg-skip {
	color: #08121d;
}

.racg-doc.racg-theme-dark .racg-section-timeline::after {
	border-color: var(--racg-heading);
	background: var(--racg-page);
}

.racg-doc.racg-theme-dark .racg-why {
	border-left-color: var(--racg-heading);
}

.racg-doc.racg-theme-dark .racg-part-title {
	border-bottom-color: var(--racg-heading);
}

.racg-doc.racg-theme-dark th {
	background: rgba(255, 255, 255, 0.07);
}

.racg-doc.racg-theme-dark :focus-visible {
	outline-color: var(--racg-heading);
}

/* Visited links.
   Browsers resolve :visited under privacy restrictions: only a few properties
   apply, and custom properties are not among them — a var()-derived colour is
   simply ignored, so a visited contents link kept rendering in the light
   palette on a dark page (2.6:1). These restate the same colours as literals,
   which :visited does honour. */
.racg-doc.racg-theme-dark a:visited { color: #8cc4f5; }
.racg-doc.racg-theme-dark .racg-toc-sections a:visited { color: #aebcca; }
.racg-doc.racg-theme-dark .racg-toc-part > a:visited { color: #f4f8fc; }
.racg-doc.racg-theme-dark .racg-toc a.is-current:visited { color: #8cbcec; }

.racg-doc a:visited { color: #0f5aa0; }
.racg-doc .racg-toc-sections a:visited { color: #4f5b68; }
.racg-doc .racg-toc-part > a:visited { color: #16202b; }
.racg-doc .racg-toc a.is-current:visited { color: #1a4a7f; }

/* surface="light" paints the guide its own sheet, so it stays readable no
   matter what the theme does behind it. */
.racg-doc.racg-theme-sheet {
	background: #fff;
	padding: clamp(1.25rem, 3vw, 2.5rem);
	border-radius: 4px;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

/* The text column is capped at a readable measure, so the grid tracks are
   sized to exactly rail + measure and the whole pair is centred. Letting the
   second track take 1fr instead would stretch it to the container width and
   strand a dead gutter to the right of every paragraph. */
.racg-doc-body {
	display: grid;
	grid-template-columns: var(--racg-rail-w) minmax(0, var(--racg-measure));
	justify-content: center;
	gap: var(--racg-gap);
	align-items: start;
	max-width: 78rem;
	margin-inline: auto;
	padding: 0 1.25rem clamp(3rem, 6vw, 6rem);
}

.racg-doc-main {
	min-width: 0;
}

/* Width modes.
   'measure' (default) keeps the readable column above; 'wide' lets the text
   run to the container; 'full' also drops the container cap, for themes that
   already constrain their content area. */
.racg-width-wide .racg-doc-body,
.racg-width-full .racg-doc-body {
	grid-template-columns: var(--racg-rail-w) minmax(0, 1fr);
	justify-content: stretch;
}

.racg-width-full .racg-doc-body {
	max-width: none;
	padding-inline: 0;
}

/* Contents rendered inline above the guide rather than in a rail. */
.racg-toc-inline .racg-doc-body,
.racg-no-rail .racg-doc-body {
	grid-template-columns: minmax(0, var(--racg-measure));
}

.racg-toc-inline.racg-width-wide .racg-doc-body,
.racg-toc-inline.racg-width-full .racg-doc-body,
.racg-no-rail.racg-width-wide .racg-doc-body,
.racg-no-rail.racg-width-full .racg-doc-body {
	grid-template-columns: minmax(0, 1fr);
}

.racg-toc-inline .racg-doc-main > .racg-toc {
	border-left: 0;
	padding: 1.5rem 1.75rem;
	margin-bottom: 2.5rem;
	background: #fafbfc;
	border: 1px solid var(--racg-rule);
}

.racg-toc-inline .racg-doc-main > .racg-toc .racg-toc-heading {
	margin-top: 0;
}

/* ── Contents rail ────────────────────────────────────────────────────────── */

.racg-rail {
	position: sticky;
	top: calc(1.5rem + var(--racg-offset));
	max-height: calc(100vh - 3rem - var(--racg-offset));
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.racg-rail-toggle {
	display: none;
}

.racg-rail-panel {
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 0.5rem;
	min-height: 0;
	scrollbar-width: thin;
}

.racg-doc .racg-toc {
	border-left: 1px solid var(--racg-rule);
	padding-left: 1.1rem;
}

.racg-toc-heading {
	font-family: var(--racg-sans);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--racg-faint);
	margin: 0 0 1rem;
}

.racg-doc .racg-toc-list,
.racg-doc .racg-toc-sections {
	list-style: none;
	margin: 0;
	padding: 0;
}

.racg-toc-part {
	margin-bottom: 0.9rem;
}

.racg-toc-part > a {
	display: block;
	font-family: var(--racg-sans);
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--racg-ink);
	text-decoration: none;
	padding: 0.15rem 0;
	transition: color 0.15s ease;
}

.racg-toc-part > a:hover {
	color: var(--racg-link);
}

.racg-doc .racg-toc-sections {
	margin-top: 0.4rem;
	padding-left: 0.1rem;
	border-left: 1px solid var(--racg-hair);
}

.racg-toc-sections li {
	margin: 0;
}

.racg-toc-sections a {
	display: block;
	font-size: 0.84rem;
	line-height: 1.45;
	color: var(--racg-muted);
	text-decoration: none;
	padding: 0.26rem 0 0.26rem 0.85rem;
	margin-left: -1px;
	border-left: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
	font-variant-numeric: tabular-nums;
}

.racg-toc-sections a:hover {
	color: var(--racg-link);
	border-left-color: var(--racg-rule);
}

/* Scroll-spy.
   Two states: the entry being read, and the part containing it. The part is
   marked more quietly — it is context, not the answer to "where am I". */
.racg-toc a.is-current {
	color: var(--racg-heading);
	font-weight: 600;
	border-left-color: var(--racg-heading);
}

.racg-toc-part > a.is-current,
.racg-toc-part > a.is-current-part {
	color: var(--racg-heading);
	position: relative;
}

.racg-toc-part > a.is-current-part::before {
	content: "";
	position: absolute;
	left: -1.1rem;
	top: 0.4em;
	bottom: 0.4em;
	width: 2px;
	background: var(--racg-heading);
}

.racg-rail-download {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--racg-rule);
}

.racg-rail-meta {
	margin: 0.55rem 0 0;
	font-size: 0.75rem;
	color: var(--racg-faint);
	font-family: var(--racg-sans);
}

/* ── Parts ────────────────────────────────────────────────────────────────── */

.racg-doc .racg-part {
	margin-bottom: clamp(3rem, 6vw, 5rem);
	scroll-margin-top: calc(2rem + var(--racg-offset));
}

.racg-doc .racg-part-title {
	font-family: var(--racg-sans);
	font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
	font-weight: 600;
	line-height: 1.2;
	color: var(--racg-heading);
	margin: 0 0 1.25rem;
	padding-bottom: 0.7rem;
	border-bottom: 2px solid var(--racg-heading);
	text-wrap: balance;
}

.racg-part-intro {
	color: var(--racg-muted);
	font-size: 1.02em;
	margin-bottom: 2.5rem;
}

.racg-part-intro p {
	margin-bottom: 0.9em;
}

.racg-part-intro p:last-child {
	margin-bottom: 0;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.racg-doc .racg-section {
	margin-bottom: 2.75rem;
	scroll-margin-top: calc(2rem + var(--racg-offset));
}

.racg-doc .racg-section-title {
	font-family: var(--racg-sans);
	font-weight: 600;
	line-height: 1.28;
	color: var(--racg-ink);
	margin: 0 0 0.75rem;
	text-wrap: balance;
}

.racg-doc h2.racg-section-title { font-size: 1.32rem; }
.racg-doc h3.racg-section-title { font-size: 1.14rem; }
.racg-doc h4.racg-section-title { font-size: 1.02rem; }

.racg-section-body > p {
	margin-bottom: 1.05em;
}

.racg-section-body > p:last-child {
	margin-bottom: 0;
}

.racg-section-body ul,
.racg-section-body ol {
	margin: 0 0 1.05em 1.4em;
	padding: 0;
}

.racg-section-body li {
	margin-bottom: 0.45em;
	padding-left: 0.2em;
}

.racg-section-body li::marker {
	color: var(--racg-faint);
}

/* Timeline entries — the structural signature of Part I.
   A hairline rail with the year set on it, so a reader scanning for a decade
   finds it without reading a word. */

.racg-doc .racg-section-timeline {
	position: relative;
	padding-left: clamp(3.5rem, 7vw, 5.25rem);
	padding-bottom: 0.5rem;
}

.racg-section-timeline::before {
	content: "";
	position: absolute;
	left: clamp(1.75rem, 3.5vw, 2.6rem);
	top: 0.55em;
	bottom: -2.75rem;
	width: 1px;
	background: var(--racg-rule);
}

.racg-section-timeline:last-child::before {
	bottom: 0;
}

.racg-section-timeline::after {
	content: "";
	position: absolute;
	left: clamp(1.75rem, 3.5vw, 2.6rem);
	top: 0.55em;
	width: 9px;
	height: 9px;
	background: var(--racg-page);
	border: 2px solid var(--racg-accent);
	border-radius: 50%;
	transform: translate(-4px, 0);
}

.racg-doc .racg-year {
	position: absolute;
	left: 0;
	top: 0;
	width: clamp(1.5rem, 3vw, 2.2rem);
	font-family: var(--racg-sans);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.5;
	color: var(--racg-heading);
	margin: 0;
	font-variant-numeric: tabular-nums lining-nums;
	text-align: right;
	opacity: 1;
}

/* "Why it matters" — the takeaway box, same device as the print edition. */

.racg-doc .racg-why {
	background: var(--racg-accent-soft);
	border-left: 3px solid var(--racg-accent);
	padding: 0.95rem 1.35rem;
	margin-top: 1.25rem;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--racg-ink);
}

.racg-why-label {
	font-family: var(--racg-sans);
	font-weight: 700;
	font-size: 0.68rem;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--racg-heading);
	display: block;
	margin-bottom: 0.3em;
}

/* Callouts */

.racg-doc .racg-section-callout {
	background: #f7f9fb;
	border: 1px solid var(--racg-rule);
	padding: 1.5rem 1.75rem;
}

.racg-callout-title {
	font-family: var(--racg-sans);
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--racg-heading);
	margin: 0 0 0.7rem;
}

/* Tables — wide ones scroll instead of blowing out the column. */

.racg-doc .wp-block-table,
.racg-doc figure.wp-block-table {
	margin: 0 0 1.05em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.racg-doc table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
	line-height: 1.5;
}

.racg-doc th,
.racg-doc td {
	border: 1px solid var(--racg-rule);
	padding: 0.7rem 0.85rem;
	text-align: left;
	vertical-align: top;
}

.racg-doc th {
	background: var(--racg-accent-soft);
	color: var(--racg-heading);
	font-family: var(--racg-sans);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.racg-doc tbody tr:nth-child(even) td {
	background: #fbfcfd;
}

/* Colophon */

.racg-doc .racg-colophon {
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 2px solid var(--racg-accent);
	text-align: center;
	font-size: 0.88rem;
	color: var(--racg-muted);
}

.racg-colophon p {
	margin: 0 0 0.3em;
}

.racg-colophon-tagline {
	font-family: var(--racg-sans);
	font-weight: 600;
	color: var(--racg-heading);
}

/* ── Download button ──────────────────────────────────────────────────────── */

.racg-download {
	margin: 1.75rem 0;
}

.racg-doc .racg-download-button,
.racg-download-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: var(--racg-accent, #163052);
	color: #fff;
	text-decoration: none;
	padding: 0.75rem 1.4rem;
	border-radius: 3px;
	font-family: var(--racg-sans, sans-serif);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.3;
	text-align: center;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.racg-download-button:hover,
.racg-download-button:focus {
	background: color-mix(in srgb, var(--racg-accent, #163052) 86%, #fff);
	color: #fff;
	text-decoration: none;
}

.racg-download-button:active {
	transform: translateY(1px);
}

/* Standalone button (shortcode used on its own, outside the guide) */
.racg-download .racg-download-button {
	width: auto;
}

.racg-download-meta {
	margin: 0.5rem 0 0;
	font-size: 0.82rem;
	color: var(--racg-muted, #66727f);
}

/* ── Back to top ──────────────────────────────────────────────────────────── */

.racg-top {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	z-index: 15;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: 1px solid var(--racg-rule);
	background: var(--racg-page);
	color: var(--racg-heading);
	font-size: 1.05rem;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(22, 48, 82, 0.14);
	transition: transform 0.15s ease, opacity 0.2s ease;
}

.racg-top:hover {
	transform: translateY(-2px);
}

.racg-top[hidden] {
	display: none;
}

/* ── Editor notice ────────────────────────────────────────────────────────── */

.racg-notice {
	border-left: 4px solid #d19a00;
	background: #fff8e5;
	padding: 0.85rem 1.15rem;
	margin: 1rem 0;
	font-size: 0.95rem;
}

/* ── Narrow screens ───────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.racg-doc-body {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}

	.racg-doc-main {
		max-width: none;
	}

	.racg-rail {
		position: sticky;
		top: var(--racg-offset);
		z-index: 10;
		max-height: none;
		background: var(--racg-page);
		border-bottom: 1px solid var(--racg-rule);
		margin-inline: -1.25rem;
		padding: 0 1.25rem;
	}

	.racg-rail-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		background: none;
		border: 0;
		padding: 0.9rem 0;
		cursor: pointer;
		font-family: var(--racg-sans);
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.13em;
		text-transform: uppercase;
		color: var(--racg-heading);
	}

	.racg-rail-toggle-icon {
		width: 0.55rem;
		height: 0.55rem;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg) translate(-2px, -2px);
		transition: transform 0.2s ease;
	}

	.racg-rail-toggle[aria-expanded="true"] .racg-rail-toggle-icon {
		transform: rotate(-135deg) translate(-2px, -2px);
	}

	.racg-rail-panel {
		max-height: 0;
		overflow: hidden;
		padding: 0;
		transition: max-height 0.25s ease;
	}

	/* A plain length, not min()/clamp(): Chrome will not interpolate max-height
	   from 0 to a math function, so with a transition on the property the
	   drawer silently stays shut. 60vh is the cap either way at this width. */
	.racg-rail-panel.is-open {
		max-height: 60vh;
		overflow-y: auto;
		padding: 0 0 1.25rem;
	}

	.racg-doc .racg-toc {
		border-left: 0;
		padding-left: 0;
	}

	.racg-toc-heading {
		display: none;
	}

	.racg-section-timeline {
		padding-left: 2.75rem;
	}

	.racg-section-timeline::before,
	.racg-section-timeline::after {
		left: 1rem;
	}

	.racg-doc .racg-year {
		width: 1.5rem;
		font-size: 0.72rem;
	}

	.racg-top {
		right: 1rem;
		bottom: 1rem;
	}
}

@media (max-width: 480px) {
	.racg-doc {
		--racg-measure: none;
	}

	.racg-cover-box,
	.racg-disclaimer {
		padding-inline: 1rem;
	}

	.racg-doc .racg-why {
		padding: 0.85rem 1rem;
	}
}

/* ── Motion preferences ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.racg-doc *,
	.racg-doc *::before,
	.racg-doc *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── Print ────────────────────────────────────────────────────────────────── */

@media print {
	.racg-rail,
	.racg-progress,
	.racg-top,
	.racg-skip,
	.racg-rail-download {
		display: none !important;
	}

	.racg-doc {
		--racg-page: #fff;
		font-size: 10.5pt;
		line-height: 1.5;
		color: #000;
	}

	.racg-doc-body {
		display: block;
		max-width: none;
		padding: 0;
	}

	.racg-doc-main {
		max-width: none;
	}

	.racg-doc-header {
		padding-top: 0;
	}

	.racg-doc .racg-part {
		break-before: page;
	}

	.racg-doc-header + .racg-doc-body .racg-part:first-child {
		break-before: auto;
	}

	.racg-doc .racg-part-title,
	.racg-doc .racg-section-title {
		break-after: avoid;
	}

	.racg-doc .racg-section-timeline,
	.racg-doc .racg-why,
	.racg-doc table {
		break-inside: avoid;
	}

	.racg-doc a {
		text-decoration: none;
		color: #000;
	}

	/* The PDF is the canonical print artefact; make that findable on paper. */
	.racg-doc-header::after {
		content: "A print-ready PDF of this guide is available at " attr(data-pdf-url);
		display: block;
		margin-top: 1rem;
		font-size: 9pt;
		color: #444;
		text-align: center;
	}
}
