/* =========================================================================
   Thème LMVI — la feuille.
   =========================================================================

   Deux parties :

   1. LE THÈME : en-tête, pied, colonne du blog, article, archives. Ce que
      theme.json ne sait pas dire (états, grilles réactives, filets).
   2. LES COMPOSANTS DE LA MÉTHODE (`.td-*`) : les sections que `publier.py`
      écrit dans les pages — héros, cartes, étapes, zigzag, alterne, chiffres,
      badges, appel à l'action, liste d'articles. Repris de `mu-habillage.css`,
      sans ce qui ne servait qu'à forcer 290 thèmes inconnus (`!important` sur
      les titres, règles pour Astra, Kadence, Blocksy) : ici, on connaît le thème.

   Les couleurs sont celles de theme.json (variables `--wp--preset--color--*`).
   Les noms `--td-*` sont gardés : une feuille propre au site
   (`mu-habillage-site.css`) les redéfinit pour poser sa marque, et doit
   continuer de le pouvoir.
   ========================================================================= */

:root {
	--td-orange:        var(--wp--preset--color--accent, #fb5604);
	--td-orange-clair:  var(--wp--preset--color--accent-clair, #e0792a);
	--td-orange-sombre: var(--wp--preset--color--accent-sombre, #c2410c);
	--td-rayon:         var(--wp--custom--rayon, 6px);
	/* La colonne des sections, alignée sur la largeur de contenu du thème. */
	--td-largeur:       var(--wp--style--global--content-size, 64rem);
	--lmvi-filet:       var(--wp--preset--color--filet, #d1d5db);
	--lmvi-filet-doux:  #e6e6e6;
}

/* Les bandeaux pleine largeur débordent de 100vw ; `clip` évite la barre de
   défilement horizontale sans casser un en-tête `sticky` (ce que `hidden` casse). */
html { overflow-x: clip; }

/* Une ancre ne doit pas atterrir sous l'en-tête. */
[id] { scroll-margin-top: 6rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ======================================================================
   1. LE THÈME
   ====================================================================== */

/* -------------------------------------------------------------- en-tête */

/* Astra : en-tête de 80 px, filet bas, logo et nom à gauche, menu à droite. */
.lmvi-entete { min-height: var(--wp--custom--entete-hauteur, 80px); }
.lmvi-site-entete { position: relative; z-index: 20; }

.lmvi-identite .wp-block-site-logo img {
	max-height: 3.4rem;
	width: auto;
	height: auto;
}

.lmvi-identite .wp-block-site-title a { text-decoration: none; }

.lmvi-menu .wp-block-navigation-item__content { text-decoration: none; }
.lmvi-menu .current-menu-item > .wp-block-navigation-item__content,
.lmvi-menu .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--td-orange);
}

/* Un site peut styler `button` à sa couleur (c'est le cas de la feuille de
   lmvi-conseil.fr) : les boutons d'ouverture et de fermeture du menu mobile ne
   sont pas des boutons d'action et doivent rester nus. */
.wp-block-navigation button.wp-block-navigation__responsive-container-open,
.wp-block-navigation button.wp-block-navigation__responsive-container-close {
	background: none;
	border: 0;
	color: inherit;
	padding: 0.25rem;
}

/* --------------------------------------------------------------- contenu */

/* L'espace entre l'en-tête et le contenu, et entre le contenu et le pied. */
.lmvi-principal {
	padding-top: clamp(2rem, 5vw, 3.5rem);
	padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* Une page qui s'ouvre sur un héros le colle à l'en-tête : le blanc au-dessus
   d'un bandeau se lit comme une page qui charge mal. */
body.td-a-hero:not(.lmvi-a-colonne) .lmvi-principal { padding-top: 0; }
body.td-a-hero .lmvi-contenu { margin-block-start: 0; }
.td-page > .td-hero:first-child,
.lmvi-contenu > .td-hero:first-child { margin-top: 0; }

.lmvi-titre-page { margin-bottom: 1.5rem; }

/* ------------------------------------------------------------ pied de page */

.lmvi-site-pied { margin-top: 0; }
.lmvi-pied p { margin: 0; }
.lmvi-pied a { color: inherit; text-decoration: none; }
.lmvi-pied a:hover { color: var(--td-orange); text-decoration: underline; }

/* ---------------------------------------------- la page à colonne du blog */

/* La colonne de droite : catégories, archives, derniers articles. Elle se
   parcourt du regard, elle doit donc être dense — mêmes valeurs que la colonne
   de test.lmvi-conseil.fr, relevées le 2026-10-23. */
.lmvi-avec-colonne { align-items: flex-start; }

@media (min-width: 782px) {
	.lmvi-avec-colonne__colonne {
		position: sticky;
		top: 1.5rem;
		padding-left: clamp(1rem, 2vw, 2rem);
		border-left: 1px solid var(--lmvi-filet-doux);
	}
}

@media (max-width: 781px) {
	.lmvi-avec-colonne__colonne {
		border-top: 1px solid var(--lmvi-filet-doux);
		padding-top: 2rem;
	}
}

.lmvi-colonne__titre {
	font-size: 1rem;
	line-height: 1.2;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.lmvi-colonne ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lmvi-colonne li {
	font-size: 0.8rem;
	line-height: 1.25;
	margin: 0;
	padding: 0.2rem 0;
	border-bottom: 1px solid #f2f2f2;
}
.lmvi-colonne li:last-child { border-bottom: 0; }

.lmvi-colonne li a {
	display: block;
	color: #444;
	text-decoration: none;
}
.lmvi-colonne li a:hover { color: var(--td-orange); }

/* Dans la colonne de contenu, un bandeau ne déborde plus jusqu'aux bords de
   l'écran : il passerait sous la colonne. Il devient une boîte arrondie. */
.lmvi-avec-colonne__contenu .td-large {
	width: auto;
	max-width: none;
	margin-inline: 0;
	padding-inline: clamp(1.25rem, 3vw, 2rem);
	border-radius: var(--td-rayon);
}

/* La liste d'articles d'une page de blog n'est pas un bandeau peint : sa
   gouttière deviendrait un retrait visible par rapport au héros. */
.lmvi-avec-colonne__contenu .td-articles-bloc.td-large { padding-inline: 0; }
.lmvi-avec-colonne__contenu .td-bloc .td-inner { max-width: none; }

/* --------------------------------------------------------------- archives */

/* Le bandeau d'une archive : le même que celui des pages, en boîte. */
.td-hero--archive {
	padding-block: clamp(2rem, 5vw, 3.5rem);
	padding-inline: clamp(1.25rem, 3vw, 2rem);
	border-radius: var(--td-rayon);
	margin-top: 0;
	margin-bottom: 2rem;
}
.td-hero--archive .td-hero__titre { margin-bottom: 0.25rem; }
.td-hero--archive .td-hero__chapo,
.td-hero--archive .td-hero__chapo p { margin-bottom: 0; }
.td-hero--archive .lmvi-recherche { max-width: 32rem; margin-top: 1.25rem; }

/* ------------------------------------------------------- un article seul */

.lmvi-article__entete { margin-bottom: 1.5rem; }

/* Astra donnait au titre d'un article la taille d'un héros : cinq lignes avant
   la première phrase sur un titre long. */
.lmvi-article__titre {
	font-size: clamp(1.6rem, 3.5vw, 2.1rem);
	line-height: 1.25;
	margin: 0;
}

.lmvi-article__meta {
	font-size: 0.875rem;
	color: var(--wp--preset--color--discret, #64748b);
}
.lmvi-article__meta a { color: inherit; }

.lmvi-article__couverture img {
	width: 100%;
	height: auto;
	max-height: 420px;
	object-fit: cover;
	border-radius: var(--td-rayon);
}

.lmvi-article__suite {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--lmvi-filet-doux);
	font-size: 0.9rem;
}
.lmvi-article__suite a { text-decoration: none; }

/* La rubrique au-dessus du titre, comme sur les cartes. */
.td-article__rubrique {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.td-article__rubrique a { color: var(--td-orange); text-decoration: none; }

/* ======================================================================
   2. LES COMPOSANTS DE LA MÉTHODE
   ====================================================================== */

/* ------------------------------------------------------------------ socle */

.td-bloc { margin-block: 2.5rem; }

/* L'échappée pleine largeur, et son retour exact : le padding vaut la gouttière
   du conteneur, si bien que le texte du bandeau se recale sur celui des
   paragraphes voisins sans connaître la largeur du conteneur. */
.td-large {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
	padding-inline: max(1.25rem, calc(50vw - 50%));
	box-sizing: border-box;
}

/* La colonne de lecture, appliquée aux enfants directs du contenu. */
.td-page > p,
.td-page > h1, .td-page > h2, .td-page > h3, .td-page > h4,
.td-page > ul, .td-page > ol, .td-page > dl,
.td-page > blockquote, .td-page > pre, .td-page > table, .td-page > hr,
.td-page > figure,
.td-page > .td-code {
	max-width: var(--td-largeur);
	margin-inline: auto;
}

.td-inner {
	max-width: var(--td-largeur);
	margin-inline: auto;
}

.td-page > .td-bloc:not(.td-large),
.td-inner > .td-bloc {
	max-width: var(--td-largeur);
	margin-inline: auto;
}

.td-fond      { background: color-mix(in srgb, currentColor 5%, transparent); }
.td-fond-fort { background: color-mix(in srgb, currentColor 9%, transparent); }

/* --------------------------------------------------------------- le héros */

.td-hero {
	padding-block: clamp(3rem, 8vw, 5.5rem);
	background:
		radial-gradient(90rem 40rem at 15% -10%,
			color-mix(in srgb, var(--td-orange) 16%, transparent), transparent 60%),
		radial-gradient(70rem 36rem at 95% 0%,
			color-mix(in srgb, var(--td-orange-clair) 12%, transparent), transparent 55%),
		color-mix(in srgb, currentColor 4%, transparent);
	border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.td-hero__surtitre {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--td-orange) 80%, currentColor);
	background: color-mix(in srgb, var(--td-orange) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--td-orange) 30%, transparent);
	padding: 0.35em 0.85em;
	border-radius: 999px;
	margin: 0 0 1.25rem;
}

.td-hero h1,
.td-hero .td-hero__titre {
	font-size: clamp(2rem, 5.2vw, 3.4rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0 0 1rem;
}

.td-hero__chapo {
	font-size: clamp(1.05rem, 2.2vw, 1.3rem);
	line-height: 1.55;
	margin: 0 0 2rem;
	opacity: 0.88;
}

/* Héros à vidéo de fond. L'image d'attente est en fond de section : elle ne
   dépend ni de la lecture automatique ni du format accepté. */
.td-hero--video {
	position: relative;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.td-hero--video .td-hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}
.td-hero--video::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .45) 60%, rgba(0, 0, 0, .25) 100%);
	z-index: 1;
}
.td-hero--video .td-inner { position: relative; z-index: 2; }
.td-hero--video .td-hero__titre,
.td-hero--video .td-hero__chapo,
.td-hero--video .td-hero__surtitre,
.td-hero--video h1,
.td-hero--video p { color: #fff; }
/* Quatre classes : la règle générale du bouton creux en porte trois et vient après. */
.td-hero--video .td-boutons .td-bouton--creux .wp-block-button__link,
.td-hero--video .wp-block-button.is-style-outline .wp-block-button__link {
	color: #fff;
	border-color: rgba(255, 255, 255, .85);
	background: transparent;
}
@media (prefers-reduced-motion: reduce) {
	.td-hero--video .td-hero__video { display: none; }
}

/* --------------------------------------------------------------- boutons */

.td-boutons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-boutons .td-bouton .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.78em 1.5em;
	border-radius: 999px;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	border: 1.5px solid transparent;
	transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.td-boutons .td-bouton--plein .wp-block-button__link {
	background: var(--td-orange);
	color: #fff;
	box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--td-orange) 80%, transparent);
}
.td-boutons .td-bouton--plein .wp-block-button__link:hover,
.td-boutons .td-bouton--plein .wp-block-button__link:focus-visible {
	background: var(--td-orange-sombre);
	color: #fff;
}

.td-boutons .td-bouton--creux .wp-block-button__link {
	background: transparent;
	border-color: color-mix(in srgb, currentColor 28%, transparent);
	color: inherit;
}
.td-boutons .td-bouton--creux .wp-block-button__link:hover,
.td-boutons .td-bouton--creux .wp-block-button__link:focus-visible {
	border-color: var(--td-orange);
	color: color-mix(in srgb, var(--td-orange) 80%, currentColor);
}

.td-boutons .td-bouton .wp-block-button__link:hover { transform: translateY(-1px); }

/* ---------------------------------------------------------------- cartes */

.td-cartes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-carte {
	background: color-mix(in srgb, currentColor 4%, transparent);
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	border-radius: var(--td-rayon);
	padding: 1.35rem 1.4rem;
	margin: 0;
}
.td-carte > :first-child { margin-top: 0; }
.td-carte > :last-child  { margin-bottom: 0; }

.td-carte__titre {
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.5rem;
}

.td-carte p { margin: 0; font-size: 0.97rem; line-height: 1.6; opacity: 0.9; }

/* Une image de carte prend un cadre commun : portraits et logos ont des tailles
   d'origine sans rapport, et la grille partirait en morceaux. */
.td-carte img {
	display: block;
	width: 100%;
	height: 11rem;
	object-fit: cover;
	border-radius: var(--td-rayon);
}

.td-carte--accent { border-top: 3px solid var(--td-orange); }

/* ---------------------------------------------------------------- étapes */

.td-etapes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
	gap: 1rem;
	counter-reset: td-etape;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-etape {
	position: relative;
	padding: 1.5rem 1.4rem 1.4rem;
	border-radius: var(--td-rayon);
	background: color-mix(in srgb, currentColor 4%, transparent);
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	margin: 0;
	counter-increment: td-etape;
}

.td-etape::before {
	content: counter(td-etape);
	display: grid;
	place-items: center;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background: var(--td-orange);
	color: #fff;
	font-weight: 700;
	font-size: 0.95rem;
	margin-bottom: 0.8rem;
}

.td-etape__titre { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; }
.td-etape p { margin: 0; font-size: 0.97rem; line-height: 1.6; opacity: 0.9; }

/* Quatre éléments : jamais 3 + 1. Le quatrième enfant, s'il est le dernier,
   élargit le plancher et la grille retombe en 2 × 2 sur une colonne moyenne. */
.td-etapes:has(> :last-child:nth-child(4)),
.td-cartes:has(> :last-child:nth-child(4)) {
	grid-template-columns: repeat(auto-fit, minmax(min(13.5rem, 100%), 1fr));
}
@media (max-width: 70rem) {
	.td-etapes:has(> :last-child:nth-child(4)),
	.td-cartes:has(> :last-child:nth-child(4)) {
		grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
	}
}

/* --------------------------------------------------------------- badges */

.td-badges,
.td-chiffres { list-style: none; padding-left: 0; margin-left: 0; }

.td-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.td-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.45em 0.9em;
	border-radius: 999px;
	font-size: 0.93rem;
	font-weight: 600;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	background: color-mix(in srgb, currentColor 4%, transparent);
}
.td-badge::before {
	content: "";
	width: 0.55em;
	height: 0.55em;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.45;
}
.td-badge--actif {
	border-color: color-mix(in srgb, var(--td-orange) 45%, transparent);
	background: color-mix(in srgb, var(--td-orange) 10%, transparent);
}
.td-badge--actif::before { background: var(--td-orange); opacity: 1; }

