/* Blog : liste des articles et gabarit d'article. S'appuie sur home.css (couleurs, boutons) et pages.css (carte de texte, schémas). */

/* Barre de lecture */
.progression { position: fixed; inset: 0 0 auto; height: 3px; z-index: 70; pointer-events: none; }
.progression span { display: block; height: 100%; background: var(--rouge); transform: scaleX(0); transform-origin: 0 50%; }

/* Étiquette de catégorie */
.etiquette { display: inline-flex; align-items: center; margin: 0; padding: 5px 12px; border-radius: 999px; background: var(--rouge-clair); color: var(--rouge-fort); font-size: .76rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; text-decoration: none; }
a.etiquette:hover { background: #F7D5D8; color: var(--rouge-fort); }

/* Mise en page de l'article : sommaire à gauche sur grand écran, texte au centre */
.billet { display: grid; grid-template-columns: minmax(0, 1fr); }
.billet-tete { padding: clamp(24px, 4vw, 52px) 0 clamp(20px, 3vw, 30px); }
.billet-tete .fil { margin-bottom: 18px; }
body.contenu .billet-tete h1 { margin: 14px 0 0; max-width: 17em; }
.billet-tete .chapeau { max-width: 36em; }
.billet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 22px 0 0; padding: 0; list-style: none; font-size: .86rem; color: var(--doux); }
.billet-meta li { display: inline-flex; align-items: center; gap: 7px; }
.billet-meta svg { width: 17px; height: 17px; flex: none; color: var(--contour); }
.partager { min-height: 36px; padding: 6px 16px; border: 1px solid var(--filet); border-radius: 999px; background: var(--blanc); color: var(--encre); font: inherit; font-weight: 700; cursor: pointer; }
.partager:hover { border-color: var(--encre); }
.billet-nav { margin-bottom: 14px; }
.billet-texte { font-size: 1.04rem; line-height: 1.7; }
.billet-texte h2, .billet-texte h3, .billet .sources { scroll-margin-top: 92px; }
.billet-suite { margin-top: clamp(24px, 3vw, 36px); }
body.contenu .billet-suite h2 { margin: clamp(28px, 4vw, 44px) 0 14px; }

@media (min-width: 1000px) {
  .billet { grid-template-columns: 232px minmax(0, 780px); column-gap: clamp(36px, 4vw, 60px); justify-content: center; }
  .billet-tete, .billet-texte, .billet-suite { grid-column: 2; }
  .billet-nav { grid-column: 1; grid-row: 2 / span 2; margin: 0; }
  .billet-nav-dedans { position: sticky; top: 24px; }
  .billet-texte h2, .billet-texte h3, .billet .sources { scroll-margin-top: 24px; }
}

/* Sommaire : replié sur téléphone, fixe et surligné sur grand écran */
.sommaire-billet { margin: 0; padding: 0; border: 1px solid var(--filet); border-radius: 18px; background: var(--blanc); }
.sommaire-billet summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; font-weight: 800; font-size: .95rem; list-style: none; cursor: pointer; }
.sommaire-billet summary::-webkit-details-marker { display: none; }
.sommaire-billet summary::after { content: ''; position: static; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; color: var(--encre); rotate: none; transform: rotate(45deg); transition: transform .2s; }
.sommaire-billet[open] summary::after { margin-top: 4px; rotate: none; transform: rotate(-135deg); }
.sommaire-billet ol { margin: 0; padding: 0 8px 10px; list-style: none; counter-reset: s; }
.sommaire-billet li { counter-increment: s; }
.sommaire-billet a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--doux); font-size: .9rem; line-height: 1.35; text-decoration: none; }
.sommaire-billet a::before { content: counter(s, decimal-leading-zero); flex: none; padding-top: 2px; color: var(--contour); font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sommaire-billet a:hover { background: var(--fond); color: var(--encre); }
.sommaire-billet a[aria-current] { background: var(--rouge-clair); color: var(--rouge-fort); font-weight: 700; }
.sommaire-billet a[aria-current]::before { color: var(--rouge); }
.nav-cta { display: none; }
@media (min-width: 1000px) {
  .sommaire-billet { border: 0; background: none; }
  .sommaire-billet summary { min-height: 0; padding: 0 10px 10px; color: var(--doux); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; pointer-events: none; }
  .sommaire-billet summary::after { display: none; }
  .sommaire-billet ol { max-height: calc(100vh - 250px); padding: 0; overflow: auto; }
  .nav-cta { display: block; margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--encre); color: #fff; }
  .nav-cta p { margin: 0 0 12px; font-size: .9rem; font-weight: 700; line-height: 1.4; }
  .nav-cta .btn { width: 100%; box-sizing: border-box; }
}

/* L'essentiel en tête d'article */
.essentiel { margin: 0 0 1.8em; padding: clamp(18px, 2.6vw, 26px); border: 1px solid var(--filet); border-radius: 20px; background: var(--fond); }
body.contenu .billet .essentiel h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 1.05rem; letter-spacing: 0; }
.essentiel h2::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--rouge); box-shadow: 0 0 0 4px var(--rouge-clair); }
.billet .essentiel ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.billet .essentiel li { max-width: none; margin: 0; padding: 12px 16px; border-left: 4px solid var(--rouge); border-radius: 6px 14px 14px 6px; background: var(--blanc); font-size: .98rem; line-height: 1.55; }

