/* Coup de Poignet : compléments à theme.json.
   Toutes les marges passent par l'échelle ci-dessous : on ne règle pas
   un écart « à l'œil » ailleurs dans le fichier. */

:root {
	/* Échelle d'espacement (base 8 px) */
	--cdp-s1: 8px;   /* surtitre → titre, titre → texte court */
	--cdp-s2: 12px;  /* éléments d'une carte, questions de FAQ */
	--cdp-s3: 16px;  /* icône → titre, petits groupes */
	--cdp-s4: 24px;  /* texte → boutons, écart entre cartes */
	--cdp-s5: 32px;  /* en-tête de section → contenu, encadrés dans un article */
	--cdp-s6: 48px;  /* haut de page */
	--cdp-s7: 56px;  /* avant un intertitre d'article */
	/* Respiration entre deux sections : 56 px sur mobile, 96 px sur grand écran */
	--cdp-section: clamp(56px, 7vw, 96px);
	/* Marge intérieure des cartes */
	--cdp-card: clamp(22px, 2.4vw, 28px);
	--cdp-card-l: clamp(24px, 3.4vw, 40px);
	--cdp-radius: 18px;
	--cdp-radius-l: 22px;
}

/* ==========================================================================
   1. Structure de page
   ========================================================================== */

/* Pas d'écart automatique entre en-tête, contenu et pied de page. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* Sections de l'accueil : même respiration partout. Deux sections claires
   qui se suivent ne doublent pas l'espace. */
main > .cdp-section {
	margin-block-start: 0;
}
.cdp-section {
	padding-block: var(--cdp-section);
}
.cdp-section:not(.cdp-dark) + .cdp-section:not(.cdp-dark) {
	padding-top: 0;
}

/* En-tête de section (titre + sous-titre ou lien), puis le contenu. */
.cdp-section-head {
	margin-block: 0;
	gap: var(--cdp-s1) var(--cdp-s4);
}
.cdp-section-head h2,
.cdp-section-head p {
	margin-block: 0;
}
.cdp-section-head h2 + p {
	margin-top: var(--cdp-s1);
}
.cdp-section-head + * {
	margin-top: var(--cdp-s5) !important;
}

/* Pages, archives, recherche */
.cdp-page {
	padding-top: var(--cdp-s6);
	padding-bottom: var(--cdp-section);
}
.cdp-page--404 {
	padding-top: var(--cdp-section);
}
.cdp-page > .wp-block-query,
.cdp-page > .wp-block-search {
	margin-top: var(--cdp-s5);
}
.wp-block-query-pagination {
	margin-top: var(--cdp-s6);
}

/* ==========================================================================
   2. En-tête
   ========================================================================== */
.cdp-header {
	border-bottom: 1px solid var(--wp--preset--color--trait);
	padding-block: var(--cdp-s3);
}
.cdp-header > .alignwide {
	row-gap: var(--cdp-s2);
}
.cdp-logo {
	display: flex;
	align-items: center;
	gap: var(--cdp-s2);
}
.cdp-logo-mark {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--wp--preset--color--jaune);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}
.cdp-header .wp-block-navigation-item__content {
	padding: 10px 2px;
}
.cdp-header .wp-block-navigation .current-menu-item > a,
.cdp-header .wp-block-navigation a[aria-current="page"] {
	box-shadow: inset 0 -3px 0 var(--wp--preset--color--jaune);
}
.cdp-header .wp-block-button__link {
	font-size: 0.875rem;
	padding: 0.75rem 1.1rem;
}

/* ==========================================================================
   3. Couleurs utilitaires et sections sombres
   ========================================================================== */
.cdp-dark {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--clair);
}
.cdp-dark a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--clair);
}
.cdp-dark a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--jaune);
}
.cdp-dark .cdp-muted,
.cdp-dark .wp-block-post-excerpt {
	color: var(--wp--preset--color--gris-clair);
}
.cdp-dark .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--clair);
	border: 2px solid var(--wp--preset--color--clair);
	background: transparent;
}
.cdp-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--clair);
	color: var(--wp--preset--color--encre);
}
.cdp-muted {
	color: var(--wp--preset--color--gris);
}
.cdp-accent {
	color: var(--wp--preset--color--jaune);
}

/* ==========================================================================
   4. Hero
   ========================================================================== */
.cdp-hero {
	padding-block: clamp(56px, 8vw, 104px);
}
.cdp-hero .wp-block-columns {
	align-items: center;
	row-gap: var(--cdp-s6);
}
.cdp-hero .wp-block-column > * {
	margin-block: 0;
}
.cdp-hero .is-style-badge + h1 {
	margin-top: 20px;
}
.cdp-hero h1 {
	font-size: var(--wp--preset--font-size--hero);
	line-height: 1.02;
}
.cdp-hero h1 + .cdp-lead {
	margin-top: var(--cdp-s4);
}
.cdp-hero .cdp-lead {
	font-size: 1.1875rem;
	line-height: 1.6;
	max-width: 560px;
	color: var(--wp--preset--color--gris-clair);
}
.cdp-hero .cdp-lead + .wp-block-buttons {
	margin-top: var(--cdp-s5);
}
.cdp-hero .wp-block-buttons {
	gap: var(--cdp-s2);
}
.cdp-hero .wp-block-buttons + p {
	margin-top: var(--cdp-s4);
}
/* Bouton contour : même taille que le bouton plein (WordPress lui impose une marge plus petite). */
.wp-block-button.is-style-outline > .wp-block-button__link {
	padding: calc(0.95rem - 2px) calc(1.5rem - 2px);
}
/* Mobile : boutons du hero empilés, pleine largeur ; photo moins haute. */
@media (max-width: 600px) {
	.cdp-hero .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
	}
	.cdp-hero .wp-block-button,
	.cdp-hero .wp-block-button__link {
		width: 100%;
		text-align: center;
	}
	.cdp-hero .is-style-badge {
		letter-spacing: 0.04em;
	}
	.cdp-hero .cdp-photo--hero img {
		aspect-ratio: 4 / 3;
		object-fit: cover;
		object-position: 50% 30%;
	}
}