/* -------------------------------------------------------------- bandeaux */

.td-bandeau {
	padding-block: clamp(2.25rem, 5vw, 3.25rem);
	border-block: 1px solid color-mix(in srgb, currentColor 10%, transparent);
	background: color-mix(in srgb, currentColor 4%, transparent);
}
.td-bandeau > :first-child { margin-top: 0; }
.td-bandeau > :last-child  { margin-bottom: 0; }

.td-cta {
	text-align: center;
	padding-block: clamp(2.5rem, 6vw, 4rem);
	background:
		linear-gradient(135deg,
			color-mix(in srgb, var(--td-orange) 12%, transparent),
			color-mix(in srgb, var(--td-orange-clair) 8%, transparent));
	border-block: 1px solid color-mix(in srgb, var(--td-orange) 22%, transparent);
}
.td-cta h2 { margin-top: 0; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.td-cta .td-boutons { justify-content: center; }

.td-chapeau {
	padding-block: clamp(2rem, 5vw, 3rem);
	border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
	background: color-mix(in srgb, currentColor 4%, transparent);
}
.td-chapeau h1 { margin: 0 0 0.5rem; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
.td-chapeau p  { margin: 0; opacity: 0.8; font-size: 1.02rem; }

/* ------------------------------------------- chiffres / points de preuve */

.td-chiffres {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
}

.td-chiffre {
	text-align: center;
	padding: 1.1rem 0.75rem;
	font-size: 0.9rem;
	opacity: 0.8;
	line-height: 1.4;
}
.td-chiffre strong {
	display: block;
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	font-weight: 800;
	line-height: 1;
	color: color-mix(in srgb, var(--td-orange) 80%, currentColor);
	letter-spacing: -0.02em;
}
.td-chiffre br { display: none; }
.td-chiffre-libelle-espace {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.9rem;
	opacity: 0.8;
	line-height: 1.4;
}

/* --------------------------------------------------------------- zigzag */

.td-zigzag { display: grid; gap: 3rem; }

.td-zigzag__ligne {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: center;
}
.td-zigzag__ligne:nth-child(even) .td-zigzag__media { order: 2; }

.td-zigzag__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--td-rayon);
}
.td-zigzag__titre { margin-top: 0; }
.td-zigzag__ligne:not(:has(.td-zigzag__media)) { grid-template-columns: 1fr; }

