/* =====================================================================
   Article detail — hero meta card, sticky Sommaire (desktop) + burger
   sheet (mobile), rich-text body, author bio, CTA. Editorial vocabulary:
   Instrument Serif display, JetBrains Mono meta, forest/cream. Scoped .art.
   Sommaire adapted from design summary-component/Sommaire Sticky Component.html;
   hero + author from Article Template.html.
   ===================================================================== */
.art {
  --forest-900: oklch(0.22 0.04 155);
  --forest-800: oklch(0.28 0.05 155);
  --forest-700: oklch(0.36 0.06 155);
  --forest-100: oklch(0.94 0.025 150);
  --cream-50:  oklch(0.985 0.008 95);
  --cream-100: oklch(0.965 0.012 90);
  --yellow-300: oklch(0.93 0.10 95);
  --yellow-400: oklch(0.88 0.13 95);
  --ink-900: oklch(0.18 0.012 60);
  --ink-700: oklch(0.34 0.012 60);
  --ink-500: oklch(0.52 0.012 60);
  --accent: var(--forest-700);
  --muted:   color-mix(in oklch, var(--ink-900) 52%, transparent);
  --muted-2: color-mix(in oklch, var(--ink-900) 38%, transparent);
  --line:    color-mix(in oklch, var(--ink-900) 12%, transparent);
  --surface: var(--cream-50);
  --bg-2: var(--forest-100);
  --nav-h: 4.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-round: 999px;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--font-sans);
  color: var(--ink-900);
}
.art *, .art *::before, .art *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---- hero ---- */
.art_hero { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2.5rem; align-items: end; }
.art_hero_main { min-width: 0; }
.art_tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.art_tag { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--forest-700); background: var(--forest-100); padding: 0.3rem 0.6rem; border-radius: var(--radius-round); }
.art_title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.1rem, 4.2vw, 3.2rem); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 0.7rem; }
.art_deck { font-size: 1.15rem; line-height: 1.55; color: var(--ink-700); max-width: 46ch; margin: 0; }

