/* Crise cardiaque : direction artistique A « Papier ECG ».
   Tokens : papier, quadrillage, encre, rouge tracé, vert pouls, gris. Une seule animation : le tracé ECG sous l'en-tête.
   Contrastes AA vérifiés par scripts/contraste.py. Règles : le vert et le gris ne portent JAMAIS de texte sur le quadrillage. */
:root {
  --papier: #FAF3F1;
  --quadrillage: #EFCFCA;
  --encre: #241A1C;
  --rouge: #B3142B;
  --vert: #2E7A68;
  --gris: #6E6466;
  --blanc: #FFFFFF;
  --f-corps: var(--f-texte), system-ui, sans-serif;
  --f-tit: var(--f-titre), Georgia, serif;
  --bande: 34px;
  --mesure: 37.5rem;
  --large: 72rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bande) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; padding-top: var(--bande); background: var(--papier); color: var(--encre); font-family: var(--f-corps); font-size: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem); line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rouge); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-tit); color: var(--encre); margin: 0; }
.skip { position: absolute; left: -999px; top: calc(var(--bande) + 4px); background: var(--encre); color: var(--papier); padding: 0.6rem 1rem; z-index: 60; }
.skip:focus { left: 8px; }
.container { width: min(var(--large), 100% - 2rem); margin-inline: auto; }
.container--read { width: min(var(--mesure), 100% - 2rem); }

/* Bandeau d'urgence : fixe, discret, texte blanc sur rouge (6,88:1), 34 px de haut */
.urgence-band { position: fixed; inset: 0 0 auto 0; height: var(--bande); background: var(--rouge); color: var(--blanc); z-index: 50; }
.urgence-band__lien { display: flex; align-items: center; justify-content: center; gap: 0.9rem; height: 100%; padding-inline: 1rem; color: var(--blanc); text-decoration: none; font-size: 0.9375rem; line-height: 1; white-space: nowrap; }
.urgence-band__lien { margin: 0; }
.urgence-band__lien a { color: var(--blanc); font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; padding: 0.6rem 0.25rem; }
.urgence-band__lien a:hover { color: var(--blanc); text-decoration-thickness: 2px; }
.urgence-band__lien a:focus-visible { outline: 2px solid var(--blanc); outline-offset: 2px; }
.urgence-band__aide { font-weight: 400; }
@media (max-width: 40rem) { .urgence-band__aide { display: none; } }

/* En-tête, navigation, tracé ECG */
.site-header { background: var(--papier); }
.site-header__inner { width: min(var(--large), 100% - 2rem); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; padding-block: 0.9rem 0.4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--encre); }
.brand:hover { color: var(--encre); }
.brand__mark { flex: none; width: 40px; height: 40px; }
.article-body { overflow-wrap: break-word; }
.page--pilier, .page--article { position: relative; }
.glossaire__note { max-width: var(--mesure); margin: 0 0 2rem; padding: 0.9rem 1.2rem; border-left: 4px solid var(--rouge); background: var(--quadrillage); color: var(--encre); font-style: normal; }
.glossaire__note p { margin: 0; }
.toc--lettres ul { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; }
.brand__name { font-family: var(--f-tit); font-weight: 700; font-size: 1.65rem; letter-spacing: -0.01em; }
.nav-toggle { display: none; background: none; border: 2px solid var(--encre); color: var(--encre); font: inherit; font-weight: 600; padding: 0.35rem 0.9rem; border-radius: 4px; cursor: pointer; }
.site-nav { width: min(var(--large), 100% - 2rem); margin-inline: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0.2rem 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.site-nav a { display: inline-block; padding: 0.3rem 0; color: var(--encre); text-decoration: none; font-weight: 600; font-size: 0.9375rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--encre); color: var(--encre); }
.site-nav a[aria-current] { color: var(--rouge); border-bottom-color: var(--rouge); }
@media (max-width: 56rem) {
  .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding-bottom: 0.8rem; }
  .site-nav a { padding: 0.6rem 0; font-size: 1.0625rem; }
}
.ecg { height: 40px; width: 100%; overflow: hidden; }
.ecg svg { width: 100%; min-width: 100%; height: 100%; display: block; }
.ecg__trace { fill: none; stroke: var(--rouge); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: trace 1.8s ease-out 0.1s both; }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .ecg__trace { animation: none; stroke-dasharray: none; } }

