/* =====================================================================
   ADN — Mise en page « magazine » des articles
   ---------------------------------------------------------------------
   Reprend la maquette du PDF « ADN_Article-01_IA-locale » :
   couverture à repères d'angle, sections numérotées « Réf. NN »,
   encarts punchline, blocs techniques, listes tiretées, CTA, signature.

   Les pages blanches du PDF sont remplacées par le fond quadrillé du
   back-office (voir body.mag-page ci-dessous) : même trame, même lueur
   orange, même encre. Le rendu papier reste disponible via @media print.

   Toute page qui affiche un article charge ce fichier APRÈS
   components.css. Les classes sont préfixées .mag- pour ne jamais
   entrer en collision avec le reste du site.
   ===================================================================== */

:root{
  --mag-ink:#0c0907;          /* encre du back-office */
  --mag-line:rgba(255,255,255,.10);
  --mag-line-hi:rgba(255,255,255,.18);
  --mag-body:#c9c4ba;         /* corps de texte, lecture longue */
  --mag-strong:#f4f1ec;       /* titres et gras */
  /* Largeur de la colonne de lecture — environ 68 signes à 17px.
     Exprimée en rem et non en ch : le filet d'en-tête et le pied
     tournent en petite casse machine, et 68ch les rendrait deux fois
     plus étroits que le texte. En rem, tout s'aligne au même bord. */
  --mag-max:45.5rem;
}

/* ---------------------------------------------------------------------
   1. LE FOND — quadrillage du back-office
   On neutralise le canvas, la lueur et la vidéo de fond du site : sur un
   article, rien ne doit bouger derrière le texte.
   --------------------------------------------------------------------- */
body.mag-page{
  background:
    radial-gradient(1200px 800px at 20% 42%, rgba(210,90,20,.16), rgba(120,50,12,.06) 45%, transparent 70%),
    repeating-linear-gradient(0deg,  rgba(255,255,255,.028) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 48px),
    var(--mag-ink);
  background-attachment:fixed;
}
body.mag-page #bg,
body.mag-page .glow,
body.mag-page .bg-video{display:none !important}

/* ---------------------------------------------------------------------
   2. BARRE DE PROGRESSION — le « où j'en suis » du lecteur
   Fixée tout en haut, sous le bandeau flottant (qui démarre à 16px).
   --------------------------------------------------------------------- */
.mag-progress{
  position:fixed;top:0;left:0;height:2px;width:0;z-index:60;
  background:linear-gradient(90deg,rgba(232,98,10,.35),var(--orange));
  box-shadow:0 0 12px -2px rgba(232,98,10,.8);
  transition:width .12s linear;pointer-events:none;
}
@media(prefers-reduced-motion:reduce){.mag-progress{transition:none}}

/* ---------------------------------------------------------------------
   3. LA COUVERTURE
   Repères d'angle orange, marque >_, filet de pied. Elle occupe une
   « page » entière comme dans le PDF, sans jamais dépasser l'écran.
   --------------------------------------------------------------------- */
/* Le conteneur de l'article ne subit plus la colonne de 760px de
   components.css : la couverture doit pouvoir respirer plus large que
   le corps de texte. */
.mag-article{max-width:none;margin:0}

.mag-cover{
  position:relative;
  max-width:960px;margin:0 auto 96px;
  padding:clamp(38px,7vw,86px) clamp(24px,5vw,72px);
  min-height:min(76vh,760px);
  display:flex;flex-direction:column;justify-content:space-between;gap:40px;
}
/* Les quatre repères d'angle : deux par pseudo-élément. Le <i> ne doit
   pas peser dans la colonne flex, d'où le retrait du flux. */
