/* Design tokens (voir BRIEF.md §3-4) — valeurs par défaut, personnalisables depuis
   Apparence → Personnaliser (inc/customizer.php surcharge ces variables via
   wp_add_inline_style, jamais de <style> ad hoc dans le head). */
:root {
	--color-bg: #FBF6EF;
	--color-bg-secondary: #F5F4F2;
	--color-bg-card: #FFFFFF;
	--color-bg-dark: #1D2327;
	--color-text: #1D2327;
	--color-text-2: #4B4F52;
	--color-text-3: #767B7F;
	--color-accent: #C2703E;
	--color-accent-hover: #A85B2F;
	--color-accent-tint: #E8D5C4;
	--color-success: #2F6F4E;
	--color-warning: #B98900;
	--color-danger: #B3261E;
	--color-border: #E8E1D6;

	--shadow-card: 0 2px 8px rgba(90, 62, 40, .08), 0 8px 24px rgba(90, 62, 40, .06);
	--shadow-card-hover: 0 4px 12px rgba(90, 62, 40, .10), 0 12px 32px rgba(90, 62, 40, .10);

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 20px;
	--border-width: 1px;

	--font-system: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-heading: "Lora", Georgia, serif;
	--font-body: "Nunito Sans", var(--font-system);

	--text-xs: 0.75rem;
	--text-sm: 0.875rem;
	--text-base: 1rem;
	--text-lg: 1.125rem;
	--text-xl: 1.375rem;
	--text-2xl: 1.75rem;
	--text-3xl: 2.25rem;
	--text-4xl: 3rem;

	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2.5rem;
	--space-xl: 4rem;
	--space-2xl: 6rem;

	--gutter-mobile: 10px;
	--gutter-desktop: 1.5rem;
	--content-width: 720px;
	--wide-width: 1200px;
}

/* L'échelle ci-dessus était figée en rem sans variation responsive (seule exception :
   le titre du hero, qui grandit vers le haut à partir de 782px). Sur mobile, la
   grille passe de 3 colonnes à 1 seule pleine largeur : le texte secondaire
   (extraits de card, meta, footer) calibré pour une colonne étroite se retrouve dans
   un espace bien plus large et paraît minuscule en comparaison — même s'il ne
   rétrécit techniquement jamais. On compense en réhaussant spécifiquement les
   tailles secondaires/intermédiaires sur mobile ; --text-base/3xl/4xl restent
   inchangés, déjà suffisamment grands. */
@media (max-width: 599px) {
	:root {
		--text-xs: 0.8125rem;
		--text-sm: 0.9375rem;
		--text-lg: 1.1875rem;
		--text-xl: 1.5rem;
		--text-2xl: 1.875rem;
	}
}

/* Polices auto-hébergées (variables, une seule fichier par famille couvre toute la
   plage de graisses) — voir inc/enqueue.php pour le préchargement, et
   inc/customizer.php pour le duo "police système" qui neutralise ces déclarations. */
@font-face {
	font-family: "Lora";
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
	src: url("../fonts/lora-variable.woff2") format("woff2");
}

@font-face {
	font-family: "Nunito Sans";
	font-weight: 300 900;
	font-style: normal;
	font-display: swap;
	src: url("../fonts/nunito-sans-variable.woff2") format("woff2");
}

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

/* Verrouille le scroll de la page pendant que le tiroir mobile est ouvert (voir
   header.php + assets/js/nav.js) — évite de scroller le contenu sous le fond assombri. */
html.afrotheme-no-scroll {
	overflow: hidden;
}

/* text-size-adjust:100% désactive le boost de lisibilité auto de Safari/Chrome
   mobile (comportement imprévisible, dépend de la mise en page) — on préfère
   contrôler nous-mêmes les tailles mobiles explicitement ci-dessus. */
html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: 1.65;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 var(--space-sm);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
	margin: 0 0 var(--space-sm);
}

a {
	color: var(--color-accent-hover);
	text-underline-offset: 0.15em;
}

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

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

img {
	border-radius: var(--radius);
}

:focus-visible {
	outline: var(--border-width) solid var(--color-accent);
	outline-offset: 2px;
}

/* Conteneur générique : gouttière mobile 10px (demande explicite), gouttière desktop
   plus généreuse à partir de 782px. */
.afrotheme-container {
	max-width: var(--wide-width);
	margin-inline: auto;
	padding-inline: var(--gutter-mobile);
}

@media (min-width: 782px) {
	.afrotheme-container {
		padding-inline: var(--gutter-desktop);
	}
}

.afrotheme-main {
	max-width: var(--wide-width);
	margin-inline: auto;
	padding-inline: var(--gutter-mobile);
	padding-block: var(--space-lg);
}

@media (min-width: 782px) {
	.afrotheme-main {
		padding-inline: var(--gutter-desktop);
	}
}

/* Gabarit Canvas (page builders tiers) : aucune contrainte de largeur/padding. */
body.page-template-page-templates-canvas .afrotheme-main {
	max-width: none;
	padding: 0;
}

.afrotheme-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs);
	padding: 0.75em 1.5em;
	border: none;
	border-radius: var(--radius);
	background: var(--color-accent);
	color: var(--color-bg);
	font-family: var(--font-body);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.afrotheme-button:hover,
.afrotheme-button:focus-visible {
	background: var(--color-accent-hover);
	color: var(--color-bg);
	transform: translateY(-1px);
}

.afrotheme-meta,
.afrotheme-meta-date,
.afrotheme-meta-author,
.afrotheme-meta-reading-time {
	font-size: var(--text-sm);
	color: var(--color-text-2);
}

.afrotheme-meta {
	display: flex;
	gap: var(--space-sm);
	flex-wrap: wrap;
}

.afrotheme-skip-link {
	position: fixed;
	inset-inline-start: var(--space-sm);
	top: -100px;
	z-index: 100;
	background: var(--color-text);
	color: var(--color-bg);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius-sm);
	transition: top 0.2s ease;
}

.afrotheme-skip-link:focus {
	top: var(--space-xs);
}

/* !important : convention WP core pour .screen-reader-text, doit rester masqué
   visuellement quel que soit le contexte où la classe est appliquée. */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}

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