/* Gabarits d'images (REGLE 14) */
.img-hero { width: 100%; aspect-ratio: 9 / 4; overflow: hidden; background: var(--quadrillage); }
.img-card, .img-body { aspect-ratio: 3 / 2; overflow: hidden; background: var(--quadrillage); }
.img-hero img, .img-card img, .img-body img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.herofig { margin: 0; width: 100%; max-width: none; }
.img-hero { max-width: none; }
.fig { margin: 2rem 0; }
.fig figcaption { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.45; color: var(--gris); }

/* Bande de titre sous le hero : fond quadrillé, texte en encre (le gris est interdit sur le quadrillage) */
.titre-bande { background: var(--quadrillage) url('/css/grille.svg') 0 0 / 40px 40px; padding-block: 1.6rem 1.7rem; color: var(--encre); }
.titre-bande h1 { font-weight: 700; font-size: clamp(2rem, 1.35rem + 2.7vw, 3.1rem); line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; }
.titre-bande .chapeau { margin: 0.9rem 0 0; font-size: 1.1875rem; line-height: 1.55; max-width: 38rem; }
.titre-bande a:not(.btn) { color: var(--encre); }
.titre-bande--accueil .container { display: block; }
.actions { margin: 1.3rem 0 0; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.page__meta { margin: 0.9rem 0 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; font-size: 0.9375rem; line-height: 1.4; color: var(--encre); }
.page__meta .cat { font-weight: 700; }
.crumbs ol { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 0.5rem; font-size: 0.9rem; }
.crumbs li + li::before { content: '/'; margin-right: 0.5rem; }
.crumbs a { color: var(--encre); }
.btn { display: inline-block; background: var(--rouge); color: var(--blanc); font: inherit; font-weight: 700; padding: 0.65rem 1.3rem; border: 2px solid var(--rouge); border-radius: 4px; text-decoration: none; cursor: pointer; }
.btn, .btn:visited { color: var(--blanc); }
.btn:hover { background: var(--encre); border-color: var(--encre); color: var(--papier); }
.btn--sec { background: transparent; color: var(--encre); border-color: var(--encre); }
.btn--sec:hover { background: var(--encre); color: var(--papier); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* Pages et texte courant */
.page { padding-block: 2.2rem 4rem; }
.bloc { margin-block: 3rem; }
.bloc > h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.2; margin-bottom: 1.2rem; }
.prose { max-width: var(--mesure); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h2 { font-size: 1.65rem; font-weight: 600; line-height: 1.22; margin: 2.4em 0 0.6em; text-wrap: balance; }
.prose h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin: 1.9em 0 0.5em; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.35em 0; }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 1.8rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 4px solid var(--rouge); font-family: var(--f-tit); font-style: italic; font-size: 1.15rem; }
.prose blockquote p { margin: 0; }
.table-scroll { overflow-x: auto; margin: 1.6rem 0; }
.table-scroll:focus-visible { outline: 3px solid var(--encre); }
.prose table { border-collapse: collapse; min-width: 32rem; width: 100%; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--gris); vertical-align: top; }
.prose th { font-family: var(--f-tit); font-weight: 700; border-bottom: 2px solid var(--encre); }
.table-scroll { border: 1px solid var(--gris); }
.prose th + th, .prose td + td { border-left: 1px solid var(--gris); }
.prose tbody tr:nth-child(even) { background: var(--quadrillage); }

