/**
 * CYPURGE — remise à zéro.
 *
 * Limitée à nos pages : `body.cypurge` et ses descendants. Le thème actif a
 * ses feuilles chargées quand même ; cette couche remet à plat ce qu'elles
 * auraient pu poser sur les balises nues.
 */

html:has(body.cypurge) {
	scroll-behavior: smooth;
}

body.cypurge {
	margin: 0;
	background-color: var(--c-background);
	/* Le quadrillage discret de la version Lovable, sur toute la page. */
	background-image:
		linear-gradient(color-mix(in oklab, var(--c-brand-ink) 2%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in oklab, var(--c-brand-ink) 2%, transparent) 1px, transparent 1px);
	background-size: 64px 64px;
	color: var(--c-foreground);
	font-family: var(--c-font-sans);
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.cypurge *,
body.cypurge *::before,
body.cypurge *::after {
	box-sizing: border-box;
	border-color: var(--c-border);
}

body.cypurge :where(h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd) {
	margin: 0;
	padding: 0;
}

body.cypurge :where(ul, ol) {
	list-style: none;
}

body.cypurge :where(img, svg, video) {
	display: block;
	max-width: 100%;
}

body.cypurge :where(img) {
	height: auto;
}

body.cypurge :where(a) {
	color: inherit;
	text-decoration: none;
}

body.cypurge :where(button, input, select, textarea) {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

body.cypurge :where(button) {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

body.cypurge ::selection {
	background: var(--c-primary);
	color: var(--c-primary-foreground);
}

body.cypurge [hidden] {
	display: none !important;
}

body.cypurge :focus-visible {
	outline: 2px solid var(--c-ring);
	outline-offset: 2px;
}

/* ── Accessibilité ──────────────────────────────────────────────── */

body.cypurge .c-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.cypurge .c-skip {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--c-primary);
	color: var(--c-primary-foreground);
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: var(--c-radius-sm);
	transform: translateY(-200%);
	transition: transform 160ms var(--c-ease);
}

body.cypurge .c-skip:focus {
	transform: none;
}

/* ── Mouvement ──────────────────────────────────────────────────── */

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

	body.cypurge *,
	body.cypurge *::before,
	body.cypurge *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
