/* Styles de l'agent BLOG (thème v2, aperçu). Ne modifier que ce fichier.
   Hub /blog/ et catégories (template-parts/blog-list.php), article (single.php), fonctions dans inc/blog.php.
   Chargé après site.css, conversion.css, pages.css et seo.css : surcharge leurs règles de blog sans les modifier.
   Règles DESIGN.md : un rayon (--radius), pas d'ombre, pas de filet, pas d'étiquette au-dessus des titres. */

/* ---------- Hub et catégories : en-tête ---------- */
.blog-top .page-top__lead { max-width: 46ch; }
.blog-nav { margin-top: 32px; }

/* ---------- Hub : dernier article ---------- */
.blog-featured { padding-bottom: 0; }
.blog-lead { margin-bottom: 0; align-items: center; }
.blog-lead .post-lead__img { grid-column: 1 / span 6; aspect-ratio: 3 / 2; }
.blog-lead .post-lead__text { grid-column: 8 / span 5; }
.blog-lead h2 { font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.4rem); line-height: 1.1; margin: 12px 0 16px; }
.blog-lead h2 a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.14em; transition: text-decoration-color var(--t-hover) ease; }
.blog-lead .post-lead__text > p:last-child { max-width: 48ch; }
@media (max-width: 900px) { .blog-lead .post-lead__img, .blog-lead .post-lead__text { grid-column: 1 / -1; } }

/* ---------- Hub : une section par thème (la mise en grille vient de pages.css) ---------- */
.blog-themes .blog-theme + .blog-theme { margin-top: 0; }
.blog-themes .blog-theme, .blog-later { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem); }
.blog-themes { padding-top: clamp(1.5rem, 4vw, 3.5rem); }
.blog-theme .post-rows--stack, .post-rows--stack { grid-template-columns: minmax(0, 1fr); }
.blog-theme .post-row__link { padding-block: 14px; }
.blog-theme__all { margin-top: 20px; }
.blog-theme__empty { color: var(--ink); }
.blog-later p { max-width: 60ch; }
.blog-later h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); }
.blog-list .post-rows--stack { max-width: 62rem; }
.blog-back { padding-bottom: calc(var(--gap-section) / 2); }
.blog-cat-guides { margin-top: 0; padding-top: 0; }
.blog-cat-guides h2 { margin-bottom: 0; }

/* ---------- Article : grille (une colonne de lecture ; sommaire en marge à partir de 1100 px) ---------- */
.article2__grid { display: grid; grid-template-columns: minmax(0, 1fr); padding-top: clamp(2rem, 5vw, 4.5rem); padding-bottom: calc(var(--gap-section) / 2); }
.article2__head, .article2__cover, .toc--fold, .article2__prose { width: 100%; max-width: 44rem; margin-inline: auto; }
.article2__head h1 { font-size: clamp(1.9rem, 1.1rem + 2.8vw, 3.75rem); letter-spacing: -0.035em; line-height: 1.04; }
.article2__lead { font-size: var(--step-lead); line-height: 1.4; max-width: 44ch; margin-top: 20px; }
.article2__meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 24px; color: var(--muted); font-size: 1rem; }
.article2__meta a { color: var(--ink); font-weight: 500; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.article2__cover { margin-top: clamp(1.75rem, 4vw, 3rem); margin-bottom: 0; }
.article2__cover img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.article2__prose { margin-top: clamp(2rem, 4vw, 3rem); }
@media (max-width: 1099px) { .article2__head, .article2__cover, .toc--fold, .article2__prose { margin-inline: 0; } }

@media (min-width: 1100px) {
	.article2__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
	.article2__head, .article2__cover, .article2__prose { grid-column: 4 / span 8; max-width: none; margin-inline: 0; }
	.article2__prose { grid-row: 3; max-width: 34em; }
	.article2:not(.has-toc) .article2__head, .article2:not(.has-toc) .article2__cover, .article2:not(.has-toc) .article2__prose { grid-column: 3 / span 8; }
}

/* ---------- Article : texte (65 à 72 caractères par ligne, liens soulignés et visibles) ---------- */
.article2__prose { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.65; }
.article2 .article2__prose { max-width: 34em; }
.article2__prose > * + * { margin-top: 1.05em; }
.article2__prose h2 { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem); line-height: 1.12; margin-top: 2.3em; scroll-margin-top: 100px; }
.article2__prose h3 { font-size: 1.3125rem; margin-top: 1.8em; }
.article2__prose h2 + *, .article2__prose h3 + * { margin-top: 0.6em; }
.article2__prose a { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 0.2em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .article2__prose a:hover { text-decoration-color: var(--accent); } }
.article2__prose ul, .article2__prose ol { padding-left: 1.3em; }
.article2__prose li + li { margin-top: 0.45em; }
.article2__prose p, .article2__prose li { overflow-wrap: break-word; }