/* ==========================================================================
   5. Surtitres et badges
   ========================================================================== */
.is-style-surtitre,
.cdp-kicker,
.cdp-kicker a {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gris);
	text-decoration: none;
	line-height: 1.4;
}
.cdp-dark .is-style-surtitre {
	color: var(--wp--preset--color--jaune);
}
.is-style-badge,
.cdp-badge a {
	display: inline-block;
	width: fit-content;
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	background: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
	padding: 6px 12px;
	border-radius: 6px;
	text-decoration: none;
	line-height: 1.4;
}
.cdp-badge {
	margin: 0;
}

/* ==========================================================================
   6. Boîtes : cartes, encadrés, bloc jaune
   Règle commune : pas de marge sur le premier et le dernier élément,
   12 px entre deux éléments, 8 px après un surtitre ou entre un titre
   et son texte, 24 px avant des boutons ou un lien final.
   ========================================================================== */
:is(.is-style-carte, .cdp-card-body, .is-style-sombre, .is-style-conseil, .is-style-jaune) > * {
	margin-block: 0;
}
:is(.is-style-carte, .cdp-card-body, .is-style-sombre, .is-style-conseil, .is-style-jaune) > * + * {
	margin-top: var(--cdp-s2);
}
:is(.is-style-carte, .cdp-card-body, .is-style-sombre, .is-style-conseil, .is-style-jaune) > :is(.is-style-surtitre, .cdp-kicker) + *,
:is(.is-style-carte, .cdp-card-body, .is-style-sombre, .is-style-conseil, .is-style-jaune) > :is(h2, h3) + p {
	margin-top: var(--cdp-s1);
}
:is(.is-style-carte, .is-style-jaune) > .is-style-badge + * {
	margin-top: var(--cdp-s3);
}
:is(.is-style-carte, .is-style-jaune) > svg {
	display: block;
}
:is(.is-style-carte, .is-style-jaune) > svg + * {
	margin-top: var(--cdp-s3);
}
:is(.is-style-carte, .is-style-jaune) > * + :is(.wp-block-buttons, p:last-child:has(> a:only-child)) {
	margin-top: var(--cdp-s4);
}

/* Cartes */
.is-style-carte,
.cdp-card {
	background: var(--wp--preset--color--blanc);
	border: 2px solid var(--wp--preset--color--trait);
	border-radius: var(--cdp-radius);
	padding: var(--cdp-card);
	transition: border-color 0.15s ease;
}
.is-style-carte.cdp-card-l {
	padding: var(--cdp-card-l);
}
.is-style-carte:hover,
.cdp-card:hover {
	border-color: var(--wp--preset--color--encre);
}
.is-style-carte h3,
.cdp-card h3 {
	font-size: 1.25rem;
	line-height: 1.25;
}
.is-style-carte h3 a,
.cdp-card h3 a {
	text-decoration: none;
}
.is-style-carte p:not(.is-style-surtitre):not(:has(> a)),
.cdp-card p:not(.is-style-surtitre) {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	color: var(--wp--preset--color--gris);
}
.is-style-carte.cdp-card-l p:not(.is-style-surtitre):not(:has(> a)) {
	font-size: 1rem;
	line-height: 1.6;
}
.cdp-card--post {
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.cdp-card--post > * {
	margin-block: 0;
}
.cdp-card--post .wp-block-post-featured-image {
	margin: 0;
}
.cdp-card--post .cdp-card-body {
	padding: var(--cdp-card);
}

/* Grilles de cartes : une colonne sur mobile, autant que possible ensuite. */
.cdp-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: var(--cdp-s4);
}
.cdp-grid > * {
	margin-block: 0 !important;
}
/* Six rubriques : 3 + 3 sur grand écran, jamais 4 + 2. */
.cdp-grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
/* Vidéos : vignette puis titre */
.cdp-grid > .wp-block-group > .cdp-placeholder--video {
	margin: 0;
}
.cdp-grid > .wp-block-group > .cdp-placeholder--video + * {
	margin-top: var(--cdp-s2);
}

/* Deux blocs côte à côte (Carnet / BabyMap) : même hauteur. */
.wp-block-column > .is-style-carte:only-child,
.wp-block-column > .is-style-jaune:only-child {
	height: 100%;
	box-sizing: border-box;
}

/* Groupes en ligne (photo + texte) : le texte prend la place restante
   et passe sous la photo seulement quand l'écran est étroit. */
