/*
 * Global foundations shared by the frontend and block editor.
 */

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

html {
	overflow-x: clip;
	scroll-behavior: smooth;
	scroll-padding-top: 7rem;
}

body {
	min-width: 20rem;
	overflow-x: clip;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

body.admin-bar {
	--ct-admin-bar-offset: 32px;
}

main {
	display: block;
}

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

img {
	height: auto;
}

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

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.08em;
}

a,
button,
input,
select,
summary,
textarea {
	-webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, summary, textarea):focus-visible {
	border-radius: 4px;
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--surface-accent);
	color: var(--wp--preset--color--heading);
}

.ct-main {
	min-height: 45vh;
}

.ct-section {
	padding-block: clamp(3.5rem, 7vw, 6rem);
}

.ct-section--compact {
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

.ct-section-heading {
	max-width: 48rem;
}

.ct-eyebrow {
	color: var(--wp--preset--color--primary);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.11em;
	margin-bottom: 0.75rem;
	text-transform: uppercase;
}

.ct-lead {
	color: var(--wp--preset--color--text);
	font-size: clamp(1.0625rem, 2vw, 1.25rem);
	line-height: 1.65;
	max-width: 46rem;
}

.ct-muted {
	color: var(--wp--preset--color--muted);
}

.ct-meta {
	align-items: center;
	color: var(--wp--preset--color--muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.9rem;
	gap: 0.5rem 1rem;
}

.ct-meta a {
	color: inherit;
}

.is-style-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--custom--shadow--soft);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.is-style-soft-section {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--large);
	padding: clamp(1.5rem, 4vw, 3rem);
}

.is-style-dark-section {
	background: var(--wp--preset--color--footer);
	border-radius: var(--wp--custom--radius--large);
	color: var(--wp--preset--color--base);
	padding: clamp(1.5rem, 4vw, 3rem);
}

.is-style-dark-section :where(h2, h3, h4, p, a) {
	color: inherit;
}

.is-style-checkmarks {
	list-style: none;
	padding-left: 0;
}

.is-style-checkmarks li {
	padding-left: 1.8rem;
	position: relative;
}

.is-style-checkmarks li::before {
	color: var(--wp--preset--color--positive);
	content: "✓";
	font-weight: 800;
	left: 0;
	position: absolute;
}

.wp-element-button,
.wp-block-button__link {
	align-items: center;
	display: inline-flex;
	gap: 0.65rem;
	justify-content: center;
	min-height: 3rem;
	transition:
		background-color 160ms ease,
		border-color 160ms ease,
		box-shadow 160ms ease,
		color 160ms ease,
		transform 160ms ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	background: var(--wp--preset--color--primary-dark);
	box-shadow: 0 8px 20px rgba(7, 138, 80, 0.2);
	color: var(--wp--preset--color--base);
	transform: translateY(-1px);
}

.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--surface-accent);
	color: var(--wp--preset--color--primary-dark);
}

.is-style-text-link .wp-block-button__link {
	background: transparent;
	border-radius: 0;
	color: var(--wp--preset--color--primary);
	min-height: 2.75rem;
	padding-inline: 0;
}

.is-style-text-link .wp-block-button__link::after {
	content: "→";
}

.is-style-text-link .wp-block-button__link:hover {
	background: transparent;
	box-shadow: none;
	color: var(--wp--preset--color--primary-dark);
	transform: none;
}

.wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	overflow: hidden;
	padding: 0.3rem;
}

.wp-block-search__input {
	border: 0;
	min-height: 3rem;
	padding-inline: 1rem;
}

.wp-block-search__button {
	border: 0;
	border-radius: calc(var(--wp--custom--radius--button) - 3px);
	margin: 0;
	padding-inline: 1.25rem;
}

.wp-block-separator {
	border-color: var(--wp--preset--color--border);
	opacity: 1;
}

@media (max-width: 782px) {
	body.admin-bar {
		--ct-admin-bar-offset: 46px;
	}
}

@media (max-width: 640px) {
	html {
		scroll-padding-top: 5.5rem;
	}

	.ct-section {
		padding-block: 3.25rem;
	}

	.ct-section--compact {
		padding-block: 2.25rem;
	}

	.wp-block-buttons,
	.wp-block-button,
	.wp-block-button__link {
		width: 100%;
	}
}

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