/* Tableaux : cadre qui défile sur le côté quand il ne tient pas (téléphone), chiffres alignés */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border-radius: var(--radius); background: var(--bg); }
.table-scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.table-scroll table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.table-scroll th, .table-scroll td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--surface-2); }
.table-scroll thead th { background: var(--surface); font-weight: 600; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
@media (min-width: 760px) { .table-scroll table { font-size: 1rem; } }
/* Téléphone : chaque ligne devient une petite fiche (nom de colonne à gauche, valeur à droite), rien ne dépasse de l'écran */
@media (max-width: 599px) {
	.table-scroll--cards { overflow: visible; background: transparent; border-radius: 0; }
	.table-scroll--cards table { min-width: 0; }
	.table-scroll--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.table-scroll--cards table, .table-scroll--cards tbody, .table-scroll--cards tr { display: block; }
	.table-scroll--cards tr { background: var(--surface); border-radius: var(--radius); padding: 10px 18px; }
	.table-scroll--cards tr + tr { margin-top: 8px; }
	.table-scroll--cards td { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); gap: 12px; padding: 8px 0; border-bottom: 0; }
	.table-scroll--cards td::before { content: attr(data-label); color: var(--muted); font-weight: 500; }
	.table-scroll--cards td:not([data-label]), .table-scroll--cards td:first-child { display: block; }
	.table-scroll--cards td:not([data-label])::before, .table-scroll--cards td:first-child::before { content: none; }
	.table-scroll--cards td:first-child { font-weight: 600; padding-bottom: 4px; }
}

/* ---------- Sommaire ---------- */
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { text-decoration-color: var(--accent); } }

/* Téléphone et tablette : repliable, en haut du texte */
.toc--fold { margin-top: clamp(1.75rem, 4vw, 2.5rem); background: var(--surface); border-radius: var(--radius); }
.toc--fold summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 22px; font-weight: 600; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.toc--fold summary::-webkit-details-marker { display: none; }
.toc--fold summary span { color: var(--muted); font-weight: 400; font-size: var(--step-small); }
.toc--fold summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-3px) rotate(45deg); transition: transform 200ms var(--ease-out); }
.toc--fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.toc--fold summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }
.toc--fold ol { padding: 0 22px 20px; display: grid; gap: 4px; }
.toc--fold a { display: block; padding: 6px 0; }
.toc--side { display: none; }

@media (min-width: 1100px) {
	.toc--fold { display: none; }
	.toc--side { display: block; grid-column: 1 / span 3; grid-row: 3; align-self: start; position: sticky; top: 104px; margin-top: clamp(2rem, 4vw, 3rem); padding-right: clamp(1rem, 2vw, 2.5rem); max-height: calc(100svh - 128px); overflow-y: auto; }
	.toc__title { font-weight: 600; margin-bottom: 14px; }
	.toc--side ol { display: grid; gap: 2px; }
	.toc--side a { display: block; padding: 6px 0; font-size: 0.9375rem; line-height: 1.35; }
}

/* ---------- Encart checklist au milieu de l'article ---------- */
.inline-cta { background: var(--surface); border-radius: var(--radius); padding: clamp(22px, 3vw, 32px); margin-block: 2.4em; font-size: 1rem; line-height: 1.5; }
.article2__prose > .inline-cta { margin-top: 2.4em; }
.inline-cta__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.inline-cta p { max-width: 54ch; }
.inline-cta__title + p { margin-top: 8px; }
.inline-cta__form { margin-top: 18px; }
.inline-cta__form input[type="email"] { min-height: 52px; }
.inline-cta__form .btn { min-height: 52px; }
.inline-cta__small { margin-top: 12px; color: var(--muted); font-size: var(--step-small); }
.inline-cta:has(.is-sent) .inline-cta__small { display: none; }

/* ---------- Bloc auteur (fin d'article) : le logo à anneaux tient lieu de portrait (marque anonyme) ---------- */
.author-box { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; margin-top: 3em; padding: clamp(22px, 3vw, 32px); background: var(--surface); border-radius: var(--radius); font-size: 1rem; line-height: 1.55; }
.author-box__mark { width: 56px; height: 56px; fill: none; stroke: var(--accent); stroke-width: 4.5; }
.author-box__title { font-weight: 600; font-size: 1.125rem; margin-bottom: 6px; }
.author-box p + p { margin-top: 10px; }

/* ---------- Lectures liées ---------- */
.blog-related h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); margin-bottom: 24px; }
.blog-related .blog-theme__grid h2 { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
	.toc--fold summary::after { transition: none; }
}