@media (max-width: 48rem) {
	.td-zigzag__ligne { grid-template-columns: 1fr; }
	.td-zigzag__ligne:nth-child(even) .td-zigzag__media { order: 0; }
}

/* --------------------------------------------------------------- alterne */

.td-alterne { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); }

.td-alterne__item {
	display: grid;
	gap: clamp(1.25rem, 3vw, 2.75rem);
	align-items: center;
}

@media (min-width: 52rem) {
	.td-alterne__item { grid-template-columns: 1fr 1fr; }
	.td-alterne__item:nth-child(odd) .td-alterne__visuel  { grid-column: 1; grid-row: 1; }
	.td-alterne__item:nth-child(odd) .td-alterne__texte   { grid-column: 2; grid-row: 1; }
	.td-alterne__item:nth-child(even) .td-alterne__visuel { grid-column: 2; grid-row: 1; }
	.td-alterne__item:nth-child(even) .td-alterne__texte  { grid-column: 1; grid-row: 1; }
}

.td-alterne__visuel { margin: 0; }
.td-alterne__visuel img,
.td-alterne__visuel figure { margin: 0; width: 100%; height: auto; display: block; }
.td-alterne__visuel figure { border-radius: var(--td-rayon); overflow: hidden; }
.td-alterne__texte > :first-child { margin-top: 0; }
.td-alterne__texte > :last-child  { margin-bottom: 0; }
.td-alterne__titre {
	font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
	line-height: 1.18;
	margin: 0 0 .75rem;
}
.td-alterne__item:not(:has(.td-alterne__visuel)) { grid-template-columns: 1fr; }

