/*
------------------------------------------------
Perm'Educ — global.css
Variables, réinitialisation, primitives de mise en page
------------------------------------------------
*/

:root {
	/* Couleurs — planche d'identité Perm'Educ */
	--color-background: #F5EFE3;
	--color-surface: #FBF8F1;
	--color-forest: #26382D;
	--color-moss: #415746;
	--color-sage: #7F987E;
	--color-stone: #D9D1C2;
	--color-bronze: #AA8B5A;
	--color-text: #2C332E;

	/* Espacements */
	--space-xs: 8px;
	--space-sm: 16px;
	--space-md: 24px;
	--space-lg: 40px;
	--space-xl: 64px;
	--space-xxl: 96px;

	/* Largeurs */
	--content-width: 860px;
	--wide-width: 1400px;

	/* Bordures */
	--radius-sm: 12px;
	--radius-md: 18px;
	--radius-lg: 24px;

	/* Ombres */
	--shadow-soft: 0 8px 24px rgba(0, 0, 0, .05);
	--shadow-card: 0 16px 40px rgba(0, 0, 0, .06);

	/* Transitions */
	--transition: 280ms ease;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--color-background);
	color: var(--color-text);
	min-height: 100vh;
	overflow-x: hidden;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-md);
}

figure {
	margin: 0;
}

a {
	color: var(--color-moss);
	text-decoration: none;
	transition: var(--transition);
}

a:hover {
	color: var(--color-forest);
}

button,
.wp-element-button {
	cursor: pointer;
	transition: var(--transition);
}

button:hover,
.wp-element-button:hover {
	transform: translateY(-2px);
}

main {
	min-height: 70vh;
}

section {
	padding: var(--space-xxl) var(--space-lg);
}

.container {
	width: min(100% - 64px, var(--wide-width));
	margin: auto;
}

.content {
	width: min(100%, var(--content-width));
	margin: auto;
}

.surface {
	background: var(--color-surface);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
}

hr {
	border: none;
	height: 1px;
	background: var(--color-stone);
	margin: 64px 0;
}

/* Bronze sur fond ne donne que 3,21:1 en sélection et 2,80:1 en anneau de
   focus. Le vert forêt monte à 10,88:1 dans les deux cas. */
::selection {
	background: var(--color-forest);
	color: var(--color-background);
}

:focus-visible {
	outline: 3px solid var(--color-forest);
	outline-offset: 3px;
}

/* Sur les fonds sombres, l'anneau s'inverse pour rester visible. */
.site-footer :focus-visible {
	outline-color: var(--color-background);
}

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

/* ---- Lien d'évitement ----
   WordPress en pose un pour les thèmes de blocs ; on l'habille aux couleurs
   du site plutôt que d'en ajouter un second. */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--color-forest);
	color: var(--color-background);
	border-radius: 0 0 var(--radius-sm) 0;
	font-weight: 600;
	text-decoration: none;
}

.skip-link:focus {
	left: 0;
	color: var(--color-background);
	outline-offset: -3px;
}

/* ---- Préférence système de réduction des animations ----
   On ne coupe pas tout : un survol qui ne répond plus est une régression
   d'utilisabilité. Les changements de couleur restent, raccourcis ; ce sont
   les déplacements, les mises à l'échelle et le défilement animé qui partent. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 80ms !important;
		transition-property: color, background-color, border-color, outline-color, opacity !important;
		scroll-behavior: auto !important;
	}

	.card:hover,
	button:hover,
	.wp-element-button:hover,
	.button-primary:hover {
		transform: none;
	}
}