.mag-brk{position:absolute;inset:0;pointer-events:none}
.mag-cover::before,.mag-cover::after,
.mag-cover .mag-brk::before,.mag-cover .mag-brk::after{
  content:"";position:absolute;width:38px;height:38px;
  border:1px solid var(--orange);opacity:.75;pointer-events:none;
}
.mag-cover::before{top:0;left:0;border-right:0;border-bottom:0}
.mag-cover::after{bottom:0;right:0;border-left:0;border-top:0}
.mag-cover .mag-brk::before{top:0;right:0;border-left:0;border-bottom:0}
.mag-cover .mag-brk::after{bottom:0;left:0;border-right:0;border-top:0}

.mag-mark{
  font-family:var(--mono);font-size:1.9rem;font-weight:700;
  color:var(--orange);line-height:1;margin-bottom:14px;
}
.mag-kicker{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.28em;
  text-transform:uppercase;color:var(--faint);
}
.mag-eyebrow{
  font-family:var(--mono);font-size:.68rem;letter-spacing:.22em;
  text-transform:uppercase;color:var(--orange);margin-bottom:20px;
}
.mag-title{
  font-size:clamp(2.1rem,5.6vw,3.7rem);font-weight:800;
  letter-spacing:-.035em;line-height:1.04;color:#fff;
  margin:0 0 34px;max-width:16ch;
}
.mag-title .acc{color:var(--orange)}

.mag-chapo{
  border-left:2px solid var(--orange);padding-left:1.25rem;
  font-size:clamp(1.02rem,1.6vw,1.18rem);line-height:1.6;font-weight:500;
  color:var(--mag-strong);max-width:52ch;
}
.mag-cover-foot{
  padding-top:26px;border-top:1px solid var(--mag-line);
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
  font-family:var(--mono);font-size:.66rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--faint);
}

/* ---------------------------------------------------------------------
   4. EN-TÊTE COURANT — le filet « ARTISAN … / ARTICLE NN … » du PDF
   --------------------------------------------------------------------- */
.mag-runhead{
  max-width:var(--mag-max);margin:0 auto 44px;padding-bottom:12px;
  border-bottom:1px solid var(--mag-line);
  display:flex;justify-content:space-between;gap:16px;
  font-family:var(--mono);font-size:.62rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--faint);
}
.mag-runhead .rh-r{color:var(--muted)}

/* ---------------------------------------------------------------------
   5. LE CORPS — colonne de lecture
   --------------------------------------------------------------------- */
.mag-body{font-size:1.0625rem;line-height:1.78;color:var(--mag-body)}
.mag-body>*{max-width:var(--mag-max);margin-left:auto;margin-right:auto}
/* Les marges latérales restent en « auto » : c'est ce qui garde le
   paragraphe dans la colonne, au même bord que les titres de section. */
.mag-body p{margin:0 auto 1.35em;text-align:justify;hyphens:auto}
.mag-body strong{color:var(--mag-strong);font-weight:650}

