/*
 * Base — element defaults only. Anything reusable lives in components.css.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Anchor links land below the sticky header rather than under it. */
	scroll-padding-top: 140px;
}

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

body {
	margin: 0;
	background: var(--ants-paper);
	color: var(--ants-text);
	font-family: var(--ants-font);
	font-size: var(--ants-body);
	line-height: var(--ants-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* --- headings ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	font-family: var(--ants-font);
	font-weight: 600;
	line-height: var(--ants-lh-head);
	letter-spacing: var(--ants-track-head);
	text-wrap: balance;
	color: var(--ants-text);
}

h1 {
	font-size: var(--ants-h1);
	line-height: var(--ants-lh-tight);
	letter-spacing: var(--ants-track-hero);
}
h2 { font-size: var(--ants-h2); }
h3 { font-size: var(--ants-h3); letter-spacing: -0.015em; line-height: 1.26; }
h4 { font-size: var(--ants-body); letter-spacing: -0.01em; }
h5, h6 { font-size: var(--ants-sm); letter-spacing: 0; }

/* --- text ----------------------------------------------------------------- */
p {
	margin: 0 0 1em;
	text-wrap: pretty;
}
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--ants-text); }

a {
	color: var(--ants-text);
	text-decoration: none;
	transition: color var(--ants-transition);
}
a:hover { color: var(--ants-red-deep); }

/*
 * Body-copy links keep an underline. Navigation, cards and buttons opt out via
 * their own components — removing it globally would strip the only affordance
 * an in-sentence link has.
 */
.ants-prose a,
p > a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

:focus-visible {
	outline: var(--ants-focus);
	outline-offset: 2px;
}

/* --- lists ---------------------------------------------------------------- */
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.35em; }

/* --- media ---------------------------------------------------------------- */
img, svg, video {
	max-width: 100%;
	height: auto;
	display: block;
}

figure { margin: 0; }

/* --- quotes --------------------------------------------------------------- */
blockquote {
	margin: 0;
	font-family: var(--ants-font-serif);
	font-size: var(--ants-lead);
	line-height: 1.55;
	text-wrap: pretty;
}
blockquote cite {
	display: block;
	margin-top: 0.75em;
	font-family: var(--ants-font-mono);
	font-size: var(--ants-tag);
	font-style: normal;
	letter-spacing: var(--ants-track-tag);
	text-transform: uppercase;
	color: var(--ants-text-mute);
}

/* --- tables --------------------------------------------------------------- */
table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--ants-sm);
}
th, td {
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--ants-rule);
	text-align: left;
	vertical-align: top;
}
th { font-weight: 600; }

/* Table block (articles): the site's hairlines rather than the core boxed grid. Header
   cells read as labels; the first column, which names each row, is set in weight. */
.wp-block-table { margin-block: 1.75rem; }
.wp-block-table table :is(th, td) {
	border: 0;
	border-bottom: 1px solid var(--ants-rule);
	padding: 0.85rem 1.25rem 0.85rem 0;
}
.wp-block-table table :is(th, td):last-child { padding-right: 0; }
.wp-block-table thead { border: 0; }
.wp-block-table table thead th {
	border-bottom: 1px solid var(--ants-rule-3);
	font-family: var(--ants-font-mono);
	font-size: var(--ants-tag);
	font-weight: 400;
	letter-spacing: var(--ants-track-tag);
	text-transform: uppercase;
	color: var(--ants-text-mute);
}
.wp-block-table tbody td:first-child { font-weight: 600; color: var(--ants-text); }
/* Four or more columns scroll inside the figure on narrow screens instead of crushing. */
.wp-block-table table:has(th:nth-child(4)) td { min-width: 9rem; }

/* --- forms ---------------------------------------------------------------- */
input, select, textarea, button {
	font-family: inherit;
	font-size: var(--ants-sm);
}

/* --- misc ----------------------------------------------------------------- */
hr {
	border: 0;
	border-top: 1px solid var(--ants-rule);
	margin: var(--ants-gap-lg) 0;
}

code, kbd, samp, pre { font-family: var(--ants-font-mono); font-size: 0.9em; }

::selection { background: var(--ants-red); color: #fff; }

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

.skip-link:focus {
	position: fixed;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	z-index: 999;
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.75rem 1.25rem;
	background: var(--ants-red);
	color: #fff;
	font-weight: 600;
}

/* Long unbroken strings — URLs, paths, email addresses — break rather than push the
   page sideways on a phone (WCAG 1.4.10 reflow). */
p, li, dd, td, code, address { overflow-wrap: break-word; }
code { overflow-wrap: anywhere; }
