/*
 * Reset, page defaults, layout grid, labels, focus and accessibility helpers.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	/* Anchor links land below the sticky header. */
	scroll-padding-top: calc(var(--admin-bar) + var(--header-height) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

mark { background: transparent; color: var(--accent); font-weight: 700; }

::selection { background: var(--accent); color: var(--on-accent); }

/* Layout ------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.layout {
	--layout-top: 40px;
	--layout-bottom: 96px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
	gap: var(--sidebar-gap);
	align-items: start;
	/* At least one screen tall, so the pinned sidebar never runs out of room on short pages. */
	min-height: calc(100vh - var(--admin-bar) - var(--header-height));
	padding-top: var(--layout-top);
	padding-bottom: var(--layout-bottom);
}
.layout--article { --layout-top: 36px; }
.layout__main { min-width: 0; }

/* Small uppercase labels: dates, eyebrows, section headings. */
.label {
	font-size: var(--label-size);
	font-weight: 700;
	letter-spacing: var(--label-tracking);
	text-transform: uppercase;
	line-height: 1.4;
}

.empty-note { color: var(--text-muted); padding: 24px 0; }

/* Focus: one ring everywhere, keyboard only. --------------------------- */

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Accessibility helpers ---------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: calc(var(--admin-bar) + 8px);
	left: 8px;
	z-index: 100;
	padding: 10px 18px;
	border-radius: var(--radius-pill);
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 700;
	transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* While the mobile menu or a dialog is open. */
.is-scroll-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
