/* Site v2 : articles du blog (public/site/blog/*.php). Le balisage des articles est gardé tel quel,
   seul l'habillage change : jetons et grammaire de css/v2.css, feuilles blanches à rebord du Design System. */

.blog-suite, .blog-suite.suite { padding: 0; }
.blog-hero, .blog-article-wrapper, .blog-related, .blog-suite > .blog-list {
    --c-bg: #fff; --c-txt: #13284b; --c-doux: #3f5870; --c-trait: rgba(19, 40, 75, .08);
    --c-omb: 0 1px 2px rgba(19, 40, 75, .04), 0 30px 60px -40px rgba(19, 40, 75, .35); --rebord: #c9d6e3;
}
[data-theme="nuit"] :is(.blog-hero, .blog-article-wrapper, .blog-related, .blog-suite > .blog-list) {
    --c-bg: #1f3a5f; --c-txt: #fff; --c-doux: #c9d6e3; --c-trait: rgba(255, 255, 255, .09); --c-omb: 0 30px 60px -36px rgba(0, 0, 0, .6); --rebord: #0b1a33;
}

/* ─── Hero : fil d'Ariane, rubrique, titre surligné, temps de lecture ─── */
.blog-hero { max-width: 1180px; margin: 0 auto; padding: clamp(124px, 12vw, 160px) var(--gout) clamp(40px, 5vw, 64px); display: grid; gap: 18px; justify-items: start; }
.blog-hero__breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font: 500 13.5px/1.3 var(--texte); color: var(--t-sub); }
.blog-hero__breadcrumb a { color: var(--t-lien); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); }
.blog-hero__breadcrumb a:hover { text-decoration-color: currentColor; }
.blog-hero__tag { display: inline-flex; padding: 6px 14px; border-radius: 999px; font: 600 13px/1.2 var(--texte); }
.blog-hero__title { max-width: 22ch; font-family: var(--titre); font-size: clamp(32px, 4.2vw, 54px); line-height: 1.06; letter-spacing: var(--titre-ls); font-weight: var(--titre-poids); color: var(--t-titre); text-wrap: balance; }
.blog-hero__title .highlight { background: linear-gradient(transparent 62%, var(--t-sur) 62% 90%, transparent 90%); }
.blog-hero__subtitle { font-size: 18px; line-height: 1.6; color: var(--t-sub); max-width: 60ch; }
.blog-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; font: 500 14px/1.4 var(--texte); color: var(--t-sub); }