/* ------------------------------------------------- le contenu courant */

.td-page table,
.td-page .wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.93em;
	margin-block: 1.6em;
}
.td-page th,
.td-page td {
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	padding: 0.6em 0.8em;
	text-align: left;
	vertical-align: top;
}
.td-page thead th {
	background: color-mix(in srgb, currentColor 8%, transparent);
	font-weight: 700;
}
.td-page tbody tr:nth-child(even) {
	background: color-mix(in srgb, currentColor 3%, transparent);
}

/* Un titre de section s'attrape à l'œil quand on parcourt dix écrans. */
.td-page h2 {
	border-left: 4px solid var(--td-orange);
	padding-left: 0.6em;
	margin-top: 2.4em;
	line-height: 1.2;
}
/* …mais pas dans les bandeaux, ni dans un article (le liseré y est réservé aux
   pages vitrines : un billet technique en porte vingt). */
.td-large h2,
.td-cta h2,
.td-bandeau h2,
.td-hero h2,
.lmvi-article .td-page h2 {
	border-left: 0;
	padding-left: 0;
}
.td-large h2,
.td-cta h2,
.td-bandeau h2 { margin-top: 0; }

.td-page blockquote {
	border-left: 4px solid var(--td-orange-clair);
	background: color-mix(in srgb, currentColor 4%, transparent);
	padding: 0.9em 1.2em;
	border-radius: 0 var(--td-rayon) var(--td-rayon) 0;
}
.td-page > blockquote { margin-inline: auto; }