/* Titres de section : un filet discret au-dessus */
body.contenu .billet-texte > h2 { padding-top: 1.1em; border-top: 1px solid var(--filet); }
body.contenu .billet-texte > .essentiel + h2, body.contenu .billet-texte > h2:first-child { padding-top: 0; border-top: 0; }

/* Tableaux : en-tête sombre, première colonne en gras ; en cartes sur téléphone */
.billet .tableau { border: 0; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--filet); }
.billet .tableau table { border-collapse: separate; border-spacing: 0; font-size: .93rem; line-height: 1.5; }
.billet .tableau th { background: var(--encre); color: #fff; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; white-space: normal; }
.billet .tableau td:first-child { color: var(--encre); font-weight: 700; }
.billet .tableau tbody tr:nth-child(even) td { background: #FBFAF8; }
.billet .tableau tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .billet .tableau { margin: 1.2em 0; overflow: visible; border-radius: 0; box-shadow: none; }
  .billet .tableau table, .billet .tableau tbody, .billet .tableau tr, .billet .tableau td { display: block; width: 100%; box-sizing: border-box; }
  .billet .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .billet .tableau tbody { display: grid; gap: 10px; }
  .billet .tableau tr { overflow: hidden; border: 1px solid var(--filet); border-radius: 16px; background: var(--blanc); }
  .billet .tableau td, .billet .tableau tbody tr:nth-child(even) td { padding: 10px 14px; border-bottom: 1px solid var(--filet); background: none; }
  .billet .tableau tr td:last-child { border-bottom: 0; }
  .billet .tableau td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--contour); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .billet .tableau tbody tr td:first-child { background: var(--fond); font-size: .97rem; }
  .billet .tableau td:first-child::before { color: var(--rouge-texte); }
}

/* Questions fréquentes */
.billet .faq { display: grid; gap: 12px; margin-top: 1em; }
.faq-q { padding: 18px 20px; border: 1px solid var(--filet); border-radius: 18px; background: #FCFBFA; }
body.contenu .billet .faq-q h3 { display: flex; gap: 12px; margin: 0 0 8px; font-size: 1.04rem; line-height: 1.35; }
.faq-q h3::before { content: 'Q'; display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--encre); color: #fff; font-size: .8rem; }
.billet .faq-q p { margin: 0; font-size: .97rem; }
@media (max-width: 560px) { .faq-q { padding: 16px; } }

/* Vérification et sources */
.confiance { margin-top: 2.2em; padding: 16px 20px; border-radius: 16px; background: var(--fond); font-size: .92rem; line-height: 1.55; }
.billet .confiance p { max-width: none; margin: 0; }
.billet .sources ol { padding-left: 1.6em; }
.billet .sources li { margin: .3em 0; font-size: .86rem; line-height: 1.45; }
.billet .sources li::marker { color: var(--contour); font-weight: 700; }

/* Suite de l'article : appel à l'action en bandeau sur grand écran */
@media (min-width: 720px) {
  .billet-suite .carte-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: center; padding: 30px 32px; }
  .billet-suite .carte-cta > :not(.btn) { grid-column: 1; }
  .billet-suite .carte-cta .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: auto; min-width: 240px; margin: 0; }
  .billet-suite .carte-cta .btn + .btn { grid-row: 3; }
  .billet-suite .carte-cta small { grid-row: 3; }
}

