/**
 * Base — Starter: front-end base styles.
 *
 * theme.json owns the design system. Keep this file for rules theme.json
 * cannot express: accessibility affordances, focus states, motion preferences.
 * Reference theme.json tokens via CSS custom properties
 * (e.g. var(--wp--preset--color--primary)).
 */

/* Visible keyboard focus everywhere, using the theme's primary color. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #2563eb);
	outline-offset: 2px;
}

/* Screen-reader-only text, visible when focused (skip links, hidden headings). */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--base, #ffffff);
	clip: auto !important;
	clip-path: none;
	color: var(--wp--preset--color--contrast, #111111);
	display: block;
	font-size: 1rem;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Smooth in-page jumps (disabled under reduced-motion below). */
html {
	scroll-behavior: smooth;
}

/* Give anchor targets breathing room when linked to — and clearance for a
   sticky header if a site adds one. Low specificity (:where) so it's easy to
   override or retune per project. */
:where([id]) {
	scroll-margin-top: var(--wp--preset--spacing--50, 1.5rem);
}

/* WCAG 2.5.8 (target size, AA): core/social-links renders compact icon anchors
   (~16px) that fall below the 24px minimum. Pad the clickable anchor so the
   target is conformant at any icon size, wherever social links appear. */
.wp-block-social-links .wp-block-social-link-anchor {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
}

/* Header: compact Apply/Donate CTAs + uppercase nav links without underlines. */
.site-header .header-apply .wp-block-button__link,
.site-header .header-donate .wp-block-button__link {
	padding: 0.5em 1.1em;
	font-size: var(--wp--preset--font-size--medium);
}

.site-header .wp-block-base-navbar a,
.site-footer nav a {
	text-decoration: none;
}

.site-header .wp-block-base-navbar a:hover,
.site-footer nav a:hover {
	text-decoration: underline;
}

.site-header .wp-block-base-navbar {
	font-family: var(--wp--preset--font-family--cal-sans);
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
}

/* Match the navbar's desktop rule specificity (3 classes) so this gap wins.
   Explicit value: the spacing presets resolve smaller than intended here. */
.site-header .wp-block-base-navbar .wp-block-base-navbar__overlay .wp-block-base-navbar__menu {
	gap: 2.25rem;
}

/* Homepage: a much larger header logo (~2.6x the 140px original) so the
   transition branding is unmistakable; scales down to the inner-page size. */
.home .site-header .wp-block-site-logo img {
	width: clamp(180px, 25.5vw, 368px);
	height: auto;
}

/* Header Apply CTA: extra separation from the nav links, lighter red on hover. */
.site-header .header-apply {
	margin-left: 2.25rem;
}

.site-header .header-apply .wp-block-button__link:hover,
.site-header .header-apply .wp-block-button__link:focus {
	background-color: color-mix(in srgb, var(--wp--preset--color--secondary) 90%, #fff);
}

/* Header Donate CTA: outline on the navy bar so it doesn't compete with Apply. */
.site-header .header-donate .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--base);
	box-shadow: inset 0 0 0 2px currentcolor;
}

.site-header .header-donate .wp-block-button__link:hover,
.site-header .header-donate .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Below the navbar breakpoint (1120px, see blocks/src/navbar/style.scss): put the
   menu toggle to the right of Apply/Donate. The overlay is position: fixed, so
   only the toggle moves. */
@media (max-width: 1119px) {
	.site-header .wp-block-base-navbar {
		order: 2;
	}
}

/* Phones: keep Apply + Donate on one row beside the logo and menu toggle. */
@media (max-width: 781px) {
	.site-header .wp-block-buttons {
		flex-wrap: nowrap;
		gap: 0.5rem;
	}

	.site-header .header-apply {
		margin-left: 0;
	}

	.site-header .header-apply .wp-block-button__link,
	.site-header .header-donate .wp-block-button__link {
		padding: 0.45em 0.8em;
		font-size: var(--wp--preset--font-size--small);
		white-space: nowrap;
	}

	.site-header .wp-block-site-logo img,
	.home .site-header .wp-block-site-logo img {
		width: 120px;
	}
}

/* Overlay header (Page with Hero template): transparent, floats over the hero. */
header.is-overlay {
	position: absolute;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 20;
}

header.is-overlay .site-header {
	background-color: transparent !important;
}

/* Keep white hero text legible over the light overlay. */
.wp-block-cover .hero-text-shadow {
	text-shadow: 0 2px 16px rgba(20, 50, 70, 0.45);
}

/* Single post navigation: previous left, next right (even when alone). */
.post-nav a {
	text-decoration: none;
}

.post-nav a:hover {
	text-decoration: underline;
}

.post-nav .post-navigation-link-next {
	margin-left: auto;
}

/* Footer sits flush against the last section (no root block-gap strip). */
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Footer logo is decorative chrome, not content: no rounded image corners. */
.site-footer .footer-logo img {
	border-radius: 0;
}

/* Outline buttons follow the brand primary instead of currentColor. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--primary);
	border: 2px solid var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

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