/* hero meta card */
.art_metacard { background: var(--bg-2); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.art_metacard_row { display: flex; align-items: center; gap: 0.7rem; }
.art_metacard_avatar { width: 2.75rem; height: 2.75rem; aspect-ratio: 1/1; border-radius: var(--radius-round); overflow: hidden; flex-shrink: 0; background: var(--cream-50); color: var(--forest-800); display: grid; place-items: center; font-family: var(--font-display); font-style: italic; }
.art_metacard_avatar img { width: 100%; height: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center top; display: block; }
.art_metacard_by { display: flex; flex-direction: column; gap: 0.1rem; }
.art_metacard_by_label { font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.art_metacard_by_name { font-weight: 500; font-size: 0.95rem; }
.art_metacard_divider { height: 1px; background: var(--line); }
.art_metacard_grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.art_metacard_cell { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.art_metacard_cell_k { font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.art_metacard_cell_v { font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

.art_cover { width: 100%; max-height: 30rem; object-fit: cover; border-radius: var(--radius-lg); margin-top: 2rem; }

/* ---- layout: sommaire + body ---- */
.art_layout { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-top: 2.5rem; }
@media (min-width: 901px) { .art_layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 4rem; align-items: start; } }
.summary_root { display: contents; }

/* desktop sticky sidebar */
.summary { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.summary_label { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.summary_count { color: var(--muted-2); }
.summary_progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 1rem; }
.summary_progress_fill { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 120ms linear; }
.summary_list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.toc_link { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.45rem 0; font-size: 0.9rem; line-height: 1.4; color: var(--muted); position: relative; transition: color 200ms var(--ease); }
.toc_link.is-sub { padding-left: 1.5rem; font-size: 0.84rem; }
.toc_num { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted-2); flex-shrink: 0; min-width: 1.4rem; transition: color 200ms var(--ease); }
.toc_link::before { content: ""; position: absolute; left: -0.85rem; top: 50%; width: 2px; height: 0; background: var(--accent); border-radius: 2px; transform: translateY(-50%); transition: height 220ms var(--ease); }
.toc_link:hover { color: var(--ink-900); }
.toc_link.is-active { color: var(--ink-900); font-weight: 500; }
.toc_link.is-active .toc_num { color: var(--accent); }
.toc_link.is-active::before { height: 1.1rem; }
.summary_actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.25rem; }
.summary_action { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0; font-size: 0.85rem; color: var(--muted); transition: color 160ms; cursor: pointer; }
.summary_action:hover { color: var(--ink-900); }
.summary_action svg { width: 1rem; aspect-ratio: 1/1; stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---- rich-text body prose (plain blocks the assembler emits) ---- */
/* Body column + all content (text and hydrated components) span the full width. */
.art_body { max-width: none; }
.article_body { font-size: 1.075rem; line-height: 1.72; color: color-mix(in oklch, var(--ink-900) 92%, transparent); }

/* ── Uniform vertical rhythm ─────────────────────────────────────────────────
   Every top-level block (paragraph, list, table, and every hydrated component
   div) gets the same generous top margin, so spacing is consistent regardless of
   each component's own injected margins. Higher specificity (.art …) wins over the
   runtime-injected component styles. */
.art .article_body > * { margin: 2.25rem 0 0; }
.art .article_body > *:first-child { margin-top: 0; }
.art .article_body > h2 { margin-top: 3.5rem; }
.art .article_body > h3 { margin-top: 2.6rem; }
.art .article_body > p + p { margin-top: 1.25rem; }
.article_body > h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; margin: 2.5rem 0 1rem; scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
.article_body > h3 { font-family: var(--font-sans); font-weight: 600; font-size: 1.2rem; line-height: 1.3; margin: 1.8rem 0 0.6rem; scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
.article_body > p { margin: 0 0 1rem; }
.article_body strong { font-weight: 600; }
.article_body em { font-style: italic; color: var(--accent); }
.article_body a { color: var(--forest-700); text-decoration: underline; text-underline-offset: 2px; }
.article_body > ol { margin: 0.75rem 0 1.25rem; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }
.article_body > ul { list-style: none; margin: 0.75rem 0 1.25rem; padding-left: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.article_body > ul > li { position: relative; padding-left: 1.2rem; line-height: 1.55; }
.article_body > ul > li::before { content: ""; position: absolute; left: 0; top: 0.62rem; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--forest-700); }
.article_body > ol > li { line-height: 1.55; }

/* mobile sommaire elements hidden on desktop */
.summary_bar, .summary_scrim, .summary_sheet { display: none; }

@media (max-width: 900px) {
  .art_hero { grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
  .art_layout { display: block; }          /* block flow so the sticky bar can't widen a grid track */
  .summary { display: none; }
  .art_body { max-width: none; }

  .summary_bar { display: block; position: sticky; top: calc(var(--nav-h) + 0.5rem); z-index: 40; background: color-mix(in oklch, var(--surface) 90%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: var(--radius-round); margin-bottom: 1.5rem; box-shadow: 0 0.375rem 1.25rem -0.625rem color-mix(in oklch, var(--accent) 40%, transparent); }
  .summary_bar_inner { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.6rem 0.6rem 1.1rem; }
  .summary_bar_meta { flex: 1; min-width: 0; }
  .summary_bar_k { font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
  .summary_bar_cur { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .summary_bar_cur .n { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); flex-shrink: 0; }
  .summary_bar_cur .t { overflow: hidden; text-overflow: ellipsis; }
  .summary_burger { flex-shrink: 0; width: 2.6rem; aspect-ratio: 1/1; border-radius: var(--radius-round); background: var(--accent); color: var(--cream-50); display: grid; place-items: center; border: 0; cursor: pointer; }
  .summary_burger svg { width: 1.2rem; aspect-ratio: 1/1; }
  .summary_burger .ico-close { display: none; }
  .summary_bar_progress { position: absolute; left: 1.1rem; right: 1.1rem; bottom: -1px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
  .summary_bar_progress_fill { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 120ms linear; }

  .summary_scrim { display: block; position: fixed; inset: 0; z-index: 45; background: color-mix(in oklch, var(--accent) 22%, transparent); opacity: 0; visibility: hidden; transition: opacity 240ms var(--ease), visibility 240ms; }
  .summary_sheet { display: block; position: fixed; left: 0; right: 0; top: var(--nav-h); z-index: 55; margin: 0.75rem clamp(0.75rem, 4vw, 1.5rem) 0; max-height: calc(100dvh - var(--nav-h) - 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1.5rem 3.75rem -1rem color-mix(in oklch, var(--accent) 45%, transparent); overflow: auto; transform: translateY(-12px) scale(0.98); transform-origin: top right; opacity: 0; visibility: hidden; transition: opacity 240ms var(--ease), transform 260ms var(--ease), visibility 260ms; }
  .summary_sheet_head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .summary_sheet_head .l { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
  .summary_burger--close { width: 2.1rem; background: var(--bg-2); color: var(--accent); }
  .summary_burger--close svg { width: 1.05rem; }
  .summary_sheet_body { padding: 0.5rem 1.25rem 1.25rem; }
  .summary_sheet .summary_list { gap: 0; }
  .summary_sheet .toc_link { padding: 0.7rem 0; font-size: 1rem; border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent); }
  .summary_sheet .toc_link::before { display: none; }
  .summary_sheet .toc_link.is-active { color: var(--accent); }

  body.sheet-open { overflow: hidden; }
  .summary_root.is-open .summary_scrim { opacity: 1; visibility: visible; }
  .summary_root.is-open .summary_sheet { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
  .summary_root.is-open .summary_burger .ico-menu { display: none; }
  .summary_root.is-open .summary_burger .ico-close { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .summary_scrim, .summary_sheet, .toc_link, .toc_link::before, .summary_progress_fill, .summary_bar_progress_fill { transition: none !important; }
}

/* ---- author bio "— À propos de l'auteur" (design: Author Bio Section.html) ---- */
.art_author { margin: 3.5rem auto 0; max-width: 44rem; }
.art_author_layout { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 2.25rem; align-items: start; padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.art_author_visual { width: 100%; }
.art_author_img { width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-lg); overflow: hidden; background: var(--forest-100); }
.art_author_img img { width: 100%; height: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center top; display: block; }
.art_author_content { min-width: 0; }
.art_author_label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.art_author_name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; margin: 0 0 0.5rem; }
.art_author_role { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--forest-700); margin: 0 0 1rem; }
.art_author_bio { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-700); margin: 0 0 1.5rem; max-width: 56ch; }
.art_author_links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.art_author_link { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--radius-round); border: 1px solid var(--line); font-size: 0.875rem; color: var(--forest-800); text-decoration: none; transition: background 200ms var(--ease), border-color 200ms var(--ease); }
.art_author_link:hover { background: var(--forest-100); border-color: var(--forest-200); }
@media (max-width: 560px) {
  .art_author_layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .art_author_visual { max-width: 7rem; }
}

/* ---- CTA belt ---- */
.art_cta { margin: 3rem auto 0; max-width: 44rem; padding: 2rem; border-radius: var(--radius-lg); background: var(--forest-900); color: var(--cream-100); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.art_cta_title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.art_cta_title em { font-style: italic; color: var(--yellow-300); }
.art_cta_btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; border-radius: var(--radius-round); background: var(--yellow-400); color: var(--forest-900); font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform 160ms var(--ease); }
.art_cta_btn:hover { transform: translateX(2px); }