/* Surlignage — l'orange de la marque, en fond très dilué. */
.mag-body mark{background:rgba(232,98,10,.22);color:#fff;padding:.06em .3em;border-radius:3px}

/* Alignements et paragraphe d'accroche : les seules libertés de mise en
   page laissées à la rédaction, pour rester dans la charte. */
.mag-body p.mag-c{text-align:center;hyphens:none}
.mag-body p.mag-d{text-align:right;hyphens:none}
/* Les planchers de ces deux clamp() sont volontairement au-dessus du
   corps de texte (1.0625rem) : en colonne étroite, un vw trop petit
   faisait passer le sous-titre SOUS la taille du paragraphe. */
.mag-body p.mag-lead{
  font-size:clamp(1.18rem,1.9vw,1.26rem);line-height:1.6;
  color:var(--mag-strong);font-weight:500;text-align:left;hyphens:none;
}

/* Sous-titre à l'intérieur d'une section. */
.mag-body h3.mag-h3{
  font-size:clamp(1.18rem,1.8vw,1.32rem);font-weight:700;color:#fff;
  letter-spacing:-.01em;line-height:1.3;margin:2.3rem auto .7rem;
}
.mag-body a{color:var(--orange);border-bottom:1px solid rgba(232,98,10,.4)}
.mag-body a:hover{border-bottom-color:var(--orange)}

/* Section « Réf. NN — Libellé » + filet orange court */
.mag-h2{margin:3.4rem auto 1.5rem;scroll-margin-top:110px}
.mag-h2 .ref{
  display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.22em;
  text-transform:uppercase;color:var(--orange);margin-bottom:.6rem;
}
.mag-h2 h2{
  font-size:clamp(1.35rem,2.6vw,1.75rem);line-height:1.2;letter-spacing:-.02em;
  margin:0;color:#fff;font-weight:750;
}
.mag-h2::after{content:"";display:block;width:44px;height:2px;background:var(--orange);margin-top:1rem}

/* Punchline — dans le PDF, un bloc inversé. Sur fond sombre, l'inversion
   se joue en orange : même rôle de respiration, même poids visuel. */
.mag-punch{
  margin:2.75rem auto;padding:1.6rem 1.75rem;
  background:rgba(232,98,10,.07);border:1px solid rgba(232,98,10,.28);
  font-size:clamp(1.08rem,2vw,1.3rem);line-height:1.38;font-weight:600;
  letter-spacing:-.015em;color:#fff;text-align:left;
}
.mag-punch::before{
  content:">_";display:block;font-family:var(--mono);font-size:.7rem;
  letter-spacing:.1em;color:var(--orange);margin-bottom:.75rem;font-weight:400;
}
.mag-punch em{font-style:normal;color:var(--orange)}

/* Encart technique (config machine, relevés…) */
.mag-specs{
  margin:2rem auto;padding:1.4rem 1.7rem;
  background:rgba(255,255,255,.03);border-left:2px solid var(--orange);
}
.mag-specs .lbl{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--muted);margin-bottom:.9rem;
}
.mag-specs ul{list-style:none;margin:0;padding:0;font-family:var(--mono);font-size:.88rem}
.mag-specs li{padding-left:1.1rem;position:relative;margin-bottom:.45rem;color:var(--mag-body)}
.mag-specs li:last-child{margin-bottom:0}
.mag-specs li::before{content:"\00b7";position:absolute;left:0;color:var(--orange)}

/* Liste tiretée */
.mag-body ul.mag-list{list-style:none;padding:0;margin:0 auto 1.75rem}
.mag-list li{padding-left:1.6rem;position:relative;margin-bottom:.75rem;text-align:justify}
.mag-list li::before{content:"\2014";position:absolute;left:0;color:var(--orange);font-weight:700}

/* Liste numérotée — le compteur en orange, comme les « Réf. ». */
.mag-body ol.mag-olist{list-style:none;padding:0;margin:0 auto 1.75rem;counter-reset:mag}
.mag-olist li{padding-left:2.1rem;position:relative;margin-bottom:.75rem;counter-increment:mag}
.mag-olist li::before{
  content:counter(mag,decimal-leading-zero);position:absolute;left:0;top:.12em;
  font-family:var(--mono);font-size:.78rem;color:var(--orange);letter-spacing:.06em;
}

/* Note — l'encadré neutre, quand l'orange de la punchline serait trop appuyé. */
.mag-note{
  margin:2rem auto;padding:1.25rem 1.5rem;
  background:rgba(255,255,255,.03);border:1px solid var(--mag-line);border-radius:12px;
}
.mag-note p{margin:0 0 .7em;text-align:left}
.mag-note p:last-child{margin-bottom:0}

/* Tableau — sobre, filets fins, en-tête en petite casse machine.
   L'enveloppe le fait défiler seul plutôt que déborder la page. */