.cdp-about > .wp-block-group:not(.cdp-placeholder),
.cdp-auteur > .wp-block-group,
.is-style-carte.is-layout-flex > .wp-block-group:not(.cdp-placeholder) {
	flex: 1 1 280px;
	min-width: 0;
}
.cdp-about > .wp-block-group:not(.cdp-placeholder) > *,
.cdp-auteur > .wp-block-group > *,
.is-style-carte.is-layout-flex > .wp-block-group:not(.cdp-placeholder) > * {
	margin-block: 0;
}
.cdp-about > .wp-block-group:not(.cdp-placeholder) > * + *,
.is-style-carte.is-layout-flex > .wp-block-group:not(.cdp-placeholder) > * + * {
	margin-top: var(--cdp-s2);
}
.cdp-about > .wp-block-group:not(.cdp-placeholder) > :is(.is-style-surtitre, h2) + *,
.is-style-carte.is-layout-flex > .wp-block-group:not(.cdp-placeholder) > :is(.is-style-surtitre, h3) + * {
	margin-top: var(--cdp-s1);
}
.cdp-about > .wp-block-group:not(.cdp-placeholder) > * + p:last-child {
	margin-top: var(--cdp-s4);
}

/* Encadré noir (L'essentiel) */
.is-style-sombre {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--clair);
	border-radius: var(--cdp-radius);
	padding: var(--cdp-card-l);
}
.is-style-sombre a {
	color: var(--wp--preset--color--jaune);
}
.is-style-sombre .is-style-surtitre {
	color: var(--wp--preset--color--jaune);
}

/* Conseil du joueur */
.is-style-conseil {
	background: var(--wp--preset--color--creme);
	border: 3px solid var(--wp--preset--color--jaune);
	border-radius: var(--cdp-radius);
	padding: var(--cdp-card);
}
.is-style-conseil p {
	font-size: 1rem;
	line-height: 1.65;
}

/* Bloc jaune (BabyMap) */
.is-style-jaune {
	background: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
	border-radius: var(--cdp-radius-l);
	padding: var(--cdp-card-l);
}
.is-style-jaune p {
	font-size: 1rem;
	line-height: 1.6;
}
.is-style-jaune .wp-block-button__link {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}
.is-style-jaune .wp-block-button__link:hover {
	background: var(--wp--preset--color--encre-2);
	color: var(--wp--preset--color--jaune);
}
.is-style-jaune .is-style-badge {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}

/* FAQ */
.is-style-faq {
	background: var(--wp--preset--color--blanc);
	border: 2px solid var(--wp--preset--color--trait);
	border-radius: 14px;
	padding: var(--cdp-s3) 20px;
}
.is-style-faq summary {
	font-weight: 700;
	cursor: pointer;
}
.is-style-faq > :not(summary) {
	margin: var(--cdp-s2) 0 0;
	font-size: 1rem;
}

/* Produit testé (affiliation) */
.cdp-produit .cdp-mention {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--gris);
	margin: 0;
	flex-basis: 100%;
}

/* Tableaux */
.wp-block-table {
	overflow-x: auto;
	border: 2px solid var(--wp--preset--color--trait);
	border-radius: 14px;
	background: var(--wp--preset--color--blanc);
}
.wp-block-table table {
	border-collapse: collapse;
	min-width: 520px;
}
.wp-block-table thead {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--clair);
	border: 0;
}
.wp-block-table th,
.wp-block-table td {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--trait);
	padding: 14px var(--cdp-s3);
	text-align: left;
}
.wp-block-table thead th {
	border-top: 0;
}

/* Emplacements à remplacer (photos, vidéos) */
.cdp-placeholder {
	background: var(--wp--preset--color--sable);
	color: var(--wp--preset--color--gris);
	border-radius: var(--cdp-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	padding: 20px;
	min-height: 190px;
}
.cdp-placeholder > * {
	margin: 0;
}
.cdp-dark .cdp-placeholder {
	background: var(--wp--preset--color--encre-2);
	color: var(--wp--preset--color--gris-clair);
}
.cdp-placeholder--video {
	aspect-ratio: 9 / 16;
	min-height: 0;
}

/* Photos (remplacent les anciens emplacements gris) */
.cdp-photo {
	margin: 0;
	overflow: hidden;
	box-sizing: border-box;
	border: 3px solid var(--wp--preset--color--jaune);
	border-radius: 28px;
}
.cdp-photo img {
	display: block;
	width: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: 65% 30%; /* le visage est vers le haut-droite */
}
.cdp-photo--hero {
	width: min(300px, 100%);
	margin-inline: auto;
}
.cdp-photo--hero img {
	aspect-ratio: 300 / 460;
	height: auto;
}

/* ==========================================================================
   7. Article
   ========================================================================== */
.cdp-article-head {
	padding-top: var(--cdp-s6);
}
.cdp-article-head > * {
	margin-block: 0;
}
.cdp-article-head > .cdp-badge + h1 {
	margin-top: var(--cdp-s3);
}
.cdp-article-head > h1 + .cdp-chapo {
	margin-top: var(--cdp-s3);
}
.cdp-article-head > .cdp-chapo + .cdp-meta,
.cdp-article-head > h1 + .cdp-meta {
	margin-top: 20px;
}
.cdp-chapo {
	font-size: 1.1875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--gris);
}
.cdp-chapo p {
	margin: 0;
}
.cdp-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gris);
	gap: 6px 10px;
}
.cdp-meta > * {
	margin: 0;
}
.cdp-meta .wp-block-post-author-name {
	font-weight: 600;
	color: var(--wp--preset--color--encre);
}

