/* ==========================================================================
   base.css — element defaults and the three cross-cutting primitives.

   SCOPE RULE: this file may contain (a) resets, (b) bare element styling,
   (c) the container, CTA and eyebrow primitives that every block reuses.
   Nothing else. A section-specific rule belongs in that block's style.css.
   If you are tempted to add a component here, you are looking for a block.
   ========================================================================== */

/* --- Derived values -------------------------------------------------------
   Three brand colors only: black #111111, white #ffffff, blue #4788c8.
   Everything below is one of those three at reduced opacity — no grays, no
   fourth hue. Never introduce a color that is not derived from these.       */

:root {
	/* Header geometry. The header is fixed, so the page reserves its height.
	   Both bands are measured in JS on load and written back to these, so a
	   nav that wraps to two lines never sits on top of the content. */
	/* WordPress admin bar. 0 for logged-out visitors; the .admin-bar rules
	   below set it when WordPress adds that class to <body>. navigation.js
	   measures the real bar and overwrites this, so these are the fallback. */
	--cc-admin-bar-h: 0px;

	--cc-rail-h:     40px;
	--cc-masthead-h: 76px;
	--cc-header-h:   calc(var(--cc-rail-h) + var(--cc-masthead-h));

	--cc-body:       color-mix(in srgb, var(--wp--preset--color--black) 80%, transparent);
	--cc-muted:      color-mix(in srgb, var(--wp--preset--color--black) 58%, transparent);
	--cc-rule:       color-mix(in srgb, var(--wp--preset--color--black) 14%, transparent);
	--cc-surface:    color-mix(in srgb, var(--wp--preset--color--black)  4%, var(--wp--preset--color--white));

	/* on black grounds */
	--cc-body-dark:  color-mix(in srgb, var(--wp--preset--color--white) 78%, transparent);
	--cc-muted-dark: color-mix(in srgb, var(--wp--preset--color--white) 55%, transparent);
	--cc-rule-dark:  color-mix(in srgb, var(--wp--preset--color--white) 20%, transparent);
	--cc-surface-dark: color-mix(in srgb, var(--wp--preset--color--white) 7%, var(--wp--preset--color--black));
}

/* WordPress pushes <html> down with its own margin, but a position:fixed
   header is positioned against the viewport and ignores that margin — so the
   header has to be offset by the bar's height itself.

   The bar is 32px wide-screen, 46px under 782px, and under 600px WordPress
   switches it to position:absolute so it scrolls away, at which point a fixed
   header belongs back at the top. */

body.admin-bar { --cc-admin-bar-h: 32px; }

@media screen and (max-width: 782px) {
	body.admin-bar { --cc-admin-bar-h: 46px; }
}

@media screen and (max-width: 600px) {
	body.admin-bar { --cc-admin-bar-h: 0px; }
}


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

html {
	-webkit-text-size-adjust: 100%;
	/* Native anchor jumps (phones, touch, reduced motion — wherever smooth.js
	   isn't running) stop below the fixed header instead of under it. */
	scroll-padding-top: calc(var(--cc-header-h) + var(--cc-admin-bar-h, 0px));
}

body {
	margin: 0;
	padding-top: var(--cc-header-h);
	font-synthesis-weight: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

/* Smooth scrolling (assets/js/smooth.js sets html.cc-smooth only while
   ScrollSmoother is running). The smoother pins its wrapper to the viewport
   at top:0, so body padding and WordPress's admin-bar margin on <html> no
   longer push the page down — the header space moves onto the content
   instead. Without the class, none of this applies. */
html.cc-smooth { margin-top: 0 !important; }
html.cc-smooth body { padding-top: 0; }
html.cc-smooth .cc-smooth-content {
	padding-top: calc(var(--cc-header-h) + var(--cc-admin-bar-h, 0px));
}

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

/*
 * Legacy float alignment (.alignleft/.alignright, still what a WYSIWYG/
 * Gutenberg image gets when someone picks "Align left") has no width cap of
 * its own anywhere in this theme. The rule above caps the <img>, but not the
 * <figure> wrapping it — a browser can still size that wrapper by the
 * image's native dimensions before the img's max-width applies, so a large
 * photo floats wider than the column it's dropped into and visually spills
 * out of it, in the editor and on the front end alike. This is what fixes
 * "an image breaking out of the content width" (2026-09-25).
 */
.alignleft,
.alignright,
.wp-block-image.alignleft,
.wp-block-image.alignright { max-width: 100%; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; text-wrap: balance; }
p, ul, ol { margin: 0 0 1em; }
p { max-width: 68ch; }
ul, ol { padding-left: 1.15em; }
li { margin-bottom: 0.4em; }

a {
	color: var(--wp--preset--color--black);
	text-decoration-color: var(--wp--preset--color--blue);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--wp--preset--color--black); }
.cc-on-dark a { color: var(--wp--preset--color--white); }
a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

hr {
	border: 0;
	border-top: 1px solid var(--cc-rule);
	margin: var(--wp--preset--spacing--50) 0;
}

table { border-collapse: collapse; width: 100%; }
th, td {
	text-align: left;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--cc-rule);
	vertical-align: top;
}
th {
	font-size: var(--wp--preset--font-size--sm);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--black);
}

/* --- Primitive: container ------------------------------------------------ */

.cc-container {
	width: 100%;
	/* theme.json settings.layout.wideSize — the single source of truth for
	   page width. Header, footer and every section container read this, so
	   content lines up with the masthead and footer at every breakpoint. */
	max-width: var(--wp--style--global--wide-size, 1440px);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--30);
}

