/*
 * Blog et lives cliniques : chargé en plus de site.css par ces pages seulement (champ "styles" du
 * bloc de la page, build-blog.mjs). Variables, boutons, FAQ et appel final viennent de site.css.
 * Lecture : une colonne d'environ 70 caractères, corps à 18 px, interligne large — un public de
 * cliniciens qui lit sur ordinateur comme sur téléphone.
 */

/* ── Cartes (index du blog, « À lire aussi ») ─────────────────────────── */

.post-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post-card { min-width: 0; display: grid; }
.post-card__link {
  display: grid; grid-template-rows: auto 1fr; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  color: inherit; text-decoration: none;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.post-card__link:hover { color: inherit; border-color: rgba(108, 99, 255, 0.45); box-shadow: var(--shadow-s); transform: translateY(-2px); }
.post-card__link:focus-visible { border-radius: var(--radius-l); }
/* Carrées comme les illustrations : leur titre est écrit en haut, un recadrage le couperait. */
.post-card__media { display: block; aspect-ratio: 1; background: var(--mist); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
/* Les visuels des lives sont des affiches en largeur, texte compris : jamais recadrés. */
.post-card__text { display: grid; gap: 10px; align-content: start; padding: 20px 22px 26px; min-width: 0; }
.post-card__meta { font-size: 0.875rem; color: var(--ink-3); }
.post-card__title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.28;
  letter-spacing: -0.015em; color: var(--ink);
}
.post-card__link:hover .post-card__title { color: var(--violet-ink); }
.post-card__lead {
  color: var(--ink-3); font-size: 0.975rem; line-height: 1.58;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

.blog-hero .page-hero__inner { max-width: 760px; }
.blog-lives .section-head { margin-bottom: clamp(24px, 4vw, 40px); }

/* ── En-tête d'un article ou d'un live ────────────────────────────────── */

.post-hero { position: relative; isolation: isolate; padding-block: clamp(28px, 5vw, 72px) clamp(36px, 5vw, 64px); }
.post-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 70% at 85% 10%, rgba(108, 99, 255, 0.12), transparent 70%), radial-gradient(30% 50% at 0% 80%, rgba(237, 128, 134, 0.1), transparent 70%);
}
.post-hero__grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 1000px) { .post-hero__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); } }
.post-hero__text { display: grid; gap: 18px; justify-items: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.post-hero h1 { font-size: clamp(1.95rem, 1.3rem + 2.3vw, 3rem); line-height: 1.12; letter-spacing: -0.028em; overflow-wrap: break-word; }
.post-hero__lead { max-width: 40em; }
.post-back {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  font-weight: 600; font-size: 0.9375rem; color: var(--violet-ink); text-decoration: none;
}
.post-back .i { transition: transform 0.2s var(--ease); }
.post-back:hover .i { transform: translateX(-3px); }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; color: var(--ink-3); font-size: 0.9375rem; }
.post-meta > span, p.post-meta { display: inline-flex; align-items: center; gap: 8px; }
.post-meta .i { color: var(--violet); }
.post-meta__author strong { color: var(--ink); font-weight: 650; }
.post-meta__photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }

.post-cover {
  margin: 0; width: 100%; max-width: 460px; justify-self: center;
  border-radius: var(--radius-l); overflow: hidden; background: var(--mist); box-shadow: var(--shadow);
}
.post-cover img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.post-cover--wide { max-width: 560px; }
.post-cover--wide img { aspect-ratio: auto; }
@media (max-width: 999px) { .post-cover { justify-self: start; max-width: 420px; } .post-cover--wide { max-width: 560px; } }

/* ── Corps ────────────────────────────────────────────────────────────── */

.post-main { display: grid; gap: 32px; padding-bottom: clamp(64px, 8vw, 104px); }
.post-main > * { width: 100%; max-width: 720px; margin-inline: auto; min-width: 0; }
@media (min-width: 1100px) {
  .post-main { grid-template-columns: 250px minmax(0, 720px); gap: 64px; justify-content: center; align-items: start; }
  .post-main > * { margin-inline: 0; }
  .post-main--single { grid-template-columns: minmax(0, 720px); }
  .post-toc { position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; }
}

.post-body { font-size: 1.125rem; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.post-body > * { margin: 0; max-width: 70ch; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 {
  margin-top: 2.1em; font-size: clamp(1.5rem, 1.25rem + 0.9vw, 1.95rem); line-height: 1.22; letter-spacing: -0.02em;
}
.post-body h3 { margin-top: 1.8em; font-size: 1.28rem; line-height: 1.32; }
.post-body h4 { margin-top: 1.5em; font-size: 1.125rem; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: 0.65em; }
.post-body h2, .post-body h3 { scroll-margin-top: calc(var(--nav-h) + 24px); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li, .post-body li > ul, .post-body li > ol { margin-top: 0.5em; }
.post-body li::marker { color: var(--violet); }
.post-body strong { color: var(--ink); font-weight: 650; }
.post-body a { text-decoration-color: rgba(70, 61, 208, 0.4); }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body blockquote { padding: 2px 0 2px 20px; border-left: 3px solid var(--violet-150); color: var(--ink); }

/* ── Sommaire ─────────────────────────────────────────────────────────── */

.post-toc { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; font-size: 0.9375rem; }
.post-toc__title {
  margin-bottom: 12px; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.11em; text-transform: uppercase; color: var(--violet-ink);
}
.post-toc ol { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.post-toc li::marker { color: var(--ink-3); }
.post-toc a { color: var(--ink-2); text-decoration: none; line-height: 1.42; }
.post-toc a:hover { color: var(--violet-ink); text-decoration: underline; }

/* ── Questions fréquentes, articles liés ──────────────────────────────── */

.post-faq .faq__a { font-size: 1.0625rem; line-height: 1.7; }
.post-related__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px;
  margin-bottom: clamp(24px, 4vw, 40px);
}