.mag-table-enveloppe{margin:2rem auto;overflow-x:auto;-webkit-overflow-scrolling:touch}
table.mag-table{width:100%;border-collapse:collapse;font-size:.95rem;min-width:min(100%,420px)}
.mag-table th{
  text-align:left;padding:.7rem .9rem;border-bottom:1px solid var(--orange);
  font-family:var(--mono);font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--orange);font-weight:400;white-space:nowrap;
}
.mag-table td{padding:.7rem .9rem;border-bottom:1px solid var(--mag-line);vertical-align:top}
.mag-table tr:last-child td{border-bottom:0}
.mag-table td:first-child{color:var(--mag-strong)}

/* Bloc de code */
pre.mag-code{
  margin:2rem auto;padding:1.15rem 1.4rem;overflow-x:auto;
  background:#0a0a0c;border:1px solid var(--mag-line);border-left:2px solid var(--orange);
  border-radius:10px;
}
pre.mag-code code{font-family:var(--mono);font-size:.84rem;line-height:1.65;color:#d7d2c8;white-space:pre}
.mag-body code{
  font-family:var(--mono);font-size:.86em;padding:.1em .35em;border-radius:4px;
  background:rgba(255,255,255,.06);color:var(--mag-strong);
}
.mag-body pre.mag-code code{padding:0;background:none;border-radius:0}
.mag-body s{opacity:.6}

/* Filet de séparation entre deux moments de l'article. */
hr.mag-rule{
  border:0;height:1px;background:var(--mag-line);max-width:var(--mag-max);
  margin:3rem auto;position:relative;
}
hr.mag-rule::after{
  content:"";position:absolute;left:50%;top:-1px;width:44px;height:3px;
  background:var(--orange);transform:translateX(-50%);
}

/* Saut de page : invisible à l'écran, il n'agit qu'à l'impression. */
.mag-break{height:0}

/* Sommaire automatique */
.mag-toc{
  margin:2.5rem auto;padding:1.4rem 1.6rem;
  border:1px solid var(--mag-line);border-radius:12px;background:rgba(255,255,255,.02);
}
.mag-toc .lbl{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--orange);margin-bottom:.9rem;
}
.mag-toc ol{list-style:none;margin:0;padding:0}
.mag-toc li{margin-bottom:.5rem}
.mag-toc li:last-child{margin-bottom:0}
.mag-toc a{
  display:flex;gap:.8rem;align-items:baseline;color:var(--mag-body);
  border:0;font-size:.98rem;line-height:1.4;
}
.mag-toc a:hover{color:var(--orange)}
.mag-toc .n{font-family:var(--mono);font-size:.72rem;color:var(--orange);flex:none}

/* Citation */
.mag-body blockquote{
  border-left:2px solid var(--orange);padding:6px 0 6px 24px;margin:1.6em auto;
  font-size:1.18rem;color:var(--mag-strong);font-style:italic;
}

/* Image */
.mag-body figure{margin:2rem auto}
.mag-body figure img{width:100%;border-radius:14px;border:1px solid var(--mag-line);display:block}
.mag-body figcaption{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.06em;color:var(--faint);
  text-align:center;margin-top:.8rem;
}

/* Appel à l'action de fin */
.mag-cta{
  margin:3.5rem auto 0;padding:2rem;
  border:1px solid var(--mag-line);background:rgba(255,255,255,.02);
}
.mag-cta .lbl{
  font-family:var(--mono);font-size:.68rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--orange);margin-bottom:1rem;
}
.mag-cta p{text-align:left;margin-bottom:1em}
.mag-cta a{
  display:inline-block;margin-top:.2rem;color:#fff;font-weight:600;
  border-bottom:2px solid var(--orange);padding-bottom:2px;
}
.mag-cta a:hover{color:var(--orange)}