.td-page :not(pre) > code {
	background: color-mix(in srgb, currentColor 8%, transparent);
	padding: 0.12em 0.35em;
	border-radius: 4px;
	font-size: 0.92em;
}

.td-page pre {
	background: #f7f7f7;
	border: 1px solid #e3e3e3;
	border-radius: var(--td-rayon);
	padding: 1rem;
	overflow: auto;
	font-family: var(--wp--preset--font-family--chasse-fixe, monospace);
	font-size: 0.9rem;
	line-height: 1.5;
}

.td-page a {
	color: color-mix(in srgb, var(--td-orange) 78%, currentColor);
	text-underline-offset: 2px;
}
.td-page a:hover { color: var(--td-orange-clair); }
.td-page .td-boutons a { color: inherit; }
.td-page .td-boutons .td-bouton--plein a { color: #fff; }

.td-page > .td-couverture { margin: 0 auto 2rem; }
.td-page > .td-couverture img {
	width: 100%;
	height: auto;
	border-radius: var(--td-rayon);
	display: block;
}

/* --------------------------------------------- blocs de code, copiables */

.td-code { position: relative; }

.td-code__copier {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.3rem 0.65rem;
	border-radius: 6px;
	border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	background: color-mix(in srgb, currentColor 7%, Canvas);
	color: inherit;
	font: inherit;
	font-size: 0.78rem;
	line-height: 1.2;
	cursor: pointer;
	opacity: 0.35;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}
.td-code:hover .td-code__copier,
.td-code__copier:focus-visible { opacity: 1; }
.td-code__copier[data-etat="ok"] {
	opacity: 1;
	border-color: color-mix(in srgb, var(--td-orange) 60%, transparent);
	color: color-mix(in srgb, var(--td-orange) 85%, currentColor);
}
.td-code__copier[data-etat="echec"] { opacity: 1; font-weight: 700; }
.td-page .td-code > pre { padding-right: 5.5rem; }

@media (max-width: 30rem) {
	.td-code__copier { position: static; opacity: 1; margin-top: 0.5rem; display: block; }
	.td-page .td-code > pre { padding-right: 1rem; }
}

/* ------------------------------------------------- liste d'articles */

/* Une grille de cartes : image, rubrique, titre, date, extrait. Elle sert à la
   fois au blog du thème (home, archives, recherche) et aux listes que
   `::: articles` pose dans une page. */
.td-articles .wp-block-post-template {
	gap: 1.75rem;
	padding-inline: 0;
	margin-inline: 0;
}

.td-articles .wp-block-post {
	/* Sans `border-box`, la bordure s'ajoute à la base d'un tiers : trois cartes font
	   2 px de trop et la troisième passe à la ligne (mesuré : 2 cartes par rang). */
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--lmvi-filet-doux);
	border-radius: var(--td-rayon);
	overflow: hidden;
	background: var(--wp--preset--color--fond, #fff);
	margin: 0;
}
/* Le contenu d'une carte s'empile sans l'écart de blocs du thème : les marges
   ci-dessous le règlent pièce à pièce. */
.td-articles .wp-block-post > * { margin-block: 0; }

.td-articles .wp-block-post-featured-image { margin: 0; }
.td-articles .wp-block-post-featured-image img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.td-articles .td-article__rubrique { margin: 1rem 1rem 0; }

.td-articles .td-article__titre,
.td-articles .wp-block-post-title {
	margin: 0.4rem 1rem 0;
	font-size: 1.05rem;
	line-height: 1.3;
	overflow-wrap: break-word;
	hyphens: none;
}
.td-articles .wp-block-post-featured-image + .td-article__titre,
.td-articles .wp-block-post-featured-image + .wp-block-post-title { margin-top: 1rem; }
.td-articles .wp-block-post-title a {
	color: var(--wp--preset--color--titres, #1e293b);
	text-decoration: none;
}
.td-articles .wp-block-post-title a:hover { color: var(--td-orange); }

.td-articles .td-article__meta {
	margin: 0.4rem 1rem 0;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: #666;
}
.td-articles .td-article__meta a { color: #666; }

.td-articles .wp-block-post-excerpt {
	margin: 0.6rem 1rem 1rem;
	font-size: 0.9rem;
	line-height: 1.55;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}
.td-articles .wp-block-post-excerpt__excerpt { margin: 0 0 0.75rem; }
.td-articles .wp-block-post-excerpt__more-text { margin: auto 0 0; }
.td-articles .wp-block-post-excerpt__more-link { color: var(--td-orange); }

/* La pagination posée par `publier.py` n'a pas d'attribut de mise en page : sans
   ces règles, ses trois morceaux s'empilent. */
.td-articles .wp-block-query-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 2.5rem;
	gap: 0.75rem;
	justify-content: center;
}
.td-articles .wp-block-query-pagination a { text-decoration: none; }
.td-articles .wp-block-query-pagination .current { color: var(--td-orange); font-weight: 700; }

/* La grille du thème (bloc en mode « grille ») : 3, puis 2, puis 1 colonne. */
@media (max-width: 64rem) {
	.td-articles .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
	.td-articles .wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr); }
}