/* Sommaire, FAQ, sources, méthode */
.toc, .toc-box, .article-toc { max-width: var(--mesure); margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px solid var(--gris); }
.toc__titre { margin: 0 0 0.4rem; font-family: var(--f-tit); font-weight: 700; font-size: 1.1rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.25rem 0; }
.faq { max-width: var(--mesure); margin-top: 3rem; }
.faq h2, .sources h2, .methode h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.8rem; }
.faq__item { border-top: 1px solid var(--gris); padding: 0.2rem 0; }
.faq__item:last-of-type { border-bottom: 1px solid var(--gris); }
.faq__item summary { cursor: pointer; font-family: var(--f-tit); font-weight: 600; font-size: 1.1rem; padding: 0.7rem 2rem 0.7rem 0; position: relative; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; position: absolute; right: 0.2rem; top: 0.5rem; font-size: 1.5rem; line-height: 1; color: var(--rouge); }
.faq__item[open] summary::after { content: '\2212'; }
.faq__item p { margin: 0 0 0.9rem; }
.sources { max-width: var(--mesure); margin-top: 3rem; font-size: 0.97rem; }
.sources ul { padding-left: 1.2rem; }
.sources__verif { color: var(--gris); font-size: 0.9rem; }
.methode { max-width: var(--mesure); border-top: 2px solid var(--encre); padding-top: 1.4rem; margin-block: 3rem 0; }

/* Encadrés sur fond quadrillé : texte en encre, vert et gris interdits en texte sur ce fond */
.encadre { display: flex; gap: 0.9rem; align-items: flex-start; margin: 1.8rem 0; padding: 1.1rem 1.3rem; background: var(--quadrillage) url('/css/grille.svg') 0 0 / 40px 40px; border-left: 5px solid var(--encre); color: var(--encre); max-width: var(--mesure); }
.page > .encadre, .bloc .encadre, .container > .encadre { max-width: none; }
.encadre__corps { min-width: 0; flex: 1; }
.encadre__corps > :last-child { margin-bottom: 0; }
.encadre__titre { margin: 0 0 0.35rem; font-family: var(--f-tit); font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.encadre p { margin: 0 0 0.6em; }
.encadre__note { font-size: 0.9rem; }
.encadre__picto { flex: none; margin-top: 0.1rem; }
.encadre--urgence { border-left-color: var(--rouge); }
.encadre--urgence .encadre__picto { color: var(--rouge); }
.encadre--afaire { border-left-color: var(--vert); }
.encadre--afaire .encadre__picto { color: var(--vert); }
.encadre--sources { border-left-color: var(--gris); }
.encadre--francophonie { border-left-color: var(--encre); }
.encadre a:not(.btn) { color: var(--encre); }
.urgences { margin: 0 0 0.6rem; display: grid; gap: 0.35rem; }
.urgences__ligne { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.5rem; }
.urgences dt { font-weight: 700; }
.urgences dd { margin: 0; }
.encadre-inline { margin: 0 0 1.6rem; padding: 0.9rem 1.1rem; background: var(--quadrillage) url('/css/grille.svg') 0 0 / 40px 40px; border-left: 5px solid var(--rouge); }

/* Étapes numérotées : UNIQUEMENT les vraies séquences de gestes */
.etapes { margin: 1.8rem 0; }
.etapes__titre { margin: 0 0 0.6rem; font-family: var(--f-tit); font-weight: 700; font-size: 1.2rem; }
.prose .etapes__liste, .etapes__liste { list-style: none; counter-reset: etape; margin: 0; padding: 0; }
.prose .etapes__liste li, .etapes__liste li { counter-increment: etape; position: relative; margin: 0; padding: 0.9rem 0 0.9rem 3.4rem; border-top: 1px solid var(--gris); min-height: 3.6rem; }
.etapes__liste li:last-child { border-bottom: 1px solid var(--gris); }
.etapes__liste li::before { content: counter(etape); position: absolute; left: 0; top: 0.85rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--rouge); color: var(--blanc); font-family: var(--f-tit); font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; }