/* Signature */
.mag-sign{
  margin:3rem auto 0;padding-top:1.5rem;border-top:1px solid var(--mag-line);
  font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);line-height:2;
}
.mag-sign b,.mag-sign strong{color:#fff}

/* Pied de page de l'article + retour */
.mag-foot{
  max-width:var(--mag-max);margin:56px auto 0;padding-top:20px;
  border-top:1px solid var(--mag-line);
  display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;
  font-family:var(--mono);font-size:.66rem;letter-spacing:.12em;color:var(--faint);
}
.mag-back{
  font-family:var(--mono);font-size:.72rem;letter-spacing:.08em;
  color:var(--muted);cursor:pointer;background:none;border:0;padding:0;
}
.mag-back:hover{color:var(--orange)}
.mag-topback{max-width:var(--mag-max);margin:0 auto 28px}

/* ---------------------------------------------------------------------
   6. PETITS ÉCRANS — on relâche la justification, qui creuse des rivières
      dans une colonne étroite.
   --------------------------------------------------------------------- */
@media(max-width:640px){
  .mag-body p,.mag-list li{text-align:left;hyphens:none}
  .mag-cover{padding:34px 22px;min-height:auto;margin-bottom:64px}
  .mag-cover::before,.mag-cover::after,
  .mag-cover .mag-brk::before,.mag-cover .mag-brk::after{width:24px;height:24px}
  .mag-title{max-width:none}
  .mag-punch{padding:1.3rem}
  .mag-cta{padding:1.4rem}
}

/* ---------------------------------------------------------------------
   7. IMPRESSION — on retrouve le PDF : pages blanches, encre noire.
      Le quadrillage est un décor d'écran, il ne part pas à l'imprimante.
   --------------------------------------------------------------------- */
@media print{
  @page{margin:18mm 16mm}
  body.mag-page{background:#fff !important;color:#111}
  /* On vise #siteHeader et non « header » : la couverture de l'article
     est elle aussi un <header>, et un sélecteur nu l'effaçait. */
  #siteHeader,footer,.mag-progress,.mag-back,.mag-topback,.mag-foot{display:none !important}
  /* L'animation d'entrée de la vue (opacity 0 → 1) est figée en cours de
     route par le moteur d'impression : l'article sortait délavé. */
  .view.active{animation:none !important}
  .reveal{opacity:1 !important;transform:none !important;filter:none !important}
  .mag-cover{min-height:auto;page-break-after:always;color:#111}
  .mag-cover-foot,.mag-runhead{color:#666;border-color:#ddd}
  .mag-title,.mag-h2 h2,.mag-punch,.mag-sign b{color:#000 !important}
  .mag-chapo{color:#222}
  .mag-body{color:#222;font-size:10.5pt}
  .mag-body strong{color:#000}
  .mag-body h3.mag-h3,.mag-body p.mag-lead{color:#000 !important}
  /* Le surlignage doit rester lisible à l'encre noire. */
  .mag-body mark{background:#ffe1c9 !important;color:#000 !important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .mag-punch{background:#0c0907 !important;border:0;color:#fff !important;page-break-inside:avoid}
  .mag-punch,.mag-punch *{color:#fff !important}
  .mag-punch em{color:var(--orange) !important}
  /* Le saut de page ne sert qu'ici : c'est sa raison d'être. */
  .mag-break{page-break-before:always}
  .mag-note,.mag-toc{background:#f7f7f8 !important;border-color:#e2e2e4;page-break-inside:avoid}
  .mag-note p,.mag-toc a{color:#222}
  .mag-toc .lbl,.mag-toc .n{color:var(--orange)}
  table.mag-table{page-break-inside:avoid}
  .mag-table td{border-color:#ddd;color:#222}
  .mag-table td:first-child{color:#000}
  pre.mag-code{background:#f4f4f5 !important;border-color:#e2e2e4;page-break-inside:avoid}
  pre.mag-code code{color:#111}
  .mag-body code{background:#eee !important;color:#111}
  hr.mag-rule{background:#ddd}
  .mag-specs{background:#f4f4f5 !important;page-break-inside:avoid}
  .mag-specs li{color:#333}
  .mag-cta{background:#f4f4f5 !important;border-color:#e2e2e4;page-break-inside:avoid}
  .mag-cta a{color:#000}
  .mag-h2{page-break-after:avoid}
  .mag-body a{color:#000}
}