/* ─── Article et sommaire collant ─── */
.blog-article-wrapper { max-width: 1180px; margin: 0 auto; padding: 0 var(--gout) clamp(72px, 8vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(40px, 5vw, 80px); align-items: start; }
.blog-content { min-width: 0; max-width: 72ch; color: var(--s-txt); font-size: 17.5px; line-height: 1.75; }
.blog-content section { scroll-margin-top: 110px; }
.blog-content section + section { margin-top: clamp(40px, 5vw, 64px); }
.blog-content h2 { font-family: var(--titre); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.025em; font-weight: var(--titre-poids); color: var(--s-txt); margin: 0 0 18px; text-wrap: balance; }
.blog-content h3 { font: 700 21px/1.3 var(--titre); letter-spacing: -.015em; color: var(--s-txt); margin: 32px 0 10px; scroll-margin-top: 110px; }
.blog-content p, .blog-content ul, .blog-content ol { margin: 0 0 16px; color: var(--s-doux); }
/* Texte justifié, césure française pour éviter les rivières (comme les pages module) */
.blog-content :is(p, li) { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.blog-content p { max-width: none; } /* .suite p borne à 56ch : l'article a sa propre mesure */
.blog-content strong { color: var(--s-txt); font-weight: 650; }
.blog-content ul, .blog-content ol { padding-left: 1.3em; }
.blog-content li { margin: 6px 0; }
.blog-content li::marker { color: #fc8822; }
.blog-content a:not(.btn) { color: var(--s-txt); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: #fc8822; }
.blog-content a:not(.btn):hover { text-decoration-thickness: 2px; }

/* Encadrés : feuilles du Design System, blanches dans les deux thèmes, rebord plein dessous, jamais d'ombre floue
   ni de bordure latérale colorée. « En bref » (.blog-bref, posé par le script de conversion) en est l'intitulé souligné. */
.blog-citation, .blog-cta-card, .blog-figure { margin: 32px 0 40px; padding: 22px 26px 24px; border-radius: 16px; background: #fff; color: #193451; box-shadow: 0 8px 0 var(--rebord); }
.blog-citation :is(p, li), .blog-cta-card :is(p, li) { color: #3f5870; }
.blog-citation strong, .blog-cta-card strong, .blog-citation a:not(.btn), .blog-cta-card a:not(.btn) { color: #13284b; }
.blog-citation > :last-child, .blog-cta-card > :last-child, .blog-citation p:last-child { margin-bottom: 0; }
.blog-bref { display: block; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 3px solid #193451; font: 700 17px/1.2 var(--titre); letter-spacing: -.01em; }
/* Encadré « En bref », « Astuce »… : la feuille en sauge clair */
.blog-citation { background: #e6f1eb; box-shadow: 0 8px 0 #c4d9cb; }
[data-theme="nuit"] .blog-citation { box-shadow: 0 8px 0 #0b1a33; }
/* L'encart produit : la même feuille en pêche, un seul bouton */
.blog-cta-card { background: #fff1e3; box-shadow: 0 8px 0 #f2d9bf; }
[data-theme="nuit"] .blog-cta-card { box-shadow: 0 8px 0 #0b1a33; }
.blog-cta-card > p:first-child { text-align: left; font: 600 17px/1.5 var(--titre); color: #13284b; }
.blog-cta-card ul { padding-left: 1.2em; }
.blog-cta-card .btn { margin-top: 18px; }
.blog-cta { margin: 28px 0; }
/* Renvoi vers une page du site : une ligne entre deux filets, la flèche en tête */
.blog-content .blog-maillage-money { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--c-trait); border-bottom: 1px solid var(--c-trait); font-size: 16px; text-align: left; }
.blog-maillage-money::before { content: "→"; flex: none; color: #fc8822; font-weight: 700; }

/* Illustrations : l'image seule, arrondie, sur son rebord ; les schémas sur une feuille (leurs couleurs sont celles du jour) */
.blog-img { margin: 32px 0 40px; }
.blog-img img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 8px 0 var(--rebord); outline: 1px solid rgba(19, 40, 75, .12); outline-offset: -1px; }
/* Filet fin tout autour : une feuille blanche sur une page blanche n'aurait que son rebord pour contour */
.blog-figure { padding: clamp(14px, 2vw, 22px); box-shadow: inset 0 0 0 1px rgba(19, 40, 75, .12), 0 8px 0 var(--rebord); }
.blog-figure img, .blog-figure svg { display: block; width: 100%; height: auto; }
.blog-figure figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: #3f5870; text-align: center; }

/* Tableaux : filets fins, en-tête discret, défilement horizontal dans leur cadre sur mobile */
.blog-table-wrap, .blog-table-wrapper { margin: 32px 0 40px; overflow-x: auto; border-radius: 16px; background: var(--c-bg); box-shadow: inset 0 0 0 1px rgba(19, 40, 75, .12), 0 8px 0 var(--rebord); }
.blog-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.blog-table caption { padding: 14px 18px 4px; text-align: left; font: 600 14px/1.4 var(--texte); color: var(--s-doux); }
.blog-table :is(th, td) { padding: 10px 12px; hyphens: manual; text-align: left; vertical-align: top; border-top: 1px solid var(--c-trait); color: var(--s-doux); }
/* Grands comparatifs (7 colonnes et plus) : un cran plus serrés pour tenir sans défilement */
.blog-table:has(tr > :nth-child(7)) { font-size: 13px; }
.blog-table:has(tr > :nth-child(7)) :is(th, td) { padding: 9px 9px; }
.blog-table thead th { font-weight: 650; color: var(--s-txt); border-top: 0; }
.blog-table tbody th { font-weight: 600; color: var(--s-txt); }
.blog-table--highlight-last :is(th, td):last-child { background: color-mix(in srgb, #fff1e3 60%, transparent); }
[data-theme="nuit"] .blog-table--highlight-last :is(th, td):last-child { background: rgba(255, 184, 119, .08); }
.blog-table-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.ico-yes { color: #437a56; font-weight: 700; }
.ico-na { color: var(--s-doux); }
[data-theme="nuit"] .ico-yes { color: #8fb5a2; }
.blog-lvl { display: inline-flex; gap: 3px; letter-spacing: 0; }
.blog-lvl b { font-weight: 400; color: var(--c-trait); }
.blog-lvl b.on { color: #fc8822; }

/* FAQ en clair (lue par les moteurs) : question puis réponse, séparées d'un filet */
.blog-faq__item + .blog-faq__item { margin-top: 12px; }
.blog-faq__answer p:last-child { margin-bottom: 0; }

/* Sommaire : carte collante, fil gris et points orange qui avancent avec la lecture */
.blog-sidebar-v2 { position: sticky; top: 100px; }
.blog-sidebar-v2__inner { display: grid; gap: 14px; padding: 18px 16px 16px; border-radius: 22px; background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-trait), var(--c-omb); max-height: calc(100vh - 130px); overflow-y: auto; scrollbar-width: none; }
.blog-sidebar-v2__inner::-webkit-scrollbar { display: none; }
.blog-sidebar-v2__title { padding: 0 4px; font: 600 12.5px/1.3 var(--texte); color: var(--s-doux); }
.blog-sidebar-v2__nav { position: relative; display: grid; gap: 2px; }
.blog-sidebar-v2__track { position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--c-trait); }
.blog-sidebar-v2__track-fill { width: 100%; border-radius: 2px; background: #fc8822; transition: height .2s ease; }
.blog-sidebar-v2__section { position: relative; padding-left: 26px; }
.blog-sidebar-v2__dot { position: absolute; left: 3px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--c-bg); box-shadow: inset 0 0 0 2px var(--c-trait); transition: background .25s, box-shadow .25s; }
.blog-sidebar-v2__dot.active { background: #fc8822; box-shadow: none; }
.blog-sidebar-v2__link { display: block; padding: 5px 0; font: 600 14px/1.35 var(--texte); color: var(--s-doux); text-decoration: none; }
.blog-sidebar-v2__link:hover, .blog-sidebar-v2__link.active { color: var(--s-txt); }
.blog-sidebar-v2__subs { list-style: none; margin: 0 0 4px; padding: 0; }
.blog-sidebar-v2__sub-link { display: block; padding: 3px 0; font: 500 13px/1.4 var(--texte); color: var(--s-doux); text-decoration: none; opacity: .8; }
.blog-sidebar-v2__sub-link:hover, .blog-sidebar-v2__sub-link.active { color: var(--s-txt); opacity: 1; }
.blog-sidebar-v2__cta .btn { width: 100%; justify-content: center; }

/* ─── Articles liés : cartes blanches à rebord, image en tête ─── */
.blog-related { max-width: 1180px; margin: 0 auto; padding: 0 var(--gout) clamp(72px, 8vw, 120px); }
.blog-related .blog-related__title { margin-bottom: 32px; font-family: var(--titre); font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.025em; font-weight: var(--titre-poids); color: var(--s-txt); }
/* Page de liste (blog/liste-articles.php) : la grille sous le hero, à la largeur du site */
.blog-suite > .blog-list { max-width: 1180px; margin: 0 auto; padding: 0 var(--gout) clamp(72px, 8vw, 120px); }
.blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.blog-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 22px; background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-trait), 0 8px 0 var(--rebord); color: var(--s-txt); text-decoration: none; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.blog-card:hover { transform: translateY(-3px); }
.blog-card__image { aspect-ratio: 16 / 9; overflow: hidden; background: #f4f6f9; }
.blog-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.blog-card__tag { align-self: flex-start; padding: 4px 12px; border-radius: 999px; font: 600 12px/1.3 var(--texte); }
/* Un badge par type d'article, même code au hero et sur les cartes : guide en bleu, finances en sauge, comparatif en pêche */
.blog-hero__tag--guide, .blog-card__tag--guide { color: #193451; background: #dce7f2; }
.blog-hero__tag--finances, .blog-card__tag--finances { color: #2f5d43; background: #e6f1eb; }
.blog-hero__tag--comparatif, .blog-card__tag--comparatif { color: #8a4510; background: #fff1e3; }
[data-theme="nuit"] .blog-hero__tag--guide, [data-theme="nuit"] .blog-card__tag--guide { color: #dce7f2; background: rgba(159, 181, 202, .2); }
[data-theme="nuit"] .blog-hero__tag--finances, [data-theme="nuit"] .blog-card__tag--finances { color: #cfe6d8; background: rgba(143, 181, 162, .2); }
[data-theme="nuit"] .blog-hero__tag--comparatif, [data-theme="nuit"] .blog-card__tag--comparatif { color: #ffd9b3; background: rgba(255, 184, 119, .16); }
.blog-card .blog-card__title { max-width: none; margin: 0; font: 700 18px/1.3 var(--titre); letter-spacing: -.015em; color: var(--s-txt); }
.blog-card__excerpt { font-size: 15px; line-height: 1.55; color: var(--s-doux); }
.blog-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 4px; font: 500 13px/1.3 var(--texte); color: var(--s-doux); }
.blog-card__meta { display: flex; gap: 6px; }
.blog-card__link { font-weight: 600; color: var(--s-txt); }

/* ─── Mobile : une colonne ; le sommaire devient le panneau bas ouvert depuis la barre (js/landing.js) ─── */
/* Article sur grand écran : une grille commune au hero et au texte ; le sommaire monte à côté du titre,
   à la hauteur du fil d'Ariane, et reste collé pendant toute la lecture */
@media (min-width: 871px) {
    .blog-suite:has(> .blog-article-wrapper) { display: grid; grid-template-columns: minmax(var(--gout), 1fr) minmax(0, 820px) calc(280px + clamp(40px, 5vw, 80px)) minmax(var(--gout), 1fr); }
    .blog-suite:has(> .blog-article-wrapper) > .blog-hero { grid-column: 2; grid-row: 1; max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
    .blog-suite:has(> .blog-article-wrapper) > .blog-article-wrapper { display: contents; }
    .blog-suite:has(> .blog-article-wrapper) .blog-content { grid-column: 2; grid-row: 2; padding-bottom: clamp(72px, 8vw, 120px); }
    /* La colonne court sur le hero et l'article ; seule la carte colle, et s'arrête donc à la fin de l'article */
    .blog-suite:has(> .blog-article-wrapper) .blog-sidebar-v2 { grid-column: 3; grid-row: 1 / span 2; position: static; align-self: stretch; margin: clamp(124px, 12vw, 160px) 0 clamp(72px, 8vw, 120px) clamp(40px, 5vw, 80px); }
    .blog-suite:has(> .blog-article-wrapper) .blog-sidebar-v2__inner { position: sticky; top: 100px; }
    .blog-suite:has(> .blog-article-wrapper) > .blog-related { grid-column: 2 / 4; max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
}
@media (max-width: 870px) {
    .blog-article-wrapper { grid-template-columns: minmax(0, 1fr); }
    .blog-content { font-size: 17px; }
    .blog-sidebar-v2 { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); top: auto; z-index: 40; max-height: 70vh; opacity: 0; transform: translateY(24px); pointer-events: none; transition: opacity .25s, transform .35s cubic-bezier(.32, .72, 0, 1); }
    .blog-sidebar-v2.is-ouvert { opacity: 1; transform: none; pointer-events: auto; }
    .blog-sidebar-v2__inner { max-height: 70vh; }
    .sommaire-fond { position: fixed; inset: 0; z-index: 39; background: rgba(19, 40, 75, .3); opacity: 0; pointer-events: none; transition: opacity .25s; }
    .sommaire-fond.is-ouvert { opacity: 1; pointer-events: auto; }
    .barre-mobile__sommaire:not([hidden]) { display: inline-flex; align-items: center; padding: 0 16px; border: 0; border-radius: 12px; font: 600 15px/1 var(--texte); color: var(--s-txt); background: var(--nav-survol); }
}
/* Téléphone : encadrés et marges resserrés ; les boutons d'encadré passent à la ligne au lieu de dépasser de l'écran */
@media (max-width: 640px) {
    .blog-content .btn { max-width: 100%; height: auto; min-height: 50px; padding: 12px 18px; white-space: normal; text-align: center; line-height: 1.3; }
    .blog-hero { padding-bottom: 20px; gap: 14px; }
    .blog-citation, .blog-cta-card, .blog-figure { margin: 24px 0 32px; padding: 18px 18px 20px; }
    .blog-bref { font-size: 16px; }
    .blog-img, .blog-table-wrap, .blog-table-wrapper { margin: 24px 0 32px; }
    .blog-related { padding-bottom: 16px; }
    .blog-related .blog-related__title { margin-bottom: 20px; font-size: 24px; }
}
/* Téléphone : le tableau défile dans son cadre, texte réduit ; la colonne des critères reste en place */
@media (max-width: 640px) {
    .blog-table, .blog-table:has(tr > :nth-child(7)) { font-size: 12.5px; line-height: 1.4; }
    .blog-table :is(th, td), .blog-table:has(tr > :nth-child(7)) :is(th, td) { min-width: 8em; padding: 8px 9px; }
    .blog-content .blog-table--highlight-last tr > :last-child { min-width: 17em; }
    .blog-content .blog-table tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 7em; max-width: 8.5em; background: var(--c-bg); box-shadow: inset -1px 0 0 var(--c-trait); }
}
/* Téléphone : carte en ligne (vignette, badge, titre, durée), le résumé s'efface ; 22 cartes pleine largeur faisaient 14 000 px */
@media (max-width: 640px) {
    .blog-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .blog-card { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: none; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--c-trait), 0 5px 0 var(--rebord); }
    .blog-card__image { aspect-ratio: auto; height: 100%; }
    .blog-card__body { gap: 6px; padding: 14px 14px 12px; }
    .blog-card__tag { padding: 2px 9px; font-size: 11px; }
    .blog-card .blog-card__title { font-size: 15.5px; line-height: 1.3; }
    .blog-card__excerpt, .blog-card__link { display: none; }
    .blog-card__footer { padding-top: 0; font-size: 12px; }
}
/* Apparition à l'entrée dans l'écran (js/v2.js) */
.a-reveler { opacity: 0; transform: translateY(18px); }
.a-reveler.vu { opacity: 1; transform: none; transition: opacity .6s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .blog-card, .blog-sidebar-v2 { transition: none; } }

/* ─── Retrouvez Insuleo : cartes compactes, 4 par ligne ; sans section démo, le fond glisse seul vers la pêche du pied ─── */
.reseaux .blog-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.reseaux .blog-card__image { display: grid; place-items: center; aspect-ratio: auto; height: 96px; }
.reseaux .blog-card__image :is(img, svg) { width: 40px; height: 40px; }
.reseaux-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) { .reseaux .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .reseaux .blog-list { grid-template-columns: minmax(0, 1fr); } .reseaux .blog-card__image { height: 100%; } }
.blog-suite--fin { background: linear-gradient(180deg, var(--s-bg) calc(100% - 240px), #f2d9bf 100%); }
[data-theme="nuit"] .blog-suite--fin { background: linear-gradient(180deg, var(--s-bg) calc(100% - 240px), #2a4566 100%); }
