/* ==========================================================================
   GLOBAL
   --------------------------------------------------------------------------
   Page-level defaults, links, focus behaviour, accessibility helpers and the
   WordPress content classes. Typography lives in base/typography.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PAGE SURFACE

   CVI §2: never use pure #FFFFFF as a page background. The page sits on cream.
   -------------------------------------------------------------------------- */

body {
	background-color: var(--color-cream);
	min-height: 100vh;
}

/* --------------------------------------------------------------------------
   LINKS

   CVI §2 lists links among the interactive elements that use the primary red.
   Navigation and footer links override this with --color-text in their own
   components.
   -------------------------------------------------------------------------- */

a {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	transition: color var(--transition-base);
}

a:hover {
	color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   FOCUS

   CVI §6.2 defines the focus ring. Applied globally so every interactive
   element is keyboard-visible by default, including ones we have not styled
   yet. Outlines are never removed without a replacement.
   -------------------------------------------------------------------------- */

:focus-visible {
	outline: var(--focus-ring-width) solid var(--focus-ring-color);
	outline-offset: var(--focus-ring-offset);
}

/* --------------------------------------------------------------------------
   SELECTION
   -------------------------------------------------------------------------- */

::selection {
	background-color: var(--color-rose);
	color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY HELPERS
   -------------------------------------------------------------------------- */

/* Visually hidden, still announced by screen readers. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* The skip link reveals itself on keyboard focus. :focus rather than
   :focus-visible — it is only ever reached by keyboard, and it must appear
   the moment it receives focus. */
.skip-link:focus {
	position: fixed;
	top: var(--space-sm);
	left: var(--space-sm);
	/* Above everything: at 100 it tied with the sticky header, which comes
	   later in the page and covered it (audit 01.11, v1-12). It only shows
	   while focused. */
	z-index: 10000;
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--space-sm) var(--space-md);
	overflow: visible;
	clip-path: none;
	background-color: var(--color-cream);
	color: var(--color-primary);
	border-radius: var(--radius-button);
	box-shadow: var(--shadow-md);
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   WORDPRESS CONTENT CLASSES

   Emitted by the block editor and core; the theme has to honour them for
   editor content to render as authored.
   -------------------------------------------------------------------------- */

.aligncenter {
	margin-inline: auto;
}

.alignleft {
	float: left;
	margin-right: var(--space-md);
	margin-bottom: var(--space-sm);
}

.alignright {
	float: right;
	margin-left: var(--space-md);
	margin-bottom: var(--space-sm);
}

.wp-caption-text,
.wp-element-caption {
	font-family: var(--font-meta);
	font-size: 12px;
	line-height: 16px;
	color: var(--color-text);
}

/* --------------------------------------------------------------------------
   MOTION

   CVI §16: subtle transitions only, and respect prefers-reduced-motion.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms;
		animation-iteration-count: 1;
		transition-duration: 0.01ms;
		scroll-behavior: auto;
	}

	/* Suppress the button press-scale as well; nothing should move. */
	.btn:active {
		transform: none;
	}
}
