/* ==========================================================================
   Base : réinitialisation légère, typographie, focus, utilitaires d'accessibilité
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--em-header-h) + var(--wp-admin--admin-bar--height, 0px) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--em-ivory);
	color: var(--em-ink);
	font-family: var(--em-font-sans);
	font-size: var(--em-step-0);
	line-height: var(--em-leading-body);
	font-weight: 450;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, picture, video, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6, figure, blockquote { margin: 0; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; hyphens: manual; }
p { text-wrap: pretty; }

/* --- Titres : serif éditoriale (display), sans pour h5-h6 --- */
h1, h2, h3, h4,
.em-h1, .em-h2, .em-h3, .em-h4, .em-display {
	font-family: var(--em-font-display);
	font-weight: 420;
	font-optical-sizing: auto;
	letter-spacing: var(--em-tracking-display);
	line-height: var(--em-leading-snug);
	text-wrap: balance;
	color: var(--em-heading, var(--em-text));
}
.em-display { font-size: var(--em-step-6); line-height: var(--em-leading-tight); }
h1, .em-h1 { font-size: var(--em-step-5); line-height: 1.04; }
h2, .em-h2 { font-size: var(--em-step-4); line-height: 1.08; }
h3, .em-h3 { font-size: var(--em-step-3); }
h4, .em-h4 { font-size: var(--em-step-2); }
h5, h6 { font-family: var(--em-font-sans); font-size: var(--em-step-0); font-weight: 700; }

.em-lead { font-size: var(--em-step-1); line-height: 1.55; color: var(--em-text-muted); max-width: 40em; }
.em-small { font-size: var(--em-step--1); }

/* Mot accentué dans un titre (maquettes : « technique », « continuité »…) */
.em-accent { color: var(--em-accent-text); font-style: normal; }

/* --- Liens --- */
a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--em-dur-fast) var(--em-ease-out), text-decoration-color var(--em-dur-fast);
}

/* --- Focus visible : double anneau lisible sur clair comme sur sombre --- */
:focus { outline: none; }
:focus-visible {
	outline: 2px solid var(--em-focus);
	outline-offset: 3px;
	border-radius: var(--em-radius-xs);
}
.em-main:focus { outline: none; }

::selection { background: var(--em-deep); color: var(--em-white); }

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

.em-skip-link {
	position: fixed;
	left: var(--em-space-s);
	top: var(--em-space-s);
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	background: var(--em-white);
	color: var(--em-ink);
	font-weight: 700;
	border-radius: var(--em-radius-s);
	box-shadow: var(--em-shadow-m);
	transform: translateY(-200%);
	transition: transform var(--em-dur-base) var(--em-ease-out);
}
.em-skip-link:focus { transform: none; }

/* --- Contenu éditorial Gutenberg --- */
.em-prose > * + * { margin-top: 1.1em; }
.em-prose h2 { font-size: var(--em-step-3); margin-top: 2em; }
.em-prose h3 { font-size: var(--em-step-2); margin-top: 1.6em; }
.em-prose a { color: var(--em-accent-text); text-decoration-line: underline; }
.em-prose a:hover { text-decoration-thickness: 2px; }
.em-prose ul, .em-prose ol { padding-left: 1.25em; }
.em-prose li + li { margin-top: 0.35em; }
.em-prose blockquote {
	border-left: 2px solid var(--em-copper);
	padding-left: var(--em-space-m);
	font-family: var(--em-font-display);
	font-size: var(--em-step-2);
}

/* --- Repère de préproduction pour les faits PENDING (jamais rendu en production) --- */
.em-pending {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.15em 0.6em;
	border: 1px dashed #b4232a;
	border-radius: var(--em-radius-xs);
	background: rgb(180 35 42 / 0.06);
	color: #8f1c22;
	font-family: var(--em-font-sans);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.4;
}
.em-surface-night .em-pending,
.em-surface-deep .em-pending { color: #ffd2d4; border-color: #ff8a90; background: rgb(255 138 144 / 0.1); }

.em-env-badge {
	position: fixed;
	left: 12px;
	bottom: 12px;
	z-index: 250; /* sous le menu mobile ouvert (300) */
	margin: 0;
	padding: 0.35rem 0.7rem;
	border-radius: var(--em-radius-pill);
	background: #b4232a;
	color: #fff;
	font: 700 0.6875rem/1 var(--em-font-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	pointer-events: none;
	box-shadow: var(--em-shadow-s);
}
.em-env-badge span { opacity: 0.95; font-weight: 500; margin-left: 0.3em; }

@media print {
	.em-header, .em-mobile-nav, .em-env-badge, .em-skip-link { display: none !important; }
}
