/*
 * SCB Standard — global styles that theme.json cannot express.
 * Everything uses semantic tokens (--wp--preset--color--*), so child themes
 * restyle by changing their palette, not this file.
 */

/* ---------- Dark surfaces ------------------------------------------------ */
:where(.has-secondary-background-color, .has-secondary-alt-background-color) {
	--scb-accent-text: var(--wp--preset--color--primary);
	--scb-muted: var(--wp--preset--color--muted-on-dark);
}

:where(body) {
	--scb-accent-text: var(--wp--preset--color--primary-dark);
	--scb-muted: var(--wp--preset--color--muted);
}

:where(.has-secondary-background-color, .has-secondary-alt-background-color) a:where(:not(.wp-element-button)) {
	color: inherit;
}

/* Global link hover is dark ink (theme.json); on dark surfaces use the accent instead. */
:is(.has-secondary-background-color, .has-secondary-alt-background-color) a:not(.wp-element-button):hover {
	color: var(--wp--preset--color--primary);
}

/* ---------- Anchored sections clear the sticky header -------------------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:where(main) [id] { scroll-margin-top: calc(var(--wp--custom--header-height) + 1rem); }

/* ---------- Header -------------------------------------------------------- */
.scb-header {
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow var(--wp--custom--transition);
}
.admin-bar .scb-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .scb-header { top: 0; } }
.scb-header.is-scrolled { box-shadow: 0 1px 0 rgb(255 255 255 / 0.08), 0 8px 24px rgb(0 0 0 / 0.25); }
.scb-header .wp-block-navigation-item__content { padding-block: 0.5rem; }
.scb-header .wp-block-navigation-item__content:hover,
.scb-header .wp-block-navigation-item__content:focus-visible { color: var(--wp--preset--color--primary); }

/* ---------- Paragraph: Eyebrow / Lead ------------------------------------ */
.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--scb-accent-text);
}
.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

/* ---------- Heading: accent rule ----------------------------------------- */
.is-style-accent-rule::after {
	content: "";
	display: block;
	width: 3.5rem;
	height: 3px;
	margin-top: 1.25rem;
	background: var(--wp--preset--color--primary);
}
.is-style-accent-rule.has-text-align-center::after { margin-inline: auto; }

/* ---------- Group: Card / Card dark / Stat -------------------------------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base-alt);
	color: var(--wp--preset--color--contrast);
	padding: clamp(1.5rem, 3vw, 2rem);
}
.wp-block-group.is-style-card-dark {
	background: var(--wp--preset--color--secondary-alt);
	color: var(--wp--preset--color--base);
	padding: clamp(1.5rem, 3vw, 2rem);
	--scb-accent-text: var(--wp--preset--color--primary);
	--scb-muted: var(--wp--preset--color--muted-on-dark);
}

.wp-block-group.is-style-stat {
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
	padding-top: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.wp-block-group.is-style-stat > * { margin: 0; }
.wp-block-group.is-style-stat > :first-child {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.1;
	color: var(--scb-accent-text);
}
.wp-block-group.is-style-stat > :not(:first-child) { color: var(--scb-muted); }

/* ---------- Utilities ------------------------------------------------------ */
.has-muted-text { color: var(--scb-muted); }
/* Header, main and footer (incl. template-part wrappers) sit flush: no root block gap. */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Separators are subtle on dark surfaces. */
:is(.has-secondary-background-color, .has-secondary-alt-background-color) .wp-block-separator:not([class*="-color"]) {
	color: color-mix(in srgb, currentColor 22%, transparent);
	border-color: currentColor;
	opacity: 1;
}
