/* ============================================================
   article.css — design v2 des articles de blog (2026-07)
   Remplace le <style> inline des articles issus de _TEMPLATE.html.
   Objectif : lisibilité (mesure, rythme vertical, hiérarchie) +
   composants manquants (prompts, tableaux, images, hr) + signature
   FIESTA (marquees, progress bar, sélection).
   Chargé via <link rel="stylesheet" href="../assets/article.css?v=YYYYMMDD">
   ⚠️ Ne change PAS la structure HTML attendue par publish.js
   (ancres TL;DR / <!-- Final CTA --> intactes).
   ============================================================ */

:root {
  --fuchsia: #EF426F;
  --teal:    #00B2A9;
  --orange:  #FF8200;
  /* échelle typo article */
  --prose-size: 17px;
  --prose-lh: 1.8;
  --prose-measure: 700px; /* ~68ch à 17px — confort de lecture */
}
[data-theme="light"] {
  --bg:      #FBF7F0; --bg-2: #F2EDE2; --surface: #FFFFFF;
  --ink:     #0A0A0A; --ink-soft: #3A3A3A; --ink-muted: #6E6E6E;
  --line:    rgba(10,10,10,.10); --line-strong: rgba(10,10,10,.18);
  --code-bg: #F4EFE6; --code-ink: #0A0A0A;
}
[data-theme="dark"] {
  --bg:      #0A0A0A; --bg-2: #141414; --surface: #141414;
  --ink:     #F4EFE6; --ink-soft: #D4D4D4; --ink-muted: #9A9A9A;
  --line:    rgba(255,255,255,.10); --line-strong: rgba(255,255,255,.22);
  --code-bg: #1A1A1A; --code-ink: #F4EFE6;
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth }
body {
  font-family: 'Archivo', sans-serif; background: var(--bg); color: var(--ink);
  line-height: 1.6; font-size: 16px; min-height: 100vh;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: .3; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .25 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .08 }

/* Sélection de texte signature */
::selection { background: var(--fuchsia); color: #FBF7F0 }

.container { max-width: 880px; margin: 0 auto; padding: 0 28px }
@media (min-width: 900px) { .container { padding: 0 48px } }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 28px }
@media (min-width: 900px) { .container-wide { padding: 0 48px } }

/* Top stripe */
.triple-stripe { display: flex; height: 6px; width: 100% }
.triple-stripe span { flex: 1 }

/* Barre de progression de lecture (remplie par article-reading.js) */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--fuchsia), var(--orange));
  z-index: 200; pointer-events: none;
  transition: width .08s linear;
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1320px; margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
@media (min-width: 900px) { .header-inner { padding: 16px 48px } }
.logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px; letter-spacing: -.02em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fuchsia) }
.back-link {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .15em; font-weight: 700; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .2s;
}
.back-link:hover { color: var(--fuchsia) }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, border-color .2s; margin-left: 16px;
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--fuchsia) }
.theme-toggle svg { width: 16px; height: 16px }
[data-theme="light"] .theme-toggle .icon-moon { display: block }
[data-theme="light"] .theme-toggle .icon-sun { display: none }
[data-theme="dark"] .theme-toggle .icon-moon { display: none }
[data-theme="dark"] .theme-toggle .icon-sun { display: block }

/* Hero (toujours sombre, couleurs FIXES — règle dark mode charte) */
.hero {
  padding: 64px 0 88px;
  background:
    radial-gradient(ellipse at 90% 20%, rgba(0,178,169,.25), transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(239,66,111,.2), transparent 55%),
    #0A0A0A;
  color: #F4EFE6;
  position: relative; overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.08);
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .2em; font-weight: 700; text-transform: uppercase;
  color: #F4EFE6; padding: 8px 14px; border-radius: 999px;
  background: rgba(10,10,10,.4); border: 1px solid rgba(255,255,255,.22);
  margin-bottom: 28px;
}
.kicker .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 10px var(--teal);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,178,169,.5) }
  70%  { box-shadow: 0 0 0 12px rgba(0,178,169,0) }
  100% { box-shadow: 0 0 0 0 rgba(0,178,169,0) }
}
.hero h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .95; letter-spacing: -.03em;
  text-transform: uppercase; color: #F4EFE6;
  margin-bottom: 24px; max-width: 820px;
}
.hero h1 em { font-style: normal; color: var(--teal) }
.hero p.hero-lead {
  font-size: 17.5px; color: #C4CED4;
  max-width: 640px; margin-bottom: 32px; line-height: 1.65;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .15em; font-weight: 700; text-transform: uppercase;
  color: #C4CED4;
}
.hero-meta-item {
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15);
}
.hero-meta-item strong { color: var(--teal); margin-right: 6px }