/* Image principale puis contenu */
main > .wp-block-post-featured-image {
	margin-top: var(--cdp-s5);
}
main > .wp-block-post-content {
	margin-top: var(--cdp-s5);
}
.single .wp-block-post-featured-image img,
.cdp-hero-image img {
	border-radius: var(--cdp-radius-l);
}

/* Rythme du texte d'article */
.wp-block-post-content > :first-child {
	margin-top: 0;
}
.wp-block-post-content > h2 {
	margin-top: var(--cdp-s7);
}
.wp-block-post-content > h3 {
	margin-top: 40px;
}
.wp-block-post-content > :is(h2, h3) + * {
	margin-top: var(--cdp-s2);
}
.wp-block-post-content > :is(.is-style-sombre, .is-style-conseil, .is-style-carte, .wp-block-table, .wp-block-image, .wp-block-embed, .wp-block-video),
.wp-block-post-content > :is(.is-style-sombre, .is-style-conseil, .is-style-carte, .wp-block-table, .wp-block-image, .wp-block-embed, .wp-block-video) + :not(h2, h3) {
	margin-top: var(--cdp-s5);
}
.wp-block-post-content > :is(h2, h3) + :is(.is-style-sombre, .is-style-conseil, .is-style-carte, .wp-block-table) {
	margin-top: var(--cdp-s3);
}
.wp-block-post-content > .is-style-sombre:first-child {
	margin-top: 0;
}
.wp-block-post-content > .is-style-faq + .is-style-faq {
	margin-top: var(--cdp-s2);
}

/* Encadré auteur */
.cdp-auteur {
	margin-top: var(--cdp-s6);
	border-radius: var(--cdp-radius-l);
	padding: var(--cdp-card-l);
	gap: var(--cdp-s4);
}
.cdp-auteur > .wp-block-group > * + * {
	margin-top: var(--cdp-s1);
}
.cdp-auteur > .wp-block-group > * + p:last-child {
	margin-top: var(--cdp-s2);
}
.cdp-auteur .cdp-avatar {
	margin: 0;
	flex: none;
}
.cdp-auteur .cdp-avatar img {
	border-radius: 50%;
	display: block;
}

/* À lire ensuite (masqué s'il n'y a aucun article lié) */
.cdp-related-wrap {
	margin-top: 0;
	padding-top: var(--cdp-section);
	padding-bottom: var(--cdp-section);
}
.cdp-related-wrap > h2 {
	margin: 0;
}
.cdp-related-wrap > h2 + * {
	margin-top: var(--cdp-s4);
}
/* Sans article lié : on cache le contenu mais on garde l'espace du bas,
   pour que l'encadré auteur ne colle pas au pied de page. */
.cdp-related-wrap:not(:has(.wp-block-post)) {
	padding-top: 0;
}
.cdp-related-wrap:not(:has(.wp-block-post)) > * {
	display: none;
}

/* ==========================================================================
   8. Qui suis-je (accueil)
   ========================================================================== */
.cdp-about .cdp-avatar {
	width: 180px;
	height: 180px;
	margin: 0;
	border-radius: 50%;
	flex: none;
	overflow: hidden;
}
.cdp-about .cdp-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 65% 25%;
}

/* ==========================================================================
   9. Pied de page
   ========================================================================== */
.cdp-footer {
	padding-top: 64px;
	padding-bottom: var(--cdp-s5);
}
.cdp-footer > .wp-block-columns {
	margin: 0;
	row-gap: var(--cdp-s5);
}
.cdp-footer .wp-block-column > * {
	margin-block: 0;
}
.cdp-footer .wp-block-column > * + * {
	margin-top: var(--cdp-s3);
}
.cdp-footer .wp-block-column > .wp-block-site-title + * {
	margin-top: var(--cdp-s1);
}
.cdp-footer .wp-block-column > .cdp-footer-title + * {
	margin-top: var(--cdp-s2);
}
.cdp-footer a {
	color: var(--wp--preset--color--gris-clair);
	text-decoration: none;
}
.cdp-footer a:hover {
	color: var(--wp--preset--color--jaune);
}
.cdp-footer .wp-block-site-title a {
	color: var(--wp--preset--color--clair);
}
.cdp-footer .cdp-footer-legal {
	margin-top: var(--cdp-s6);
	border-top: 1px solid var(--wp--preset--color--encre-2);
	padding-top: var(--cdp-s4);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--gris-clair);
}
.cdp-footer .wp-block-social-links {
	gap: var(--cdp-s2);
}
.cdp-footer .wp-block-social-links .wp-social-link {
	background: var(--wp--preset--color--encre-2);
	color: var(--wp--preset--color--clair);
}
.cdp-plain-list {
	list-style: none;
	padding-left: 0;
	line-height: 2;
}
.cdp-footer-title {
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0;
	color: var(--wp--preset--color--clair);
}

