/**
 * ContainerHomesDaily: global styles.
 *
 * Colours, type sizes and spacing come from theme.json as CSS custom
 * properties (--wp--preset--*, --wp--custom--*). Use those here instead of
 * hard-coded values so the Site Editor stays the single source of truth.
 *
 * Order: base → layout → components → utilities.
 * Block-specific rules go in blocks/{namespace}-{block}.css instead, so they
 * only load on pages that use the block.
 */

/* ---------- Base ---------- */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

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

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}

/* ---------- Layout ---------- */

.chd-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid transparent;
	transition: border-color var(--wp--custom--duration--fast) ease;
}

.admin-bar .chd-site-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

/* Flat Paper rule: a hairline, never a shadow */
.chd-site-header.is-scrolled {
	border-bottom-color: var(--wp--preset--color--contrast);
}

.chd-site-footer a {
	color: inherit;
}

/* ---------- Components ---------- */

.chd-eyebrow {
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}

.chd-hero h1 {
	text-wrap: balance;
}

.chd-icon {
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
	fill: currentColor;
}

/* Reveal-on-scroll: only hidden once JS has confirmed it can reveal it. */
.chd-js [data-chd-reveal] {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 500ms ease, transform 500ms ease;
}

.chd-js [data-chd-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Utilities ---------- */

.chd-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