/* La grille de `publier.py` (bloc en mode « flex », colonnes posées par
   attribut). Ne pas la repasser en `display: grid` : les cartes y perdent leur
   base et tombent à zéro de large (mesuré le 2026-10-06, page de 19 495 px). */
.td-articles .wp-block-post-template.is-flex-container.columns-3 > li {
	flex-basis: calc((100% - 2 * 1.75rem) / 3);
	max-width: calc((100% - 2 * 1.75rem) / 3);
}
@media (max-width: 64rem) {
	.td-articles .wp-block-post-template.is-flex-container.columns-3 > li {
		flex-basis: calc((100% - 1.75rem) / 2);
		max-width: calc((100% - 1.75rem) / 2);
	}
}
@media (max-width: 40rem) {
	.td-articles .wp-block-post-template.is-flex-container.columns-3 > li {
		flex-basis: 100%;
		max-width: 100%;
	}
}

/* `::: articles grand` — portfolio : moins de cartes, l'image en grand. */
.td-articles--grand .wp-block-post-featured-image img { height: 320px; }
.td-articles--grand .td-article__titre,
.td-articles--grand .wp-block-post-title { font-size: 1.3rem; }
.td-articles--grand .wp-block-post-template.is-flex-container.columns-2 > li {
	flex-basis: calc((100% - 1.75rem) / 2);
	max-width: calc((100% - 1.75rem) / 2);
}
@media (max-width: 48rem) {
	.td-articles--grand .wp-block-post-template.is-flex-container.columns-2 > li {
		flex-basis: 100%;
		max-width: 100%;
	}
	.td-articles--grand .wp-block-post-featured-image img { height: 220px; }
}