/* ==========================================================================
   10. Page BabyMap (motif « Page BabyMap »)
   ========================================================================== */
/* Hero jaune : les boutons et le badge passent en noir pour rester visibles. */
.cdp-jaune {
	background: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
}
.cdp-hero.cdp-jaune .cdp-lead {
	color: var(--wp--preset--color--encre);
}
.cdp-hero .cdp-lead--fort {
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 800;
	font-size: clamp(1.25rem, 2.4vw, 1.75rem);
	line-height: 1.3;
}
.cdp-hero h1 + .cdp-lead--fort,
.cdp-hero .cdp-lead--fort + .cdp-lead {
	margin-top: var(--cdp-s3);
}
.cdp-jaune .is-style-badge {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}
.cdp-jaune .wp-block-button__link {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}
.cdp-jaune .wp-block-button__link:hover {
	background: var(--wp--preset--color--encre-2);
	color: var(--wp--preset--color--jaune);
}
.cdp-jaune .wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--encre);
	border: 2px solid var(--wp--preset--color--encre);
}
.cdp-jaune .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}
.cdp-placeholder--app {
	width: min(340px, 100%);
	aspect-ratio: 360 / 440;
	background: var(--wp--preset--color--clair);
	border: 3px solid var(--wp--preset--color--encre);
	border-radius: 28px;
	margin-inline: auto;
}

/* Carte publique : liste cochée et les trois statuts d'un lieu. */
.cdp-check,
.cdp-statuts {
	list-style: none;
	padding-left: 0;
}
.cdp-check li {
	position: relative;
	padding-left: 32px;
	line-height: 1.5;
}
.cdp-check li + li {
	margin-top: 10px;
}
.cdp-check li::before {
	content: "";
	position: absolute;
	left: 6px;
	top: 3px;
	width: 7px;
	height: 13px;
	border-right: 3px solid var(--wp--preset--color--encre);
	border-bottom: 3px solid var(--wp--preset--color--encre);
	transform: rotate(45deg);
}
.cdp-statuts {
	display: flex;
	flex-direction: column;
	gap: var(--cdp-s2);
	margin: 0;
}
.cdp-statuts li {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 16px;
	background: var(--wp--preset--color--clair);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}
.cdp-statuts strong {
	padding: 4px 10px;
	border-radius: 8px;
	background: var(--wp--preset--color--sable);
	border: 1px solid var(--wp--preset--color--trait);
	color: var(--wp--preset--color--gris);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	white-space: nowrap;
}
.cdp-statuts li:nth-child(2) {
	background: var(--wp--preset--color--creme);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--jaune);
}
.cdp-statuts li:nth-child(n+2) strong {
	background: var(--wp--preset--color--jaune);
	border-color: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
}
.cdp-statuts li:nth-child(3) {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--clair);
}

/* Comment ça marche : étapes numérotées dans l'encadré noir. */
.cdp-etapes {
	margin-top: var(--cdp-s5) !important;
}
.cdp-etapes > .wp-block-group > * {
	margin-block: 0;
}
.cdp-etapes > .wp-block-group > * + * {
	margin-top: var(--cdp-s2);
}
.cdp-etapes h3 {
	color: inherit;
	font-size: var(--wp--preset--font-size--large);
}
.is-style-sombre .cdp-muted {
	color: var(--wp--preset--color--gris-clair);
}
.cdp-num {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 900;
	font-size: 1.125rem;
}

/* Appel final : texte à gauche, bouton à droite (empilés sur mobile). */
.cdp-appel {
	gap: var(--cdp-s4);
}
.cdp-appel > .wp-block-group {
	flex: 1 1 420px;
}
.cdp-appel > .wp-block-group > * {
	margin-block: 0;
}
.cdp-appel > .wp-block-group > h2 + p {
	margin-top: var(--cdp-s1);
}

/* ==========================================================================
   11. Pages Qui suis-je, Contact et Lexique (motifs « Page … »)
   ========================================================================== */
/* Haut de page commun (Contact, Lexique) : fil d'Ariane, badge, titre, chapô. */
.cdp-page-tete {
	padding-top: var(--cdp-s5);
	padding-bottom: var(--cdp-s6);
}
.cdp-page-tete:last-child {
	padding-bottom: var(--cdp-section);
}
.cdp-page-tete > *,
.cdp-page-intro > *,
.cdp-contact-intro > * {
	margin-block: 0;
}
.cdp-ariane {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gris);
}
.cdp-ariane a {
	color: var(--wp--preset--color--gris);
}
.cdp-page-tete > .cdp-ariane + * {
	margin-top: var(--cdp-s5);
}
.cdp-page-intro {
	max-width: 760px;
}
.cdp-page-tete h1 {
	font-size: var(--wp--preset--font-size--huge);
	line-height: 1.08;
}
:is(.cdp-page-intro, .cdp-contact-intro) > * + * {
	margin-top: var(--cdp-s3);
}
.cdp-page-tete .cdp-lead {
	font-size: 1.1875rem;
	line-height: 1.6;
}
.cdp-contact-intro > .is-style-sombre {
	margin-top: var(--cdp-s5);
}
.is-style-sombre :is(h2, h3) {
	color: inherit;
}

