/**
 * Global presentation that theme.json can't express (ADR-030):
 * pseudo-elements, media queries, form-control minimums.
 * Loaded on the front end and in the editor.
 */

html {
	scroll-padding-top: calc(var(--wp--custom--header--compact-height) + 1rem);
}

body {
	font-optical-sizing: auto;
	text-rendering: optimizelegibility;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

:where(h1, h2, h3, h4) {
	text-wrap: balance;
}

/* One visible focus style for everything theme.json doesn't reach. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--custom--color--focus);
	outline-offset: 2px;
}

/* Text inputs at 16px or more: smaller text makes iOS Safari zoom the page. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea) {
	font-size: max(1rem, 1em);
}

/* Buttons: label followed by the brand arrow. */
.wp-block-button__link {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	justify-content: center;
}

.wp-block-button__link::after {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	content: "";
	background-color: currentcolor;
	mask: url(../icons/arrow.svg) center / contain no-repeat;
}

.wp-block-button.is-style-purchase .wp-block-button__link:hover {
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--custom--color--pattern);
	border-color: var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	color: var(--wp--preset--color--base);
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
}

/*
 * Eyebrows (ADR-050) at a fixed 1.75rem. Set here, not in the style's JSON,
 * because fluid typography would scale a raw size down on phones.
 */
.is-style-eyebrow {
	font-size: 1.75rem;
}

@media (min-width: 1280px) {

	html {
		scroll-padding-top: calc(var(--wp--custom--header--compact-height-wide) + 1rem);
	}
}

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}
}

/* Visually hidden text for screen readers (core and WooCommerce blocks). */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	overflow-wrap: normal !important;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	clip-path: none;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
