/**
 * Base element styles and utilities. Tokens only, no raw hex values.
 */

/* In-page links (the hero's #bundle-deals, the FAQ categories, the legal
 * pages' "On this page") land below the sticky header, scrolling smoothly
 * unless reduced motion is asked for.
 * No tap highlight: iOS and Android draw a dark box over every tapped
 * element (it flashed as a square frame on the rounded FAQ items). Links
 * and buttons have their own hover, active and :focus-visible states. */
html {
	scroll-padding-top: 64px;
	-webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@media (min-width: 1280px) {
	html {
		scroll-padding-top: 120px;
	}
}

body {
	margin: 0;
	background: var(--color-cream);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: var(--text-body-m);
	line-height: var(--leading-body-m);
	-webkit-font-smoothing: antialiased;
}

/* Content container: the same edges as the header, mega menu and footer. */
.container {
	box-sizing: content-box;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-gutter);
}

/* Form fields: 16px typed text at every width (--text-field, decision
 * 14.29), also where a template has no styles of its own (My Account). */
input,
select,
textarea {
	font-family: inherit;
	font-size: var(--text-field);
}

/* While a popup locks the page scroll (mobile menu, mini cart, cookie
 * settings, search), the body keeps the scrollbar's width as padding, so the page
 * does not move sideways. --scrollbar is measured in navigation.js. The age
 * gate does the same in age-gate.css, with the width its head script measures
 * before any other script runs. */
.is-menu-open body,
.is-cart-open body,
.is-consent-open body,
.is-search-open body {
	padding-right: var(--scrollbar, 0px);
}

/* Every link animates its state changes the same way. */
a {
	transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	a {
		transition: none;
	}
}

/* Visible for screen readers only; becomes visible on focus (skip link). */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100;
	top: var(--space-xs);
	left: var(--space-xs);
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--space-xs) var(--space-sm);
	clip: auto;
	background: var(--color-white);
	color: var(--color-ink);
}

/* Shared focus ring: orange reads on cream, white and green dark. */
:focus-visible {
	outline: 2px solid var(--color-orange);
	outline-offset: 3px;
}