/* --- Primitive: CTA ------------------------------------------------------
   Flat. Square. No gradient, no shadow, no lift on hover. Hover changes
   fill and border only. One primary CTA per page — see CLAUDE.md.        */

.cc-cta {
	display: inline-block;
	padding: 0.85rem 1.6rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: 2px;
	transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear;
}

/* TEMPORARY (Andy, 2026-10-30): white text on the blue fill on light
   sections. White on #4788c8 is 3.73:1 — below AA 4.5:1 for this text size.
   Revert to var(--wp--preset--color--black) when lifted. Dark sections keep
   black text via the .cc-on-dark rule below. */
.cc-cta--primary {
	background: var(--wp--preset--color--blue);
	border-color: var(--wp--preset--color--blue);
	color: #fff;
}
.cc-cta--primary:hover,
.cc-cta--primary:focus-visible {
	background: var(--wp--preset--color--black);
	border-color: var(--wp--preset--color--black);
	color: #fff;
}

.cc-cta--secondary {
	background: transparent;
	border-color: var(--wp--preset--color--black);
	color: var(--wp--preset--color--black);
}
.cc-cta--secondary:hover,
.cc-cta--secondary:focus-visible {
	background: var(--wp--preset--color--black);
	color: #fff;
}

.cc-cta--quiet {
	padding-inline: 0;
	background: none;
	border: 0;
	border-bottom: 2px solid var(--wp--preset--color--blue);
	border-radius: 0;
	color: var(--wp--preset--color--black);
}
.cc-cta--quiet:hover,
.cc-cta--quiet:focus-visible { border-bottom-color: var(--wp--preset--color--black); }

/* On dark sections */
.cc-on-dark .cc-cta--secondary {
	border-color: #fff;
	color: #fff;
}
.cc-on-dark .cc-cta--secondary:hover {
	background: #fff;
	color: var(--wp--preset--color--black);
}

/* Dark sections are outside the temporary white-text change above. */
.cc-on-dark .cc-cta--primary { color: var(--wp--preset--color--black); }

/* .cc-cta--primary's own hover goes to a black fill, which is correct on a
   light section but invisible on a dark one — the button disappears into
   its own background (CTA band, for one, is solid black). Invert to white
   here instead, matching how the secondary variant already handles dark
   sections above. */
.cc-on-dark .cc-cta--primary:hover,
.cc-on-dark .cc-cta--primary:focus-visible {
	background: #fff;
	border-color: #fff;
	color: var(--wp--preset--color--black);
}

/* --- Primitive: eyebrow -------------------------------------------------- */

.cc-eyebrow {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--black);
}

.cc-on-dark .cc-eyebrow { color: var(--wp--preset--color--blue); }

/* --- Breadcrumbs, in the eyebrow slot ------------------------------------
   Option 3, approved by Andy 2026-10-09: on child pages the trail replaces the
   eyebrow, at the eyebrow's size, weight and caps. Links follow the site link
   rule (black, blue underline); the current page is plain text. On dark
   grounds: white links with the blue underline, current page in blue.
   Markup from inc/breadcrumbs.php. */
.cc-crumbs { margin: 0 0 0.75rem; }

.cc-crumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.6;
	text-transform: uppercase;
	color: var(--wp--preset--color--black);
}

.cc-crumbs__item { margin: 0; }

/* The separator is drawn by CSS so screen readers announce the list, not a
   string of slashes. */
.cc-crumbs__item + .cc-crumbs__item::before {
	content: '/';
	margin: 0 0.6em;
	color: var(--cc-muted);
}

.cc-crumbs a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	text-decoration-color: var(--wp--preset--color--blue);
	transition: text-decoration-color var(--cc-hover-dur, 140ms) var(--cc-hover-ease, ease);
}

.cc-crumbs a:hover,
.cc-crumbs a:focus-visible { text-decoration-color: currentColor; }

.cc-on-dark .cc-crumbs__list { color: #fff; }
.cc-on-dark .cc-crumbs__item + .cc-crumbs__item::before { color: var(--cc-muted-dark); }
.cc-on-dark .cc-crumbs__current { color: var(--wp--preset--color--blue); }

@media (prefers-reduced-motion: reduce) {
	.cc-crumbs a { transition: none; }
}
.cc-on-dark,
.cc-on-dark :is(h1, h2, h3, h4) { color: #fff; }
.cc-on-dark p { color: var(--cc-body-dark); }

/* --- Skip link ----------------------------------------------------------- */

.cc-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--black);
	color: #fff;
}
.cc-skip:focus { left: 0; }

/* --- Content status marker ------------------------------------------------
   {{TK ...}} rendered by inc/content-status.php. Deliberately loud: this is
   scaffolding, and scaffolding that blends in gets shipped. Blue ground takes
   black text, per the contrast rule. Never appears on production.          */

.cc-tk {
	display: inline-flex;
	align-items: baseline;
	gap: 0.5em;
	padding: 0.15em 0.6em 0.2em;
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1.45;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
}

.cc-tk__label {
	flex: 0 0 auto;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-bottom: 2px solid var(--wp--preset--color--black);
}

/* On a black ground the blue flag still reads, but the text must not inherit
   the section's white. */
.cc-on-dark .cc-tk,
.cc-on-dark .cc-tk__label { color: var(--wp--preset--color--black); }

/* Standalone {{TK}}-style callout for block templates flagging something
   other than a field value (blocks/embed, blocks/hero, blocks/definition) —
   see cloudco_tk_note() in inc/content-status.php. Same marker, its own
   paragraph, so it doesn't run into the content above it. */
.cc-tk-note { margin-top: var(--wp--preset--spacing--40); }
