/**
 * V2 foundations.
 *
 * Loaded only when DESIGN_VERSION=v2 in local, development, or staging.
 * Component and page styling should consume these tokens without changing the
 * existing PHP structure. Production remains pinned to v1 until cutover.
 */

@font-face {
	font-display: swap;
	font-family: "Die Grotesk D";
	font-style: normal;
	font-weight: 400;
	src: url("../../new_font/WOFF2/die-grotesk-d-regular.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Die Grotesk D";
	font-style: normal;
	font-weight: 900;
	src: url("../../new_font/WOFF2/die-grotesk-d-black.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Geist Mono";
	font-style: normal;
	font-weight: 400;
	src: url("../../new_font/WOFF2/geist-mono-regular.woff2") format("woff2");
}

@font-face {
	font-display: swap;
	font-family: "Geist Mono";
	font-style: normal;
	font-weight: 500;
	src: url("../../new_font/WOFF2/geist-mono-medium.woff2") format("woff2");
}

:is(body.anc-design-v2, .editor-styles-wrapper) {
	/* Brand palette from the supplied Components / Typography export. */
	--anc-v2-color-brand: #5d470d;
	--anc-v2-color-accent: #ff2a2d;
	--anc-v2-color-paper: #f2f1ee;
	--anc-v2-color-muted: #8e8c86;
	--anc-v2-color-ink: #101012;
	--anc-v2-color-white: #fff;
	--anc-v2-color-line-subtle: rgb(16 16 18 / 0.16);
	--anc-v2-color-line-default: rgb(16 16 18 / 0.22);
	--anc-v2-color-line-strong: rgb(16 16 18 / 0.3);
	/* Preserve the existing accessible focus-ring colour; it is not a v2 brand signal. */
	--anc-v2-color-focus: #735200;

	/* Font families from the supplied typography system. */
	--anc-v2-font-sans: "Die Grotesk D", Arial, sans-serif;
	--anc-v2-font-mono: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

	/* Desktop values are the documented 1440px endpoint. */
	--anc-v2-type-display-size: clamp(40px, calc(9.9143px + 7.7143vw), 121px);
	--anc-v2-type-h1-size: clamp(42px, calc(23.4286px + 4.7619vw), 92px);
	--anc-v2-type-h2-size: clamp(30px, calc(13.2857px + 4.2857vw), 75px);
	--anc-v2-type-h3-size: clamp(26px, calc(22.6571px + 0.8571vw), 35px);
	--anc-v2-type-h4-size: clamp(19px, calc(17.1429px + 0.4762vw), 24px);
	--anc-v2-type-h5-size: 18px;
	--anc-v2-type-h6-size: 13px;
	--anc-v2-type-body-1-size: 21px;
	--anc-v2-type-body-2-size: 19px;
	--anc-v2-type-body-3-size: 16.5px;
	--anc-v2-type-quote-size: 35px;
	--anc-v2-type-number-size: 72px;
	--anc-v2-type-caption-size: 13px;
	--anc-v2-type-action-size: 13px;
	--anc-v2-type-nav-size: 12.5px;
	--anc-v2-leading-display: 0.95;
	--anc-v2-leading-h1: 0.98;
	--anc-v2-leading-h2: 0.95;
	--anc-v2-leading-h3: 1.1;
	--anc-v2-leading-h4: 1.15;
	--anc-v2-leading-h5: 1.3;
	--anc-v2-leading-label: 1.5;
	--anc-v2-leading-body-1: 1.62;
	--anc-v2-leading-body-2: 1.6;
	--anc-v2-leading-body-3: 1.35;
	--anc-v2-leading-quote: 1.18;
	--anc-v2-tracking-label: 0.14em;

	/* Four-pixel rhythm with explicit larger section intervals. */
	--anc-v2-space-1: 4px;
	--anc-v2-space-2: 8px;
	--anc-v2-space-3: 12px;
	--anc-v2-space-4: 16px;
	--anc-v2-space-5: 20px;
	--anc-v2-space-6: 24px;
	--anc-v2-space-8: 32px;
	--anc-v2-space-10: 40px;
	--anc-v2-space-12: 48px;
	--anc-v2-space-16: 64px;
	--anc-v2-space-20: 80px;
	--anc-v2-space-24: 96px;
	--anc-v2-space-32: 128px;

	/* Shared page grid. Compositions opt into these primitives incrementally. */
	--anc-v2-page-gutter: 60px;
	--anc-v2-content-max: 1320px;
	--anc-v2-grid-columns: 12;
	--anc-v2-grid-gap: 24px;
	--anc-v2-hairline: 1px;
	--anc-v2-radius: 0;
	--anc-v2-duration-fast: 150ms;
	--anc-v2-duration-normal: 250ms;

	/* Compatibility aliases let existing components adopt the foundation safely. */
	--anc-color-brand-50: var(--anc-v2-color-paper);
	--anc-color-brand-100: var(--anc-v2-color-paper);
	--anc-color-brand-200: var(--anc-v2-color-line-subtle);
	--anc-color-brand-300: var(--anc-v2-color-line-default);
	--anc-color-brand-400: var(--anc-v2-color-brand);
	--anc-color-brand-500: var(--anc-v2-color-brand);
	--anc-color-brand-600: var(--anc-v2-color-brand);
	--anc-color-brand-700: var(--anc-v2-color-brand);
	--anc-color-brand-800: var(--anc-v2-color-brand);
	--anc-color-brand-900: var(--anc-v2-color-brand);
	--anc-color-neutral-50: var(--anc-v2-color-paper);
	--anc-color-neutral-100: var(--anc-v2-color-paper);
	--anc-color-neutral-200: var(--anc-v2-color-line-subtle);
	--anc-color-neutral-300: var(--anc-v2-color-line-default);
	--anc-color-neutral-400: var(--anc-v2-color-muted);
	--anc-color-neutral-500: var(--anc-v2-color-muted);
	--anc-color-neutral-600: var(--anc-v2-color-muted);
	--anc-color-neutral-700: var(--anc-v2-color-ink);
	--anc-color-neutral-800: var(--anc-v2-color-ink);
	--anc-color-neutral-900: var(--anc-v2-color-ink);
	--anc-color-white: var(--anc-v2-color-white);
	--anc-color-error: var(--anc-v2-color-ink);
	--anc-color-success: var(--anc-v2-color-brand);
	--anc-color-surface-page: var(--anc-v2-color-paper);
	--anc-color-surface-subtle: var(--anc-v2-color-paper);
	--anc-color-surface-raised: var(--anc-v2-color-white);
	--anc-color-text-primary: var(--anc-v2-color-ink);
	--anc-color-text-secondary: var(--anc-v2-color-ink);
	--anc-color-text-muted: var(--anc-v2-color-muted);
	--anc-color-border-default: var(--anc-v2-color-line-default);
	--anc-color-border-strong: var(--anc-v2-color-line-strong);
	--anc-color-accent: var(--anc-v2-color-accent);
	--anc-color-accent-hover: var(--anc-v2-color-accent);
	--anc-color-accent-text: var(--anc-v2-color-accent);
	--anc-color-focus: var(--anc-v2-color-focus);
	--anc-radius-sm: var(--anc-v2-radius);
	--anc-radius-md: var(--anc-v2-radius);
	--anc-font-heading: var(--anc-v2-font-sans);
	--anc-font-body: var(--anc-v2-font-sans);
	--wp--preset--color--foreground: var(--anc-v2-color-ink);
	--wp--preset--color--background: var(--anc-v2-color-paper);
	--wp--preset--color--surface: var(--anc-v2-color-paper);
	--wp--preset--color--muted-foreground: var(--anc-v2-color-muted);
	--wp--preset--color--primary: var(--anc-v2-color-brand);
	--wp--preset--color--primary-dark: var(--anc-v2-color-brand);
	--wp--preset--color--line: var(--anc-v2-color-line-default);
	--wp--preset--color--ring: var(--anc-v2-color-focus);
	--wp--preset--font-family--archivo: var(--anc-v2-font-sans);
	--wp--preset--font-family--source-serif: var(--anc-v2-font-sans);

	background: var(--anc-v2-color-paper);
	color: var(--anc-v2-color-ink);
	font-family: var(--anc-v2-font-sans);
	font-synthesis: none;
	letter-spacing: 0;
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(h1, h2, h3, h4, h5) {
	font-family: var(--anc-v2-font-sans);
	font-style: normal;
	font-weight: 900;
	letter-spacing: 0;
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(h6) {
	font-family: var(--anc-v2-font-mono);
	font-size: var(--anc-v2-type-h6-size);
	font-style: normal;
	font-weight: 400;
	letter-spacing: var(--anc-v2-tracking-label);
	line-height: var(--anc-v2-leading-label);
	text-transform: uppercase;
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(em, i, cite) {
	font-style: normal;
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(button, .wp-element-button) {
	font-family: var(--anc-v2-font-mono);
	font-weight: 500;
	letter-spacing: var(--anc-v2-tracking-label);
	text-transform: uppercase;
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(button, input, select, textarea) {
	border-radius: var(--anc-v2-radius);
}

:is(body.anc-design-v2, .editor-styles-wrapper) :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--anc-v2-color-focus);
	outline-offset: 3px;
}

.anc-design-v2 .anc-v2-shell,
.editor-styles-wrapper .anc-v2-shell {
	width: min(100%, calc(var(--anc-v2-content-max) + (2 * var(--anc-v2-page-gutter))));
	margin-inline: auto;
	padding-inline: var(--anc-v2-page-gutter);
}

.anc-design-v2 .anc-v2-grid,
.editor-styles-wrapper .anc-v2-grid {
	display: grid;
	grid-template-columns: repeat(var(--anc-v2-grid-columns), minmax(0, 1fr));
	gap: var(--anc-v2-grid-gap);
}

.anc-design-v2 .anc-v2-label,
.editor-styles-wrapper .anc-v2-label {
	font-family: var(--anc-v2-font-mono);
	font-size: var(--anc-v2-type-caption-size);
	font-weight: 400;
	letter-spacing: var(--anc-v2-tracking-label);
	line-height: var(--anc-v2-leading-label);
	text-transform: uppercase;
}

@media (max-width: 1359px) {
	:is(body.anc-design-v2, .editor-styles-wrapper) {
		--anc-v2-type-nav-size: 11.5px;
	}
}

@media (max-width: 700px) {
	:is(body.anc-design-v2, .editor-styles-wrapper) {
		--anc-v2-page-gutter: 20px;
		--anc-v2-grid-columns: 4;
		--anc-v2-grid-gap: 12px;
		--anc-v2-type-body-1-size: 19px;
		--anc-v2-type-body-2-size: 18px;
		--anc-v2-type-quote-size: 24px;
		--anc-v2-type-number-size: 40px;
		--anc-v2-type-nav-size: 11.5px;
		--anc-v2-leading-body-1: 1.6;
		--anc-v2-leading-body-2: 1.55;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.anc-design-v2 *,
	body.anc-design-v2 *::before,
	body.anc-design-v2 *::after {
		scroll-behavior: auto !important;
		transition: none !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