/* Qui suis-je : bandeau noir (photo + présentation). */
.cdp-presentation-ligne {
	gap: var(--cdp-s6) 64px;
}
.cdp-photo--portrait {
	flex: 0 1 280px;
	height: 340px;
}
.cdp-photo--portrait img {
	height: 100%;
}
.cdp-presentation-texte {
	flex: 999 1 460px;
	min-width: 0;
}
.cdp-presentation-texte > * {
	margin-block: 0;
}
.cdp-presentation h1 {
	font-size: var(--wp--preset--font-size--huge);
	line-height: 1.05;
}

/* Qui suis-je : parcours en frise (pastilles jaunes reliées par un trait). */
.cdp-frise {
	margin-top: var(--cdp-s5) !important;
}
.cdp-frise-etape {
	position: relative;
	padding-left: 40px;
	padding-bottom: var(--cdp-s5);
	margin-block: 0 !important;
}
.cdp-frise-etape::before {
	content: "";
	position: absolute;
	left: 0;
	top: 2px;
	width: 16px;
	height: 16px;
	box-sizing: border-box;
	border-radius: 50%;
	background: var(--wp--preset--color--jaune);
	border: 3px solid var(--wp--preset--color--encre);
}
.cdp-frise-etape::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 22px;
	bottom: 0;
	width: 2px;
	background: var(--wp--preset--color--trait);
}
.cdp-frise-etape:last-child {
	padding-bottom: 0;
}
.cdp-frise-etape:last-child::before {
	background: var(--wp--preset--color--encre);
}
.cdp-frise-etape:last-child::after {
	display: none;
}
.cdp-frise-etape > * {
	margin-block: 0;
}
.cdp-frise-etape > * + * {
	margin-top: var(--cdp-s1);
}
.cdp-frise-etape h3 {
	font-size: 1.25rem;
}
.cdp-frise-etape p:not(.is-style-surtitre) {
	font-size: 1.0625rem;
	line-height: 1.7;
}

/* Contact : formulaire Contact Form 7 aux couleurs du thème. */
.cdp-formulaire > .cdp-placeholder {
	min-height: 360px;
}
.cdp-formulaire form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.cdp-formulaire form > *,
.cdp-formulaire form p {
	margin: 0;
}
.cdp-formulaire .hidden-fields-container,
.cdp-formulaire form br {
	display: none;
}
/* Formulaire collé sans lignes vides : plusieurs champs dans un même paragraphe. */
.cdp-formulaire form p:has(> label ~ label) {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.cdp-formulaire .cdp-champs-2 > p:has(> label ~ label) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.cdp-champs-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 20px;
}
.cdp-formulaire label {
	display: flex;
	flex-direction: column;
	gap: var(--cdp-s1);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}
.cdp-formulaire .wpcf7-form-control-wrap {
	display: block;
}
:is(.cdp-formulaire, .cdp-lexique) :is(input[type="text"], input[type="email"], input[type="search"], input[type="tel"], select, textarea) {
	width: 100%;
	min-height: 48px;
	box-sizing: border-box;
	padding: 12px 16px;
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 400;
	color: var(--wp--preset--color--encre);
	background: var(--wp--preset--color--fond);
	/* Contour des champs en gris foncé : 7:1 sur le fond (WCAG 1.4.11 demande 3:1). */
	border: 2px solid var(--wp--preset--color--gris);
	border-radius: 12px;
}
:is(.cdp-formulaire, .cdp-lexique) :is(input, textarea)::placeholder {
	color: var(--wp--preset--color--gris);
	opacity: 1;
}
.cdp-formulaire textarea {
	resize: vertical;
}
:is(.cdp-formulaire, .cdp-lexique) :is(input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--encre);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--encre);
}
.cdp-formulaire .wpcf7-list-item {
	margin: 0;
}
.cdp-formulaire .wpcf7-acceptance label {
	flex-direction: row;
	align-items: flex-start;
	gap: var(--cdp-s2);
	font-weight: 400;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--gris);
}
.cdp-formulaire input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0;
	flex: none;
	accent-color: var(--wp--preset--color--encre);
}
.cdp-formulaire input[type="submit"] {
	align-self: flex-start;
	min-height: 48px;
	padding: 14px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--encre);
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 800;
	font-size: 1rem;
	cursor: pointer;
}
/* Bouton d'envoi et indicateur de chargement sur la même ligne. */
.cdp-formulaire form p:has(> input[type="submit"]):not(:has(> label)) {
	display: flex;
	align-items: center;
	gap: var(--cdp-s2);
}
.cdp-formulaire .wpcf7-spinner {
	margin: 0;
}
.cdp-formulaire input[type="submit"]:hover {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--jaune);
}
.cdp-formulaire input[type="submit"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.cdp-formulaire .wpcf7-not-valid-tip {
	margin-top: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	color: #B42318;
}
.cdp-formulaire .wpcf7 form .wpcf7-response-output {
	margin: 0;
	padding: 14px 16px;
	border-radius: 12px;
	border: 2px solid var(--wp--preset--color--trait);
	font-size: var(--wp--preset--font-size--small);
}
.cdp-formulaire .wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--wp--preset--color--jaune);
	background: var(--wp--preset--color--creme);
	font-weight: 600;
}
.cdp-formulaire .wpcf7 form:is(.invalid, .unaccepted, .failed, .spam) .wpcf7-response-output {
	border-color: #B42318;
}