/* Grille de cards chronologiques */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2rem 1.6rem; }
.card[hidden] { display: none; }
.card__lien { display: block; color: var(--encre); text-decoration: none; height: 100%; }
.card__lien:hover { color: var(--encre); }
.card__corps { padding: 0.8rem 0 0; }
.card__cat { margin: 0; line-height: 1.3; font-size: 0.9rem; font-weight: 700; color: var(--rouge); }
.card__titre { margin: 0.25rem 0 0.4rem; font-weight: 600; font-size: 1.2rem; line-height: 1.28; }
.card__lien:hover .card__titre { text-decoration: underline; text-decoration-color: var(--rouge); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.card__date { margin: 0; font-size: 0.9rem; color: var(--gris); }
.rubriques { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 2rem; }
.rubriques li { border-top: 2px solid var(--encre); }
.rubriques a { display: block; padding: 0.9rem 0 1.2rem; color: var(--encre); text-decoration: none; }
.rubriques a strong { display: block; font-family: var(--f-tit); font-size: 1.3rem; font-weight: 700; }
.rubriques a:hover strong { color: var(--rouge); }
.rubriques span { font-size: 0.97rem; }

/* Filtre du blog */
.filtre { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.filtre__btn { display: inline-block; padding: 0.4rem 0.95rem; border: 1.5px solid var(--encre); border-radius: 999px; color: var(--encre); text-decoration: none; font-size: 0.9375rem; font-weight: 600; }
.filtre__btn:hover { background: var(--quadrillage); color: var(--encre); }
.filtre__btn[aria-current='page'] { background: var(--encre); color: var(--papier); }

/* Glossaire */
.glossaire__item { padding: 0.9rem 0; border-top: 1px solid var(--gris); }
.glossaire dt { font-family: var(--f-tit); font-weight: 700; font-size: 1.15rem; }
.glossaire dd { margin: 0.2rem 0 0; }

/* Formulaire de contact */
.contact { max-width: var(--mesure); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--encre); background: var(--blanc); border: 1.5px solid var(--gris); border-radius: 4px; padding: 0.6rem 0.75rem; }
.field--piege { position: absolute; left: -9999px; }
.contact__etat { min-height: 1.5em; margin-top: 0.8rem; font-weight: 600; }
.contact__etat[data-ok='1'] { color: var(--vert); }
.contact__etat[data-ok='0'] { color: var(--rouge); }

/* Pied de page */
.site-footer { background: var(--encre); color: var(--papier); padding-block: 2.6rem 1.4rem; margin-top: 3rem; }
.site-footer a { color: var(--papier); }
.site-footer a:hover { color: var(--blanc); }
.site-footer__grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 48rem) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__marque { font-family: var(--f-tit); font-weight: 700; font-size: 1.5rem; margin: 0 0 0.4rem; }
.site-footer__titre { font-family: var(--f-tit); font-weight: 700; margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }
.site-footer p { margin: 0 0 0.6rem; }
.site-footer__urgence { border-left: 4px solid var(--papier); padding-left: 0.8rem; }
.site-footer__bas { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--gris); font-size: 0.9rem; }
.site-footer :focus-visible { outline-color: var(--papier); }

/* Largeur : pages larges (blog) sans la mesure de lecture ; hero mobile en 3:2 natif (tête entière) */
.container:not(.container--read) > .prose { max-width: none; }
@media (max-width: 40rem) { .img-hero { width: 100%; aspect-ratio: 3 / 2; } }

/* Cartes : extrait et lien de lecture */
.card__extrait { margin: 0.45rem 0 0; font-size: 0.95rem; line-height: 1.5; }
.card__lire { margin: 0.5rem 0 0; font-weight: 700; font-size: 0.95rem; color: var(--rouge); }
.card__lien:hover .card__lire { text-decoration: underline; text-underline-offset: 0.2em; }
/* Résumé d'article et lecture suivante */
.article-summary, .summary-box { max-width: var(--mesure); margin: 0 0 1.6rem; padding: 0.9rem 1.1rem; background: var(--quadrillage) url('/css/grille.svg') 0 0 / 40px 40px; border-left: 5px solid var(--gris); }
.article-summary p { margin: 0; font-style: italic; line-height: 1.55; }
.article-nav-related { max-width: var(--mesure); margin: 2.2rem 0 0; padding: 1rem 1.2rem; border: 1px solid var(--gris); }
.article-nav-related h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.article-nav-related ul { margin: 0; padding-left: 1.2rem; }
.article-nav-related li { margin: 0.3rem 0; }
.interview-expert-card { border-left-color: var(--encre); }
.encadre--expert .encadre__titre { font-size: 1.05rem; }