/* Les titres de carte ne sont pas des titres de page : une page à héros masque
   son propre titre (côté PHP), jamais ceux de la liste. */

/* --------------------------------------------------------------- mobile */

@media (max-width: 600px) {
	.td-hero { padding-block: 2.5rem; }
	.td-boutons { flex-direction: column; align-items: stretch; }
	.td-bouton { justify-content: center; }
	.td-page table { font-size: 0.86em; }
}

@media (prefers-reduced-motion: reduce) {
	.td-bouton .wp-block-button__link { transition: none; }
	.td-boutons .td-bouton .wp-block-button__link:hover { transform: none; }
}

/* Thèmes et éditeurs qui glissent une enveloppe entre un groupe et ses enfants
   (éditeur sans « layout support ») : l'enveloppe s'efface de la grille. */
.td-cartes > .wp-block-group__inner-container,
.td-etapes > .wp-block-group__inner-container,
.td-chiffres > .wp-block-group__inner-container,
.td-zigzag > .wp-block-group__inner-container,
.td-zigzag__ligne > .wp-block-group__inner-container,
.td-alterne > .wp-block-group__inner-container,
.td-alterne__item > .wp-block-group__inner-container,
.td-boutons > .wp-block-group__inner-container,
.td-badges > .wp-block-group__inner-container {
	display: contents;
}

