/*
 * Base: design tokens, the responsive type scale, element defaults and page layout.
 * Loaded first; every other stylesheet in assets/css builds on it.
 *
 * Pattern wrappers carry a class name only (no inline styles), so restyles happen
 * in these stylesheets without touching page content. No fixed heights: sections
 * tolerate longer or shorter copy and added or removed blocks.
 *
 * Breakpoints: tablet <= 1024px, mobile <= 767px.
 */

:root {
	--cw-line: rgba(255, 255, 255, 0.31);
	--cw-line-soft: rgba(255, 255, 255, 0.19);
	--cw-radius: 15px;
	--cw-radius-lg: 20px;
	--cw-section-space: 100px;
	--cw-gap: 20px;
}

/*
 * Type scale steps at the breakpoints (tablet <= 1024px, mobile <= 767px) rather than
 * scaling fluidly, so each width gets exact heading sizes.
 * Desktop sizes are the presets in theme.json.
 */
@media (max-width: 1024px) {
	:root {
		--wp--preset--font-size--button: 10px;
		--wp--preset--font-size--accent: 13px;
		--wp--preset--font-size--body: 15px;
		--wp--preset--font-size--heading-6: 17px;
		--wp--preset--font-size--heading-5: 19px;
		--wp--preset--font-size--heading-4: 23px;
		--wp--preset--font-size--heading-3: 27px;
		--wp--preset--font-size--heading-2: 40px;
		--wp--preset--font-size--heading-1: 50px;
		--cw-section-space: 70px;
	}
}

@media (max-width: 767px) {
	:root {
		--wp--preset--font-size--accent: 12px;
		--wp--preset--font-size--heading-6: 16px;
		--wp--preset--font-size--heading-5: 18px;
		--wp--preset--font-size--heading-4: 22px;
		--wp--preset--font-size--heading-3: 25px;
		--wp--preset--font-size--heading-2: 35px;
		--wp--preset--font-size--heading-1: 42px;
	}

	body {
		--wp--style--root--padding-left: 20px;
		--wp--style--root--padding-right: 20px;
	}
}

/* ------------------------------------------------------------------ base */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

a {
	text-decoration: none;
	transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

:where(p, li) a:where(:not(.wp-element-button)) {
	text-decoration: underline;
	text-underline-offset: 2px;
}

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

.screen-reader-text {
	border: 0;
	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 {
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	padding: 12px 20px;
	z-index: 100000;
	background: var(--wp--preset--color--heading);
	color: var(--wp--preset--color--background);
}

/* Header, main and footer, and the sections of a page, sit edge to edge. */
.wp-site-blocks > * + *,
.cw-content > .cw-section,
.cw-main > .cw-content {
	margin-block-start: 0;
}

.wp-site-blocks > main {
	padding-block: 0;
}

/* Consecutive paragraphs sit closer than other blocks (0.9rem). */
.cw-section p + p,
.cw-simple p + p {
	margin-block-start: 0.9rem;
}

/* Buttons after running text get extra breathing room. */
.cw-section p + .wp-block-buttons {
	margin-block-start: 34px;
}

/* Every section: vertical rhythm from one variable; sections below override it. */
.cw-section {
	padding-block: var(--cw-section-space);
}

.wp-element-button,
.wp-block-button__link {
	transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.cw-simple {
	padding-block: var(--cw-section-space);
	min-height: 40vh;
}
