/**
 * AVIX — base
 *
 * Reset, element defaults, typography, utilities and the accessibility
 * primitives every other stylesheet relies on.
 *
 * Design tokens live in theme.json and reach this file as --wp--preset-*
 * and --wp--custom-* custom properties. Nothing here hardcodes a colour that
 * the store owner can change in the Site Editor.
 */

/* -------------------------------------------------------------------------
 * Local aliases for the generated tokens.
 * ---------------------------------------------------------------------- */

:root {
	--avx-base: var(--wp--preset--color--base, #fff);
	--avx-base-warm: var(--wp--preset--color--base-warm, #f7f7f6);
	--avx-surface: var(--wp--preset--color--surface, #ededec);
	--avx-line: var(--wp--preset--color--hairline, #dcdcda);
	--avx-muted: var(--wp--preset--color--muted, #666);
	--avx-ink-soft: var(--wp--preset--color--contrast-soft, #2e2e2e);
	--avx-ink: var(--wp--preset--color--contrast, #000);

	/*
	 * AVIX is a monochrome brand: the accent IS black, matching the
	 * logo. Emphasis comes from fill, weight and space rather than hue —
	 * a solid black block against white, an outlined chip against a solid
	 * one. If the brand ever takes on a colour, changing the single
	 * "Accent" swatch in theme.json carries it through the whole site.
	 */
	--avx-accent: var(--wp--preset--color--accent, #000);
	--avx-accent-strong: var(--wp--preset--color--accent-strong, #333);
	--avx-accent-tint: var(--wp--preset--color--accent-tint, #f2f2f1);

	/*
	 * Red for errors is the one colour in the system, because a form error a
	 * customer misses costs them an order. Every error is also carried by an
	 * icon and by words, so colour is never the only signal.
	 */
	--avx-error: var(--wp--preset--color--error, #b3261e);

	/*
	 * Kept as tokens so existing rules resolve, but deliberately monochrome:
	 * "good" and "caution" states are expressed with weight and tone, not
	 * green and amber.
	 */
	--avx-success: var(--avx-ink);
	--avx-warning: var(--avx-ink);

	--avx-gutter: var(--wp--custom--gutter, clamp(1rem, 4vw, 3.5rem));
	--avx-max: var(--wp--style--global--wide-size, 90rem);
	--avx-header-h: var(--wp--custom--header-height, 4.25rem);

	--avx-t-fast: var(--wp--custom--transition--fast, 140ms cubic-bezier(0.2, 0, 0.2, 1));
	--avx-t-base: var(--wp--custom--transition--base, 240ms cubic-bezier(0.2, 0, 0.2, 1));
	--avx-t-slow: var(--wp--custom--transition--slow, 420ms cubic-bezier(0.2, 0, 0.2, 1));

	--avx-track-wide: var(--wp--custom--tracking--wide, 0.06em);
	--avx-track-wider: var(--wp--custom--tracking--wider, 0.12em);

	--avx-font-display: var(--wp--preset--font-family--display, sans-serif);
	--avx-font-body: var(--wp--preset--font-family--body, sans-serif);

	--avx-ratio-product: var(--wp--custom--ratio--product, 3 / 4);

	/*
	 * The product-detail gallery has its own shape. The 3:4 of a product card
	 * suits a tidy grid and a model shot; a detail page is where someone looks
	 * at the thing itself, and most product photography — shoes above all —
	 * arrives square on a white sweep. A square frame means a square photo
	 * fills it exactly, with nothing cropped and no dead band underneath.
	 */
	--avx-ratio-gallery: var(--wp--custom--ratio--gallery, 1 / 1);
	--avx-ratio-campaign: var(--wp--custom--ratio--campaign, 4 / 5);

	--avx-z-header: var(--wp--custom--z--header, 300);
	--avx-z-sticky: var(--wp--custom--z--sticky-bar, 400);
	--avx-z-drawer: var(--wp--custom--z--drawer, 500);
	--avx-z-dialog: var(--wp--custom--z--dialog, 600);
	--avx-z-skip: var(--wp--custom--z--skip-link, 700);

	/* Announcement bar colours, overridden inline per instance. */
	--avx-announcement-bg: var(--avx-ink);
	--avx-announcement-fg: var(--avx-base);
}

/* -------------------------------------------------------------------------
 * Reset.
 * ---------------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Anchors and skip links must not land under the sticky header. */
	scroll-padding-top: calc(var(--avx-header-h) + 1.5rem);
}

body {
	margin: 0;
	background-color: var(--avx-base);
	color: var(--avx-ink);
	font-family: var(--avx-font-body);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	overflow-wrap: break-word;
}

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

figure {
	margin: 0;
}

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

button {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

table {
	border-collapse: collapse;
	width: 100%;
}

hr {
	border: 0;
	border-top: 1px solid var(--avx-line);
	margin-block: var(--wp--preset--spacing--60, 2rem);
}

[hidden] {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Typography.
 * ---------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--avx-font-display);
	font-weight: 700;
	text-wrap: balance;
	margin-block: 0 0.5em;
}

p,
li,
dd,
dt {
	text-wrap: pretty;
}

.avx-eyebrow,
.is-style-avx-eyebrow {
	font-family: var(--avx-font-display);
	font-size: var(--wp--preset--font-size--x-small, 0.75rem);
	font-weight: 700;
	letter-spacing: var(--avx-track-wider);
	text-transform: uppercase;
	color: var(--avx-muted);
	margin: 0 0 0.75rem;
}

.is-style-avx-rule {
	padding-bottom: 0.6em;
	border-bottom: 1px solid var(--avx-line);
}

.avx-prose > * + * {
	margin-block-start: 1em;
}

.avx-prose h2,
.avx-prose h3,
.avx-prose h4 {
	margin-block-start: 1.6em;
}

.avx-prose ul,
.avx-prose ol {
	padding-inline-start: 1.25rem;
}

.avx-prose table {
	font-size: var(--wp--preset--font-size--small, 0.8125rem);
}

.avx-prose th,
.avx-prose td {
	border: 1px solid var(--avx-line);
	padding: 0.6rem 0.75rem;
	text-align: start;
}

.avx-prose th {
	background: var(--avx-base-warm);
	font-family: var(--avx-font-display);
	letter-spacing: var(--avx-track-wide);
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--x-small, 0.75rem);
}

/* -------------------------------------------------------------------------
 * Links and focus.
 * ---------------------------------------------------------------------- */

a {
	color: inherit;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--avx-ink);
	outline-offset: 2px;
	border-radius: 1px;
}

/* On dark surfaces the focus ring flips so it never disappears. */
.avx-on-dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.avx-announcement :where(a, button):focus-visible {
	outline-color: currentColor;
}

/* -------------------------------------------------------------------------
 * Accessibility helpers.
 * ---------------------------------------------------------------------- */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* WordPress inserts the skip link itself for block themes; this makes it
   visible the moment it takes focus. */
.skip-link.screen-reader-text:focus {
	position: fixed;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	z-index: var(--avx-z-skip);
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.75rem 1.25rem;
	overflow: visible;
	clip-path: none;
	background: var(--avx-ink);
	color: var(--avx-base);
	font-family: var(--avx-font-display);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: var(--avx-track-wide);
	text-transform: uppercase;
	text-decoration: none;
	white-space: normal;
}

/* Progressive enhancement switches. The `avx-js` class is set by the first
   inline script, so no-JS visitors keep every fallback control. */
.avx-js-only {
	display: none;
}

html.avx-js .avx-js-only {
	display: revert;
}

html.avx-js .avx-js-hide {
	display: none;
}

/* -------------------------------------------------------------------------
 * Layout primitives.
 * ---------------------------------------------------------------------- */

.avx-shell {
	width: 100%;
	max-width: var(--avx-max);
	margin-inline: auto;
	padding-inline: var(--avx-gutter);
}

.avx-section {
	padding-block: var(--wp--preset--spacing--80, 3.5rem);
}

.avx-section__inner {
	width: 100%;
	max-width: var(--avx-max);
	margin-inline: auto;
	padding-inline: var(--avx-gutter);
}

.avx-section--tight {
	padding-block: var(--wp--preset--spacing--60, 2rem);
}

.avx-section--warm {
	background: var(--avx-base-warm);
}

main:focus {
	outline: none;
}

/* -------------------------------------------------------------------------
 * Section headers.
 * ---------------------------------------------------------------------- */

.avx-section-header {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-block-end: var(--wp--preset--spacing--60, 2rem);
}

.avx-section-header__title {
	font-size: var(--wp--preset--font-size--xx-large, 1.875rem);
	letter-spacing: -0.02em;
	margin: 0;
	text-transform: uppercase;
}

.avx-section-header__subtitle {
	margin: 0.5rem 0 0;
	color: var(--avx-muted);
	max-width: 46ch;
}

.avx-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--avx-font-display);
	font-size: var(--wp--preset--font-size--small, 0.8125rem);
	font-weight: 700;
	letter-spacing: var(--avx-track-wide);
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	transition: color var(--avx-t-fast);
}

.avx-link-arrow:hover,
.avx-link-arrow:focus-visible {
	color: var(--avx-accent);
}

.avx-link-arrow svg {
	transition: transform var(--avx-t-fast);
}

.avx-link-arrow:hover svg {
	transform: translateX(3px);
}

.avx-rtl .avx-link-arrow:hover svg {
	transform: translateX(-3px);
}

.avx-icon {
	flex: none;
}

/* -------------------------------------------------------------------------
 * Reduced motion.
 * ---------------------------------------------------------------------- */

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

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

/* -------------------------------------------------------------------------
 * Print.
 * ---------------------------------------------------------------------- */

@media print {
	.avx-header,
	.avx-announcement,
	.avx-footer,
	.avx-sticky-atc,
	.avx-drawer,
	.avx-search-overlay {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
	}
}