/* TL;DR */
.tldr {
  max-width: 880px; margin: -40px auto 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 28px 32px;
  position: relative;
  z-index: 2;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.3);
}
.tldr::before {
  content: ""; position: absolute; top: 0; left: 32px;
  height: 4px; width: 80px;
  background: linear-gradient(90deg, var(--teal), var(--fuchsia), var(--orange));
  border-radius: 4px;
}
.tldr-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .2em; font-weight: 700; text-transform: uppercase;
  color: var(--fuchsia); margin-bottom: 12px; margin-top: 8px;
}
.tldr h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 24px; letter-spacing: -.02em; text-transform: uppercase;
  margin-bottom: 16px;
}
.tldr ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px }
.tldr li {
  padding-left: 28px; position: relative; font-size: 16px; line-height: 1.6;
  color: var(--ink-soft); margin: 0;
}
.tldr li strong { color: var(--ink) }
.tldr li::before {
  content: "→"; position: absolute; left: 0; top: 0;
  color: var(--teal); font-weight: 700;
}

/* Sections */
section.block { padding: 72px 0; border-top: 1px solid var(--line) }
section.block:first-of-type { border-top: none }
.section-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .2em; font-weight: 700; text-transform: uppercase;
  margin-bottom: 20px; padding: 6px 14px; border-radius: 999px;
}
.section-kicker.k-teal    { background: rgba(0,178,169,.12);  color: var(--teal) }
.section-kicker.k-fuchsia { background: rgba(239,66,111,.12); color: var(--fuchsia) }
.section-kicker.k-orange  { background: rgba(255,130,0,.12);  color: var(--orange) }

/* Titres — H2 display identitaire, H3/H4 apaisés pour la lecture longue */
h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(27px, 3.6vw, 40px);
  line-height: 1.02; letter-spacing: -.03em; text-transform: uppercase;
  margin-bottom: 24px;
  scroll-margin-top: 96px;
}
h2 em { font-style: normal }
h2 em.teal    { color: var(--teal) }
h2 em.fuchsia { color: var(--fuchsia) }
h2 em.orange  { color: var(--orange) }
h3 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.15; letter-spacing: -.015em; text-transform: none;
  margin: 44px 0 14px;
  scroll-margin-top: 96px;
}
h3::before {
  content: "// "; color: var(--teal);
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: .82em; letter-spacing: -.05em;
}
h4 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 16.5px; letter-spacing: -.01em; text-transform: none;
  margin: 26px 0 10px;
}

/* Prose — mesure limitée pour le confort de lecture.
   Seuls les blocs de texte sont contraints ; les cards (.step, .usecase),
   tableaux et fins de section gardent la pleine largeur du container. */
p {
  font-size: var(--prose-size); line-height: var(--prose-lh); color: var(--ink-soft);
  margin-bottom: 20px;
}
section.block .container > p,
section.block .container > ul,
section.block .container > ol,
section.block .container > h3,
section.block .container > h4,
section.block .container > blockquote { max-width: var(--prose-measure) }
p strong { color: var(--ink); font-weight: 700 }
ul, ol { margin: 0 0 20px 22px; color: var(--ink-soft) }
li { margin-bottom: 10px; line-height: 1.75; font-size: var(--prose-size) }
li strong { color: var(--ink) }
a { color: var(--fuchsia); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s, text-decoration-thickness .15s }
a:hover { color: var(--orange); text-decoration-thickness: 2px }

/* Blockquote = carte prompt (les prompts copiables des articles).
   Le bouton copier est injecté par article-reading.js. */