/* Schéma : calendrier d'un délai */
.calendrier ol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.calendrier .cal-jours { margin-bottom: 6px; color: var(--doux); font-size: .72rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.cal-grille li { display: flex; flex-direction: column; justify-content: space-between; min-height: 60px; padding: 7px 8px; border-radius: 12px; background: var(--fond); color: var(--doux); font-size: .7rem; line-height: 1.2; }
.cal-grille b { color: var(--encre); font-size: 1.05rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-grille small { font-size: .66rem; font-weight: 700; }
.cal-grille span { font-weight: 700; }
.cal-grille .c-delai { background: var(--rouge-clair); color: var(--rouge-fort); }
.cal-grille .c-depart { background: var(--encre); color: #fff; }
.cal-grille .c-fin { background: var(--rouge); color: #fff; box-shadow: 0 0 0 2px var(--blanc), 0 0 0 4px var(--rouge); }
.cal-grille .c-depart b, .cal-grille .c-fin b { color: #fff; }
.cal-grille .c-tard, .l-tard { background: repeating-linear-gradient(135deg, var(--fond) 0 5px, #E7E2DF 5px 10px); }
.cal-grille .c-tard b { color: var(--contour); text-decoration: line-through; }
.cal-grille .c-vide { background: none; }
.cal-resultat { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--encre); color: #fff; font-size: .92rem; }
.calendrier .g-legende i, .pistes .g-legende i { width: 14px; height: 14px; border: 0; border-radius: 4px; }
.g-legende i.l-depart { background: var(--encre); }
.g-legende i.l-delai { background: var(--rouge-clair); box-shadow: inset 0 0 0 1px #F2C4C9; }
.g-legende i.l-fin, .g-legende i.l-fenetre { background: var(--rouge); }
@media (max-width: 480px) {
  .calendrier ol { gap: 4px; }
  .cal-grille li { min-height: 50px; padding: 5px; border-radius: 9px; font-size: .6rem; }
  .cal-grille b { font-size: .9rem; }
  .cal-grille small { font-size: .56rem; }
}

/* Schéma : parcours de décision */
.parcours ol { margin: 0; padding: 0; list-style: none; }
.parcours li { position: relative; padding-bottom: 18px; }
.parcours li:last-child { padding-bottom: 0; }
.parcours li:not(:last-child)::after { content: ''; position: absolute; top: 40px; bottom: 4px; left: 17px; border-left: 2px dashed var(--doux-clair); }
.p-question { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.3; }
.p-question b { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--encre); color: #fff; font-size: .95rem; }
.p-sorties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0 48px; }
.p-sortie { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--filet); border-radius: 14px; background: var(--blanc); font-size: .9rem; line-height: 1.45; }
.p-si { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--fond); font-size: .74rem; font-weight: 800; }
.p-sortie.ouvert { border-color: #F2C4C9; background: var(--rouge-clair); }
.p-sortie.ouvert .p-si { background: var(--rouge); color: #fff; }
.p-sortie.ferme { background: var(--fond); }
.p-sortie.ferme .p-si { background: var(--doux-clair); color: var(--encre); }
.p-sortie.suite { justify-content: center; border-style: dashed; color: var(--doux); }
.p-sortie.suite .p-si { background: var(--encre); color: #fff; }
@media (max-width: 560px) {
  .p-sorties { grid-template-columns: 1fr; margin-left: 0; }
  .parcours li:not(:last-child)::after { display: none; }
  .parcours li:not(:last-child) { margin-bottom: 4px; border-bottom: 1px dashed var(--filet); padding-bottom: 16px; }
  .parcours li + li { padding-top: 14px; }
}

/* Schéma : pistes sur une même échelle de jours */
.pi-axe { position: relative; height: 34px; margin: 0 0 8px; color: var(--doux); font-size: .72rem; line-height: 1.2; }
.pi-axe span { position: absolute; top: 0; text-align: center; white-space: nowrap; transform: translateX(-50%); }
.pi-axe span:first-child { text-align: left; transform: none; }
.pi-axe span:last-child { text-align: right; transform: translateX(-100%); }
.pi-axe b { display: block; color: var(--encre); font-size: .78rem; }
.pistes ol { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.pi-titre { margin: 0 0 6px; font-size: .92rem; font-weight: 800; }
.pi-barre { position: relative; height: 22px; overflow: hidden; border-radius: 8px; background: var(--fond); }
.pi-barre span { position: absolute; top: 0; bottom: 0; }
.pi-fenetre { background: var(--rouge); }
.pi-attente, .g-legende i.l-attente { background: repeating-linear-gradient(135deg, #E7E2DF 0 5px, #F3F0EE 5px 10px); }
.pi-barre em { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--encre); }
.pi-barre i { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--encre); }
.pi-resultat { margin: 6px 0 0; color: var(--doux); font-size: .88rem; line-height: 1.45; }
.pi-resultat strong { color: var(--encre); }
.g-legende i.l-marque { width: 4px; border-radius: 2px; background: var(--encre); }
.pistes .g-legende i.l-seuil { width: 0; height: 14px; border-left: 2px dashed var(--encre); border-radius: 0; }

/* Schéma : deux délais côte à côte */
.duo-cartes { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; }
.duo-carte { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--fond); }
.duo-carte strong { color: var(--rouge); font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1; letter-spacing: -.04em; }
.duo-quoi { font-weight: 800; line-height: 1.3; }
.duo-carte span:last-child { color: var(--doux); font-size: .88rem; line-height: 1.45; }
.duo-lien { align-self: center; color: var(--doux); font-size: .74rem; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 560px) { .duo-cartes { grid-template-columns: 1fr; gap: 8px; } }

/* Frise en trois étapes dans un article */
@media (min-width: 720px) { .billet .frise ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Liste des articles */
.blog-tete .chapeau { max-width: 34em; }
.blog-gages { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.blog-gages li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--blanc); font-size: .86rem; font-weight: 700; }
.blog-gages li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--rouge); }
.blog-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; margin: 0 0 clamp(28px, 4vw, 48px); padding: 0; list-style: none; }
.carte-billet { position: relative; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; height: 100%; padding: clamp(22px, 2.8vw, 30px); border-radius: 24px; background: var(--blanc); box-shadow: 0 1px 2px rgba(29, 27, 28, .06); transition: transform .2s, box-shadow .2s; }
.carte-billet:hover { box-shadow: 0 12px 32px rgba(29, 27, 28, .09); transform: translateY(-2px); }
.carte-billet:focus-within { outline: 3px solid var(--rouge); outline-offset: 3px; }
.carte-billet .etiquette { align-self: flex-start; }
body.contenu .carte-billet h2 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.2; }
.carte-billet h2 a { color: var(--encre); text-decoration: none; }
.carte-billet h2 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.carte-billet p { margin: 0; color: var(--doux); font-size: .95rem; }
.carte-billet .carte-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: auto; padding-top: 8px; font-size: .84rem; }
.carte-lire { color: var(--rouge-texte); font-weight: 800; }
@media (min-width: 900px) {
  .blog-liste .une { grid-column: 1 / -1; }
  .une .carte-billet { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 48px; padding: 40px 44px; background: var(--encre); }
  .une .carte-billet > * { grid-column: 1; }
  .une .carte-billet > p:not(.etiquette):not(.carte-meta) { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.05rem; }
  .une .carte-billet .carte-meta { grid-column: 2; }
  body.contenu .une .carte-billet h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.03em; }
  .une .carte-billet h2 a, .une .carte-billet p, .une .carte-lire { color: #fff; }
  .une .carte-billet .etiquette { justify-self: start; background: rgba(255, 255, 255, .12); color: #fff; }
}

@media (prefers-reduced-motion: no-preference) { html:has(.billet) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .carte-billet, .sommaire-billet summary::after { transition: none; } }
@media print {
  .progression, .billet-nav, .billet-suite, .barre, .pied, .cta-ligne, .partager { display: none !important; }
  .billet-texte { box-shadow: none; padding: 0; }
}