/* Lexique : recherche, lettres, cartes de mots. */
.cdp-lexique > * {
	margin-block: 0;
}
.cdp-lex-outils[hidden] {
	display: none;
}
.cdp-lex-outils {
	display: flex;
	flex-direction: column;
	gap: var(--cdp-s3);
}
.cdp-lex-outils:hover {
	border-color: var(--wp--preset--color--trait);
}
.cdp-lex-outils label {
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}
.cdp-lex-lettres {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cdp-s1);
}
.cdp-lex-lettres button {
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 10px;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 800;
	font-size: 0.9375rem;
	cursor: pointer;
}
.cdp-lex-lettres button:hover {
	background: var(--wp--preset--color--creme);
}
.cdp-lex-lettres button[aria-pressed="true"] {
	background: var(--wp--preset--color--jaune);
}
.cdp-lex-compte {
	margin-top: var(--cdp-s5) !important;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gris);
}
.cdp-lex-compte:empty {
	display: none;
}
.cdp-lexique > .cdp-lex-termes {
	margin-top: var(--cdp-s3);
}
.cdp-terme[hidden] {
	display: none !important;
}
.cdp-terme {
	scroll-margin-top: 96px;
}
.cdp-terme:target,
.cdp-terme.is-cible {
	border-color: var(--wp--preset--color--jaune);
	box-shadow: 0 0 0 2px var(--wp--preset--color--jaune);
}
.cdp-terme h2 {
	font-size: 1.375rem;
	line-height: 1.25;
}
.cdp-lien-terme {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}
.cdp-lex-vide {
	display: none;
	margin-top: var(--cdp-s4) !important;
	font-size: 1.0625rem;
}
.cdp-lex-vide.is-visible {
	display: block;
}

/* ==========================================================================
   12. Accessibilité
   ========================================================================== */
/* Indicateur de focus : le jaune ne fait que 1,35:1 sur fond clair (WCAG 2.4.13,
   1.4.11 : 3:1 minimum). Contour noir sur fond clair, jaune sur fond noir. */
:where(a, button, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--encre);
	outline-offset: 3px;
}
:is(.cdp-dark, .is-style-sombre) :is(a, button, summary, .wp-element-button):focus-visible {
	outline-color: var(--wp--preset--color--jaune);
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

/* ==========================================================================
   Typographie : coupures de ligne (v0.5.1)
   ========================================================================== */
:is(h1, h2, h3, h4, .wp-block-post-title, .wp-block-query-title, summary) {
	text-wrap: balance;
	hyphens: manual;
	overflow-wrap: break-word;
}
:is(p, li, figcaption, blockquote) {
	text-wrap: pretty;
	overflow-wrap: break-word;
}
.cdp-nowrap {
	white-space: nowrap;
}
/* Titre de page dans une colonne étroite (Contact) : taille liée à la colonne. */
.cdp-contact-intro h1 {
	font-size: clamp(2rem, 1.35rem + 2.2vw, 3rem);
	line-height: 1.1;
}

/* ==========================================================================
   Accueil : « Par où commencer ? » en index numéroté (v0.5.3)
   Bande blanche sous un trait noir (v0.5.4 : plus de trait en bas, le fond sable des articles marque le passage), grille de cases jointives séparées
   par des traits (le fond noir de la grille apparaît dans l'espace de 2 px),
   numéros 01 à 06 générés en CSS : ils restent justes si on réordonne ou
   ajoute une rubrique. Chaque case est entièrement cliquable (lien du titre).
   ========================================================================== */
.cdp-rubriques {
	background: var(--wp--preset--color--blanc);
	border-top: 2px solid var(--wp--preset--color--encre);
}
/* La section qui suit garde son espace du haut malgré le changement de fond. */
.cdp-section.cdp-rubriques + .cdp-section:not(.cdp-dark) {
	padding-top: var(--cdp-section);
}
.cdp-rubriques .cdp-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
}
.cdp-rubriques .cdp-section-head h2 {
	font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
	letter-spacing: -0.03em;
}
.cdp-rubriques .cdp-section-head h2 + p {
	margin-top: 0;
	max-width: none;
}
/* Sous-titre aligné à droite seulement quand il tient sur la même ligne que le titre. */
@media (min-width: 1100px) {
	.cdp-rubriques .cdp-section-head h2 + p {
		text-align: right;
	}
}
.cdp-index {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2px;
	background: var(--wp--preset--color--encre);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 18px;
	overflow: hidden;
	counter-reset: cdp-rubrique;
}
@media (max-width: 1000px) {
	.cdp-index {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 600px) {
	.cdp-index {
		grid-template-columns: minmax(0, 1fr);
	}
}
.cdp-index > * {
	margin-block: 0 !important;
}
.cdp-rubrique {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	align-content: start;
	gap: var(--cdp-s2);
	padding: var(--cdp-s5) var(--cdp-s5) 36px;
	--cdp-case: var(--wp--preset--color--blanc);
	background: var(--cdp-case);
	counter-increment: cdp-rubrique;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.cdp-rubrique > * {
	margin: 0 !important;
	grid-column: 1 / -1;
}
/* Ligne du haut : numéro à gauche, « Ouvrir → » à droite. */
.cdp-rubrique::before {
	content: counter(cdp-rubrique, decimal-leading-zero);
	grid-column: 1;
	grid-row: 1;
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 900;
	font-size: clamp(3rem, 2.4rem + 1.6vw, 4rem);
	line-height: 0.9;
	letter-spacing: 0.04em;
	/* Chiffres en contour : trait de 4 px peint SOUS un remplissage couleur de la case.
	   Les tracés internes de la police variable (qui se chevauchent) sont ainsi masqués,
	   et seul le contour extérieur (2 px) reste visible. */
	color: var(--cdp-case);
	-webkit-text-stroke: 4px var(--wp--preset--color--encre);
	paint-order: stroke fill;
}
.cdp-rubrique p.cdp-rubrique__go {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--encre);
	white-space: nowrap;
}
.cdp-rubrique h3 {
	font-size: 1.5rem;
}
.cdp-rubrique h3 a {
	color: var(--wp--preset--color--encre);
	text-decoration: none;
}
/* Le lien couvre toute la case : cible tactile = la case entière. */
.cdp-rubrique h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.cdp-rubrique p:not(.cdp-rubrique__go) {
	color: var(--wp--preset--color--gris);
	line-height: 1.55;
}
.cdp-rubrique__fleche {
	display: inline-block;
	transition: transform 0.15s ease;
}
.cdp-rubrique:hover {
	--cdp-case: #FFF7CC;
}
/* Focus clavier : contour à l'intérieur de la case (la grille coupe ce qui dépasse). */
.cdp-rubrique:has(h3 a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--encre);
	outline-offset: -6px;
}
.cdp-rubrique h3 a:focus-visible {
	outline: none;
}
/* Première rubrique, la plus recherchée : case jaune, numéro plein. */
.cdp-rubrique--phare,
.cdp-rubrique--phare:hover {
	--cdp-case: var(--wp--preset--color--jaune);
}
.cdp-rubrique--phare::before {
	color: var(--wp--preset--color--encre);
}
.cdp-rubrique--phare p:not(.cdp-rubrique__go) {
	color: var(--wp--preset--color--encre);
}
@media (prefers-reduced-motion: no-preference) {
	.cdp-rubrique:hover .cdp-rubrique__fleche,
	.cdp-rubrique:focus-within .cdp-rubrique__fleche {
		transform: translateX(4px);
	}
}