blockquote {
  position: relative;
  margin: 4px 0 24px; padding: 20px 24px;
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--fuchsia);
  border-radius: 14px;
}
blockquote p {
  margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--ink);
}
blockquote p + p { margin-top: 10px }
blockquote em { font-style: normal } /* prompts écrits en *italique* dans le md → droits dans la carte */
blockquote .copy-btn {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .12em; font-weight: 700; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
  transition: color .15s, border-color .15s, transform .1s;
}
blockquote .copy-btn:hover { color: var(--fuchsia); border-color: var(--fuchsia) }
blockquote .copy-btn:active { transform: scale(.96) }
blockquote .copy-btn.copied { color: var(--teal); border-color: var(--teal) }
blockquote:has(.copy-btn) { padding-top: 44px }
@media (max-width: 600px) { blockquote:has(.copy-btn) { padding-top: 48px } }

/* Step cards (inchangé — identité) */
.step {
  display: flex; gap: 20px; padding: 26px 30px;
  border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line-strong);
  margin-bottom: 18px;
  transition: box-shadow .2s, border-color .2s;
}
.step:hover {
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.15);
  border-color: var(--fuchsia);
}
.step-num {
  flex-shrink: 0; width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', sans-serif; font-size: 20px; letter-spacing: -.02em;
}
.step:nth-of-type(3n+1) .step-num { background: rgba(0,178,169,.14);  color: var(--teal) }
.step:nth-of-type(3n+2) .step-num { background: rgba(239,66,111,.14); color: var(--fuchsia) }
.step:nth-of-type(3n+3) .step-num { background: rgba(255,130,0,.14);  color: var(--orange) }
.step-body { flex: 1; min-width: 0 }
.step-body h3 { margin-top: 0; margin-bottom: 8px }
.step-body h3::before { content: none }
.step-body p:last-child { margin-bottom: 0 }

/* Code */
pre {
  font-family: 'JetBrains Mono', monospace; font-size: 13.5px;
  background: var(--code-bg); color: var(--code-ink);
  padding: 16px 20px; border-radius: 12px;
  overflow-x: auto; line-height: 1.55;
  margin: 4px 0 24px;
  border: 1px solid var(--line-strong);
}
code {
  font-family: 'JetBrains Mono', monospace; font-size: .86em;
  background: var(--code-bg); padding: 2px 6px; border-radius: 4px;
  color: var(--code-ink); border: 1px solid var(--line);
}
pre code { background: transparent; padding: 0; border: none }

/* Tableaux (marked/GFM en produit dans les articles récents) */
table {
  display: block; overflow-x: auto;
  width: 100%; max-width: 100%;
  border-collapse: collapse;
  margin: 4px 0 28px;
  font-size: 15px; line-height: 1.55;
  border: 1px solid var(--line-strong); border-radius: 14px;
}
thead th {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: .12em; font-weight: 700; text-transform: uppercase;
  text-align: left; color: var(--ink);
  background: var(--bg-2);
  padding: 12px 16px; border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px; border-top: 1px solid var(--line);
  color: var(--ink-soft); vertical-align: top; min-width: 120px;
}
tbody tr:first-child td { border-top: none }
tbody td:first-child { color: var(--ink); font-weight: 600 }

/* Images de corps + légendes */
section.block img {
  max-width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px solid var(--line-strong);
  margin: 4px 0 8px;
}
figure { margin: 4px 0 24px }
figcaption, .img-caption {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  letter-spacing: .04em; color: var(--ink-muted);
  margin: 8px 0 0; line-height: 1.5;
}

/* hr = divider signature (les --- du markdown) */
hr {
  border: 0; height: 4px; width: 96px;
  margin: 56px auto;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--fuchsia), var(--orange));
}

/* Callouts */
.callout {
  padding: 22px 26px; border-radius: 16px;
  margin: 4px 0 24px; position: relative; padding-left: 54px;
}
.callout::before {
  content: ""; position: absolute;
  left: 22px; top: 26px;
  width: 16px; height: 16px; border-radius: 50%;
}
.callout.ok    { background: rgba(0,178,169,.08);  border: 1px solid rgba(0,178,169,.25) }
.callout.ok::before    { background: var(--teal) }
.callout.warn  { background: rgba(255,130,0,.08); border: 1px solid rgba(255,130,0,.25) }
.callout.warn::before  { background: var(--orange) }
.callout.tip   { background: rgba(239,66,111,.08); border: 1px solid rgba(239,66,111,.25) }
.callout.tip::before   { background: var(--fuchsia) }
.callout h4 { margin: 0 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .02em }
.callout p  { margin: 0; font-size: 15px; line-height: 1.7 }
.callout p + p { margin-top: 8px }

