/**
 * Socle : polices auto-hébergées, réinitialisation, éléments communs.
 *
 * Aucune requête tierce. Les `@font-face` pointent vers `static/polices/`,
 * copiées depuis npm par `npm run polices`.
 */

/* ── Polices ─────────────────────────────────────────────────────────────── */
@font-face {
	font-family: 'Archivo';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/polices/archivo-latin-400-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC;
}
@font-face {
	font-family: 'Archivo';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/polices/archivo-latin-600-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Archivo';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/polices/archivo-latin-700-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/polices/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('/polices/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/polices/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/polices/inter-latin-700-normal.woff2') format('woff2');
}

/* ── Réinitialisation ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background: var(--noir-oki);
	color: var(--blanc-creme);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.55;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0 0 var(--space-2);
	text-wrap: balance;
}

h1 {
	font-size: clamp(1.55rem, 3.4vw, 2.3rem);
	text-transform: uppercase;
}
h2 {
	font-size: clamp(1.2rem, 2.4vw, 1.55rem);
	text-transform: uppercase;
}
h3 {
	font-size: 1.05rem;
}
h4 {
	font-size: 0.95rem;
}

p {
	margin: 0 0 var(--space-2);
	text-wrap: pretty;
}

a {
	color: var(--or-oki);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a:hover {
	color: var(--or-clair);
}

:focus-visible {
	outline: 3px solid var(--or-oki);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

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

mark {
	background: color-mix(in srgb, var(--or-oki) 26%, transparent);
	color: inherit;
	padding: 0 0.15em;
	border-radius: 2px;
	font-weight: 600;
}

hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: var(--space-4) 0;
}

/* ── Mise en page ────────────────────────────────────────────────────────── */
.contenant {
	width: min(100% - 2rem, var(--container));
	margin-inline: auto;
}

.section {
	padding-block: var(--space-4);
}

.pile {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.ligne {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	align-items: center;
}

.grille {
	display: grid;
	gap: var(--space-2);
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

/* ── Signature de marque ─────────────────────────────────────────────────── */
.flag-bar {
	height: 6px;
	background: linear-gradient(
		to right,
		#0d0d0d 0 25%,
		var(--or-oki) 25% 50%,
		var(--vert-oki) 50% 75%,
		var(--rouge-oki) 75% 100%
	);
}
:root.light-theme .flag-bar {
	background: linear-gradient(
		to right,
		#000 0 25%,
		var(--or-oki) 25% 50%,
		var(--vert-oki) 50% 75%,
		var(--rouge-oki) 75% 100%
	);
}

/* ── Carte canonique ─────────────────────────────────────────────────────── */
.carte {
	background: var(--card-bg);
	border: var(--border-card);
	border-left: 4px solid var(--or-oki);
	border-radius: var(--radius-md);
	padding: var(--space-2);
	transition:
		transform var(--dur-tanbou) var(--ease-ka),
		border-color var(--dur-tanbou) var(--ease-ka),
		background var(--dur-tanbou) var(--ease-ka);
}
.carte:hover {
	background: var(--card-bg-survol);
	transform: translateY(-2px);
}

/* ── Tag canonique ───────────────────────────────────────────────────────── */
.tag {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	background: color-mix(in srgb, var(--or-oki) 8%, transparent);
	border: 1px solid color-mix(in srgb, var(--or-oki) 55%, transparent);
	border-radius: var(--radius-sm);
	color: var(--blanc-creme);
	font-size: 0.78rem;
	padding: 0.15em 0.55em;
	text-decoration: none;
	white-space: nowrap;
}

/* ── Bouton canonique ────────────────────────────────────────────────────── */
.bouton {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 0.55em 1.1em;
	border: var(--border-btn);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--or-oki);
	cursor: pointer;
	text-decoration: none;
	overflow: hidden;
	transition: color var(--dur-tanbou) var(--ease-syncope);
}
.bouton::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--or-oki);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--dur-tanbou) var(--ease-syncope);
	z-index: -1;
}
.bouton:hover {
	color: var(--noir-oki);
}
.bouton:hover::after {
	transform: scaleX(1);
}
.bouton > * {
	position: relative;
	z-index: 1;
}

.bouton-discret {
	border-color: var(--line);
	color: var(--blanc-creme);
}

/* ── Accessibilité ───────────────────────────────────────────────────────── */
.lien-evitement {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--or-oki);
	color: var(--noir-oki);
	padding: var(--space-1) var(--space-2);
	font-weight: 700;
	z-index: 100;
}
.lien-evitement:focus {
	left: 0;
}

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

/* Une seule garde, au niveau global : sans mouvement, tout reste lisible. */
@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;
	}
	.carte:hover {
		transform: none;
	}
}

/* ── Impression : la veille se transmet aussi sur papier ─────────────────── */
@media print {
	:root {
		--noir-oki: #fff;
		--blanc-creme: #000;
		--card-bg: transparent;
		--line: #999;
		--muted: #444;
	}
	.entete-site,
	.pied-site,
	.panneau-facettes,
	.bouton {
		display: none !important;
	}
	a[href^='http']::after {
		content: ' (' attr(href) ')';
		font-size: 0.75em;
		word-break: break-all;
	}
}