/* Titres de cartes d'articles : taille liée à la largeur de la carte. */
.cdp-card--post .wp-block-post-title {
	font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
	line-height: 1.2;
}

/* ==========================================================================
   Accueil : « Derniers articles » sur fond sable à grain (v0.5.4)
   Le changement de fond (blanc → sable) remplace le trait noir sous les
   rubriques. Le grain est un bruit SVG (feTurbulence) en image de fond :
   aucun fichier à charger, les cartes blanches restent unies par-dessus.
   Intensité du grain : la valeur « slope » (0.45) dans l'URL.
   ========================================================================== */
.cdp-articles {
	background-color: #F1F0EA;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.45'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
	background-blend-mode: multiply;
}
/* Fond différent des sections voisines : on garde leurs espaces du haut. */
.cdp-section.cdp-rubriques + .cdp-section.cdp-articles,
.cdp-section.cdp-articles + .cdp-section:not(.cdp-dark) {
	padding-top: var(--cdp-section);
}

/* ==========================================================================
   Pages légales (v0.5.7) : mentions légales et confidentialité
   ========================================================================== */
.cdp-legal-texte {
	margin-top: var(--cdp-s6);
}
.cdp-legal-texte > h2 {
	margin-top: var(--cdp-s6);
	font-size: var(--wp--preset--font-size--large);
}
.cdp-legal-texte > h2:first-child {
	margin-top: 0;
}
.cdp-legal-texte > :is(ul, ol) {
	padding-left: 1.25rem;
}
.cdp-legal-texte > :is(ul, ol) > li + li {
	margin-top: var(--cdp-s1);
}

/* Page 404 : l'espace avant « Ou allez directement à » et le groupe de rubriques. */
.cdp-page--404 > .is-style-surtitre {
	margin-top: var(--cdp-s5);
}
.cdp-page--404 > .cdp-404-liens {
	margin-top: var(--cdp-s2);
}

/* Champ du bloc Recherche (404, résultats) : le contour par défaut (#949494) ne fait que 2,9:1 sur le fond. */
.wp-block-search__input {
	border: 2px solid var(--wp--preset--color--gris);
	color: var(--wp--preset--color--encre);
}
.wp-block-search__input::placeholder {
	color: var(--wp--preset--color--gris);
	opacity: 1;
}

/* Menu mobile : boutons d'ouverture et de fermeture de 44 px (24 px par défaut), l'icône garde sa place. */
.cdp-header .wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	padding: 10px;
	margin-right: -10px;
}

/* 404 : le badge s'aligne sur la colonne de texte (760 px) au lieu de rester collé au bord de l'écran. */
.cdp-page--404 > .is-style-badge {
	display: block;
	width: fit-content;
	margin-left: max(0px, calc(50% - 380px)) !important;
}