/* Use case box */
.usecase {
  background: linear-gradient(135deg, rgba(0,178,169,.05), rgba(239,66,111,.05));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 24px 28px;
  margin: 20px 0;
}
.usecase-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .2em; font-weight: 700; text-transform: uppercase;
  color: var(--fuchsia); margin-bottom: 12px;
}
.usecase h4 { margin-top: 0 }

/* Mini-marquee (signature FIESTA — CSS local car les articles
   n'importent pas main.css) */
.mini-marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 13px 0; background: var(--bg-2);
}
.mini-marquee-track {
  display: inline-flex; gap: 44px;
  animation: marquee 28s linear infinite;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .18em; font-weight: 700; text-transform: uppercase;
  color: var(--ink-muted);
}
.mini-marquee-track span { display: inline-flex; align-items: center; gap: 44px }
.mini-marquee-track span::after { content: "·"; color: var(--fuchsia) }
@keyframes marquee {
  from { transform: translateX(0) }
  to   { transform: translateX(-50%) }
}
@media (prefers-reduced-motion: reduce) {
  .mini-marquee-track { animation: none }
  .read-progress { transition: none }
}

/* Fin d'article (signature auteur) */
.article-end { padding: 60px 0 36px; border-top: 1px solid var(--line); background: var(--bg); }
.article-end-card {
  max-width: 720px; margin: 0 auto; display: flex; gap: 24px; align-items: flex-start;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 32px; position: relative; overflow: hidden;
}
.article-end-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--teal), var(--fuchsia) 55%, var(--orange));
}
.article-end-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-strong); flex-shrink: 0; }
.article-end-kicker { display:inline-block; font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color: var(--teal); margin-bottom: 6px; }
.article-end-title { font-size: clamp(20px,3vw,25px); line-height:1.12; margin: 0 0 10px; letter-spacing:-.02em; color: var(--ink); }
.article-end-body p { color: var(--ink-muted); font-size: 15.5px; line-height:1.65; margin: 0 0 20px; max-width: 54ch; }
.article-end-actions { display:flex; gap:12px; flex-wrap:wrap; }
.article-end-btn { display:inline-flex; align-items:center; gap:8px; padding:12px 22px; border-radius:999px; font-family:'Archivo',sans-serif; font-weight:700; font-size:14px; text-decoration:none; transition:transform .15s, background .2s, color .2s, border-color .2s; }
.article-end-btn.primary { background: var(--fuchsia); color:#fff; }
.article-end-btn.primary:hover { transform:translateY(-2px); }
.article-end-btn.ghost { background:transparent; color: var(--ink); border:1.5px solid var(--line-strong); }
.article-end-btn.ghost:hover { border-color: var(--ink); transform:translateY(-2px); }
@media (max-width:600px){ .article-end-card{ flex-direction:column; gap:18px; padding:24px; } .article-end-avatar{ width:60px; height:60px; } }

/* Footer minimal des articles (le footer riche vient de footer.css) */
.footer {
  background: var(--bg); padding: 48px 0 40px;
  border-top: 1px solid var(--line); position: relative;
}
.footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--teal) 0% 33.33%, var(--fuchsia) 33.33% 66.66%, var(--orange) 66.66% 100%);
}
.footer-bottom {
  text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .15em; font-weight: 700; text-transform: uppercase;
  color: var(--ink-muted);
}

/* Mobile */
@media (max-width: 600px) {
  :root { --prose-size: 16.5px }
  section.block { padding: 56px 0 }
  h3 { margin-top: 36px }
  .tldr { padding: 24px 22px; border-radius: 18px }
  blockquote { padding: 18px 18px }
  thead th, tbody td { padding: 10px 12px }
}