/* ------------------------------------------------ grilles équilibrées (1.1.0)
   Une grille « auto-fit » laisse une rangée orpheline dès que le nombre d'éléments
   ne tombe pas juste (4 + 1, 4 + 3 + … ). Ici le nombre de colonnes se déduit du
   nombre d'éléments, et une dernière rangée incomplète est CENTRÉE :
     multiple de 4 → 4 par rangée · multiple de 3 → 3 · 2 → 2 · 5 → 3 + 2 ·
     7 → 4 + 3 · 10 → 4 + 4 + 2 · 11 → 4 + 4 + 3.
   Flexbox plutôt que grid : seule une rangée flex sait centrer son reste. */
.td-cartes, .td-etapes, .td-chiffres {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	--td-par-rangee: 4;
	--td-ecart: 1rem;
	gap: var(--td-ecart);
}
.td-cartes > *, .td-etapes > *, .td-chiffres > * {
	flex: 0 1 calc((100% - (var(--td-par-rangee) - 1) * var(--td-ecart)) / var(--td-par-rangee));
	min-width: 0;
	box-sizing: border-box;
}
/* 3 par rangée : multiples de 3 qui ne sont pas multiples de 4 (3, 6, 9, 15…), et 5. */
:is(.td-cartes, .td-etapes, .td-chiffres):has(> :last-child:nth-child(3n)):not(:has(> :last-child:nth-child(4n))),
:is(.td-cartes, .td-etapes, .td-chiffres):has(> :nth-child(5):last-child) {
	--td-par-rangee: 3;
}
/* 1 ou 2 éléments : deux colonnes, centrées. */
:is(.td-cartes, .td-etapes, .td-chiffres):has(> :last-child:nth-child(-n+2)) {
	--td-par-rangee: 2;
}
/* Les chiffres sont courts : jusqu'à 6 sur une rangée quand ils tombent juste. */
.td-chiffres:has(> :last-child:nth-child(6)),
.td-chiffres:has(> :last-child:nth-child(5)) { --td-par-rangee: 3; }
@media (max-width: 60rem) {
	.td-cartes, .td-etapes, .td-chiffres { --td-par-rangee: 2 !important; }
}
@media (max-width: 36rem) {
	.td-cartes, .td-etapes { --td-par-rangee: 1 !important; }
}

/* ------------------------------------------------------------ logos (1.1.0)
   Un logo n'est pas une photo : ni recadré, ni étiré. Dans une carte il se pose
   en tête, à 3,5 rem ; dans le texte d'une page, à 5 rem. Reconnus par leur
   dossier (`/uploads/<site>/logos/`). */
.td-carte img[src*="/logos/"] {
	width: 3.5rem;
	height: 3.5rem;
	object-fit: contain;
	border-radius: 0.8rem;
	margin: 0 0 0.8rem;
}
.entry-content img[src*="/logos/"], .wp-block-post-content img[src*="/logos/"] {
	width: 5rem;
	height: 5rem;
	object-fit: contain;
	border-radius: 1rem;
}
.td-zigzag__media img[src*="/logos/"], .td-alterne__visuel img[src*="/logos/"] {
	width: 8rem;
	height: 8rem;
	margin: auto;
}
/* Le logo d'une carte passe AVANT son titre, quel que soit l'ordre du contenu. */
.td-carte:has(img[src*="/logos/"]) { display: flex; flex-direction: column; }
.td-carte > :has(img[src*="/logos/"]), .td-carte > img[src*="/logos/"] { order: -1; margin-top: 0; }
