/**
 * Base: self-hosted fonts, the bridge to Blocksy's variables, typography,
 * layout primitives and utilities.
 */

/* ---------------------------------------------------------------------------
 * Fonts. Subset to Latin plus ₹, woff2, preloaded in inc/enqueue.php.
 * ------------------------------------------------------------------------ */

@font-face {
	font-family: 'Archivo Black';
	src: url('../fonts/archivo-black-400.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter-var-400-700.woff2') format('woff2');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

/* ---------------------------------------------------------------------------
 * Blocksy bridge. Point Blocksy's own variables at our tokens so anything it
 * still renders (page titles, Woo defaults, forms) picks up the brand.
 * Loaded after Blocksy's CSS, so these win.
 * ------------------------------------------------------------------------ */

:root {
	--theme-palette-color-1: var(--ink);
	--theme-palette-color-2: var(--ink-raised);
	--theme-palette-color-3: var(--ink);
	--theme-palette-color-4: var(--ink);
	--theme-palette-color-5: var(--line-on-paper);
	--theme-palette-color-6: var(--paper-raised);
	--theme-palette-color-7: var(--paper);
	--theme-palette-color-8: var(--paper);

	--theme-font-family: var(--font-body);
	--theme-font-size: var(--step-0);
	--theme-line-height: var(--leading-body);
	--theme-text-color: var(--ink);
	--theme-headings-color: var(--ink);
	--theme-link-initial-color: var(--ink);
	--theme-link-hover-color: var(--mute);
	--theme-border-color: var(--line-on-paper);
	--theme-selection-background-color: var(--ink);
	--theme-selection-text-color: var(--paper);

	--theme-button-font-weight: 600;
	--theme-button-font-size: var(--step--1);
	--theme-button-background-initial-color: var(--ink);
	--theme-button-background-hover-color: var(--ink-raised);
	--theme-button-text-initial-color: var(--paper);
	--theme-button-text-hover-color: var(--paper);

	--theme-form-border-radius: var(--radius-0);
	--theme-form-field-border-initial-color: var(--mute);
	--theme-form-field-border-focus-color: var(--ink);
	/* Checkbox and radio borders: Blocksy's default is too faint on paper (about 1.3:1). */
	--theme-form-selection-field-initial-color: var(--mute);
	--theme-form-text-initial-color: var(--ink);
	--theme-form-text-focus-color: var(--ink);

	--theme-normal-container-max-width: var(--container);
	--theme-container-edge-spacing: calc(100vw - 2 * var(--gutter));
}

/* ---------------------------------------------------------------------------
 * Document
 * ------------------------------------------------------------------------ */

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: var(--leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

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

/* ---------------------------------------------------------------------------
 * Typography. Display type is Archivo Black, lowercase, tight.
 * ------------------------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5,
h6,
.display {
	font-family: var(--font-display);
	font-weight: 400;
	font-synthesis: none;
	line-height: var(--leading-display);
	letter-spacing: var(--tracking-display);
	text-transform: lowercase;
	color: inherit;
	text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: var(--leading-tight); }
h4 { font-size: var(--step-1); line-height: var(--leading-tight); }
h5,
h6 { font-size: var(--step-0); line-height: var(--leading-tight); }

p {
	text-wrap: pretty;
}

a {
	color: inherit;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* Prices always use Inter: Archivo Black has no ₹. */
.price,
.amount {
	font-family: var(--font-body);
	font-variant-numeric: tabular-nums;
}

::selection {
	background: var(--ink);
	color: var(--paper);
}

/* ---------------------------------------------------------------------------
 * Focus. Visible everywhere, follows the text colour so it works on Ink and Paper.
 * ------------------------------------------------------------------------ */

:focus-visible {
	outline: var(--focus-width) solid currentColor;
	outline-offset: var(--focus-offset);
}

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

.wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.stack > * + * {
	margin-block-start: var(--stack-space, var(--space-s));
}

.surface-ink {
	background-color: var(--ink);
	color: var(--paper);
}

.surface-paper {
	background-color: var(--paper);
	color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------------------ */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	top: var(--space-2xs);
	left: var(--space-2xs);
	z-index: 1000;
	padding: var(--space-xs) var(--space-s);
	background: var(--paper);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
	text-transform: lowercase;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.posers-sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Placeholder for undecided content. Deliberately loud, deliberately not lime. */
.to-fill {
	display: inline-block;
	padding: 0.05em 0.45em;
	border: 1px dashed currentColor;
	font-family: var(--font-mono);
	font-size: 0.8em;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.5;
	text-transform: none;
	overflow-wrap: anywhere;
}

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