/**
 * AIGROW base layer.
 *
 * Resets, metric-matched font fallbacks, root gutter step, focus styles,
 * skip link, reduced motion and utility classes.
 * Tokens come from theme.json (--wp--preset--*, --wp--custom--*).
 * No build step.
 *
 * Owner: foundation. Component, pattern, chrome and form styles live in
 * components.css, patterns.css, chrome.css and forms.css.
 */

/* 1. Fonts: Commissioner (Greek + Latin subsets) is declared in theme.json. */

/* -------------------------------------------------------------------------
 * 2. Custom properties not expressible in theme.json
 * ---------------------------------------------------------------------- */
:root {
	--aigrow-focus-color: var(--wp--preset--color--primary);
	--aigrow-focus-width: 2px;
	--aigrow-focus-offset: 2px;
	--aigrow-bar-height: var(--wp--custom--header--bar-height-mobile);
	--aigrow-gutter: var(--wp--preset--spacing--40);
}

@media (min-width: 600px) {

	:root {
		--aigrow-bar-height: var(--wp--custom--header--bar-height-tablet);
		--aigrow-gutter: var(--wp--preset--spacing--60);

		/* Root gutter: 16px below 600px, 24–40px from 600px (design §3.2). */
		--wp--style--root--padding-left: var(--wp--preset--spacing--60);
		--wp--style--root--padding-right: var(--wp--preset--spacing--60);
	}
}

@media (min-width: 1200px) {

	:root {
		--aigrow-bar-height: var(--wp--custom--header--bar-height);
	}
}

/* -------------------------------------------------------------------------
 * 3. Resets
 * ---------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;

	/* Anchors (#demo, #ai, …) are never hidden under the sticky bar. */
	scroll-padding-top: calc(var(--aigrow-bar-height) + 16px);
}

body {
	margin: 0;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizelegibility;
	overflow-wrap: break-word;
	hyphens: manual;
}

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

/* Inline SVG icons inside text keep their inline flow. */
:where(p, li, a, button, span, dd, dt, td, th, label) > svg {
	display: inline-block;
	vertical-align: middle;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

:where(h1, h2, h3, h4, h5, h6) {
	text-wrap: balance;
	overflow-wrap: break-word;
}

:where(p, li, dd, figcaption) {
	text-wrap: pretty;
}

/* Running text links: always underlined (colour is never the only cue). */
:where(a:not(.wp-element-button)) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* Budgets, dates, DOIs. */
:where(time, .has-tabular-nums, .wp-block-post-date) {
	font-variant-numeric: tabular-nums;
}

/* Greek uppercase only via CSS with lang="el" (tonos dropped; design §2.2). */
.is-eyebrow,
.has-text-transform-uppercase {
	letter-spacing: 0.08em;
}

/* -------------------------------------------------------------------------
 * 4. Focus (outline survives forced-colours mode; design §1.3)
 * ---------------------------------------------------------------------- */
:focus {
	outline: none;
}

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

/* Inside dark bands (.is-style-band-dark, footer) the ring is lime. */
:where(.is-style-band-dark, .has-surface-dark-background-color, .site-footer) {
	--aigrow-focus-color: var(--wp--preset--color--lime);
}

@media (forced-colors: active) {

	:focus-visible {
		outline-color: Highlight;
	}
}

/* -------------------------------------------------------------------------
 * 5. Skip link (core's automatic block-theme skip link; never add a second one)
 * ---------------------------------------------------------------------- */
.skip-link.screen-reader-text:focus,
.skip-link.screen-reader-text:focus-visible {
	position: fixed;
	z-index: 100000;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.75rem 1.25rem;
	clip-path: none;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	border-radius: var(--wp--custom--radius--sm);
	outline: var(--aigrow-focus-width) solid var(--wp--preset--color--lime);
	outline-offset: var(--aigrow-focus-offset);
}

/* -------------------------------------------------------------------------
 * 6. Screen-reader utilities
 * ---------------------------------------------------------------------- */
.screen-reader-text,
.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	overflow-wrap: normal !important;
}

/* -------------------------------------------------------------------------
 * 7. Utility classes (add via "Additional CSS class(es)" or in patterns)
 * ---------------------------------------------------------------------- */
.is-tabular-nums {
	font-variant-numeric: tabular-nums;
}

.is-nowrap {
	white-space: nowrap;
}

.is-measure {
	max-width: var(--wp--custom--measure);
}

.is-text-balance {
	text-wrap: balance;
}

.has-radius-sm {
	border-radius: var(--wp--custom--radius--sm);
}

.has-radius-md {
	border-radius: var(--wp--custom--radius--md);
}

.has-radius-lg {
	border-radius: var(--wp--custom--radius--lg);
}

.is-stretched-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
}

/* Never round or alter compliance artwork and partner logos. */
.is-unaltered,
.is-unaltered img {
	border-radius: 0 !important;
	filter: none !important;
	box-shadow: none !important;
}

@media (max-width: 599px) {

	.hide-below-sm {
		display: none !important;
	}
}

@media (min-width: 600px) {

	.hide-from-sm {
		display: none !important;
	}
}

@media (max-width: 1199px) {

	.hide-below-lg {
		display: none !important;
	}
}

@media (min-width: 1200px) {

	.hide-from-lg {
		display: none !important;
	}
}

/* -------------------------------------------------------------------------
 * 8. Motion: smooth scroll for same-page anchors only; reduced motion respected
 * ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

	html:focus-within {
		scroll-behavior: smooth;
	}
}

@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;
	}
}
