/* ═══════════════════════════════════════════════════════════════
   LE GABARIT DES ARTICLES DU JOURNAL (15/10/2026)
   Chargé sur chaque blog-*.html (scripts/batir.py, ARTICLE_CSS), après
   thomax.css. Aucun article n'est réécrit : tout part du balisage
   commun (.ouverture, .article-couv, .article-corps, #suite) ; les
   éléments construits par js/v4/article.js (progression, sommaire,
   auteur, partage, encart d'appel) sont préfixés .ar-.
   Une lecture de magazine : une colonne à la mesure de l'œil, un
   sommaire dans la marge, et rien qui bouge sans raison.
   ═══════════════════════════════════════════════════════════════ */

/* ─── L'ouverture ─── */
.article-titre { max-width: 22ch; margin-inline: auto; text-wrap: balance; }
.ouverture .cadre-lis { max-width: 80ch; }
.ouverture .ouverture-lead { max-width: 58ch; margin-inline: auto; color: var(--encre-2); text-wrap: pretty; }
.ouverture .donnee-ouverture { letter-spacing: 0.14em; }
.ouverture .retour { padding: 6px 12px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--trait); transition: box-shadow var(--net) ease, color var(--net) ease; }
.ouverture .retour:hover { color: var(--encre); box-shadow: inset 0 0 0 1px var(--or); }

/* ─── La couverture : plus large que le texte, posée comme une planche ─── */
.article-couv .cadre-lis { max-width: min(1080px, 100%); }
.article-couv img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r4);
  box-shadow: 0 0 0 1px var(--trait-fin), 0 40px 80px -48px rgba(0, 0, 0, 0.45);
}
.article-couv { border-radius: 0; overflow: visible; }

/* ─── Le corps : une colonne de lecture ─── */
.article-corps-plan { position: relative; padding-block: var(--e8) var(--e9); }
.article-corps {
  max-width: 68ch;
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--encre-2);
  text-wrap: pretty;
}
.article-corps > * + * { margin-top: 1.15em; }
/* Le chapeau : le premier paragraphe se lit comme une entrée en matière. */
.article-corps > p:first-of-type {
  font-size: 1.375rem;
  line-height: 1.6;
  color: var(--encre);
}
.article-corps strong { color: var(--encre); font-weight: 600; }
.article-corps em { font-style: italic; }

/* Les intertitres : un filet d'or au-dessus, et de l'air. */
.article-corps h2 {
  position: relative;
  margin-top: 2.4em;
  padding-top: 0.9em;
  font-size: clamp(1.45rem, 2.2vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--encre);
  scroll-margin-top: 110px;
  text-wrap: balance;
}
.article-corps h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 40px; height: 2px;
  border-radius: 2px;
  background: var(--or);
}
.article-corps h2 + * { margin-top: 0.8em; }
.article-corps h3 { margin-top: 1.8em; font-size: 1.3rem; color: var(--encre); scroll-margin-top: 110px; }

/* Les listes : un losange d'or plutôt qu'une puce. */
.article-corps ul, .article-corps ol { display: grid; gap: 0.7em; padding-left: 0; list-style: none; }
.article-corps ul > li { position: relative; padding-left: 1.6em; }
.article-corps ul > li::before {
  content: '';
  position: absolute;
  left: 0.2em; top: 0.68em;
  width: 7px; height: 7px;
  background: var(--or);
  transform: rotate(45deg);
}
.article-corps ol { counter-reset: ar-ol; }
.article-corps ol > li { position: relative; padding-left: 2.2em; counter-increment: ar-ol; }
.article-corps ol > li::before {
  content: counter(ar-ol, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0.1em;
  color: var(--or-lisible);
  font-size: 0.8em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Les citations */
.article-corps blockquote {
  position: relative;
  margin-block: 1.8em;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--or);
  color: var(--encre);
  font-size: 1.375rem;
  line-height: 1.5;
}
.article-corps blockquote p { margin: 0; }

/* Le code en ligne */
.article-corps code {
  padding: 0.08em 0.4em;
  border-radius: 6px;
  background: rgba(209, 163, 38, 0.12);
  color: var(--encre);
  font: 0.86em/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  white-space: break-spaces;
}

/* Les liens : soulignés d'or, l'or se pose au survol. */
.article-corps a:not(.bouton):not(.ar-bouton) {
  color: var(--encre);
  text-decoration: underline;
  text-decoration-color: var(--or);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: background-color var(--net) ease, text-decoration-color var(--net) ease;
}
.article-corps a:not(.bouton):not(.ar-bouton):hover { background: rgba(209, 163, 38, 0.14); }
/* Le lien seul en fin d'article devient un appel. */
.article-corps .ar-lien-final {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 99px;
  background: var(--noir);
  color: var(--sur-noir) !important;
  text-decoration: none !important;
  font-size: var(--p-3);
  font-weight: 500;
  transition: transform var(--pose) var(--ressort), box-shadow var(--pose) ease;
}
.article-corps .ar-lien-final::after { content: '→'; color: var(--or); transition: transform var(--pose) var(--ressort); }
.article-corps .ar-lien-final:hover { background: var(--noir); transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.6); }
.article-corps .ar-lien-final:hover::after { transform: translateX(3px); }

/* ─── La progression de lecture ─── */
.ar-progression {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: 3px;
  background: var(--or);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* ─── Le sommaire ───
   Sur grand écran : dans la marge gauche, fixé pendant la lecture, la
   section en cours soulignée d'or. Il est posé en absolu dans la marge
   pour que l'article ne bouge pas d'un pixel à son arrivée. Sur petit
   écran : un volet repliable en tête de l'article. */
.ar-sommaire { display: none; }
.ar-sommaire-titre { margin: 0 0 12px; color: var(--encre-3); font-size: var(--micro); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.ar-sommaire ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: ar-som; }
.ar-sommaire li { counter-increment: ar-som; }
.ar-sommaire li > a {
  display: grid;
  grid-template-columns: 2.1em minmax(0, 1fr);
  gap: 4px;
  padding: 7px 10px 7px 0;
  border-left: 2px solid var(--trait);
  padding-left: 12px;
  color: var(--encre-3);
  font-size: var(--p-4);
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--net) ease, border-color var(--net) ease;
}
.ar-sommaire li > a::before { content: counter(ar-som, decimal-leading-zero); color: var(--or-lisible); font-size: 0.85em; font-variant-numeric: tabular-nums; padding-top: 1px; }
.ar-sommaire li > a:hover { color: var(--encre); }
.ar-sommaire li > a.est-actif { color: var(--encre); border-left-color: var(--or); font-weight: 500; }

@media (min-width: 1240px) {
  .ar-sommaire--marge {
    display: block;
    position: absolute;
    top: var(--e8);
    bottom: var(--e9);
    left: max(var(--gouttiere), calc(50% - 34ch - 290px));
    width: 230px;
  }
  .ar-sommaire--marge .ar-sommaire-colle { position: sticky; top: 120px; }
  .ar-sommaire--marge .ar-partage { margin-top: var(--e6); }
}
@media (max-width: 1239px) {
  .ar-sommaire--volet { display: block; margin-bottom: 1.6em; border-radius: 16px; background: var(--carte); box-shadow: inset 0 0 0 1px var(--trait); }
  .ar-sommaire--volet summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-size: var(--p-3);
    font-weight: 500;
    color: var(--encre);
  }
  .ar-sommaire--volet summary::-webkit-details-marker { display: none; }
  .ar-sommaire--volet summary::after { content: ''; width: 9px; height: 9px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform var(--pose) var(--ressort); }
  .ar-sommaire--volet[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
  .ar-sommaire--volet ol { padding: 0 18px 14px; }
  .ar-sommaire--volet .ar-sommaire-titre { display: none; }
}
.article-corps > .ar-sommaire--volet { font-size: 1rem; line-height: 1.4; }

/* ─── Le partage ─── */
.ar-partage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ar-partage-titre { width: 100%; margin: 0 0 4px; color: var(--encre-3); font-size: var(--micro); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.ar-partager {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--carte);
  box-shadow: inset 0 0 0 1px var(--trait);
  color: var(--encre-2);
  cursor: pointer;
  transition: box-shadow var(--net) ease, color var(--net) ease, transform var(--pose) var(--ressort);
}
.ar-partager:hover { color: var(--encre); box-shadow: inset 0 0 0 1px var(--or); transform: translateY(-2px); }
.ar-partager svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ar-partager.est-copie { color: var(--vert-avis); box-shadow: inset 0 0 0 1px var(--vert-avis); }
.ar-partager:focus-visible, .ar-sommaire li > a:focus-visible, .ar-bouton:focus-visible { outline: 2px solid var(--or-lisible); outline-offset: 3px; }

/* ─── La fin d'article : l'auteur, puis l'encart d'appel ─── */
.ar-fin { display: grid; gap: var(--e5); max-width: 68ch; margin: var(--e8) auto 0; padding-inline: var(--gouttiere); }
.ar-auteur {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--carte);
  box-shadow: inset 0 0 0 1px var(--trait);
}
.ar-auteur-marque {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
}
.ar-auteur-marque::before { content: ''; position: absolute; inset: 7px; border-radius: 6px; background: var(--noir); transform: rotate(45deg); }
.ar-auteur-marque span { position: relative; color: var(--or); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.ar-auteur-texte { display: grid; gap: 2px; }
.ar-auteur-texte small { color: var(--encre-3); font-size: var(--p-5); }
.ar-auteur-texte b { color: var(--encre); font-size: var(--p-2); font-weight: 600; }
.ar-auteur-texte span { color: var(--encre-3); font-size: var(--p-4); line-height: 1.45; }
.ar-auteur .ar-partage { justify-content: flex-end; }
.ar-auteur .ar-partage-titre { display: none; }

.ar-appel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(70% 120% at 100% 100%, rgba(209, 163, 38, 0.22), transparent 60%), var(--noir);
  color: var(--sur-noir);
}
.ar-appel-texte { display: grid; gap: 6px; }
.ar-appel-texte small { color: var(--or); font-size: var(--micro); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.ar-appel-texte b { font-size: 1.375rem; font-weight: 500; line-height: 1.25; }
.ar-appel-texte span { color: var(--sur-noir-2); font-size: var(--p-3); line-height: 1.5; }
.ar-appel-boutons { display: grid; gap: 8px; }
.ar-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 99px;
  font-size: var(--p-4);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--pose) var(--ressort), background-color var(--net) ease;
}
.ar-bouton--plein { background: var(--or); color: var(--noir); }
.ar-bouton--fin { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); color: var(--sur-noir); }
.ar-bouton:hover { transform: translateY(-2px); }
.ar-bouton--fin:hover { box-shadow: inset 0 0 0 1px var(--or); }

/* ─── Pour aller plus loin : des cartes de lecture ─── */
#suite .lectures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#suite .lecture {
  position: relative;
  align-content: start;
  gap: 10px;
  min-height: 132px;
  padding: 20px 22px 44px;
  border: 0;
  border-radius: 18px;
  background: var(--carte);
  box-shadow: inset 0 0 0 1px var(--trait);
  transition: transform var(--pose) var(--ressort), box-shadow var(--pose) ease;
}
#suite .lecture::after {
  content: '→';
  position: absolute;
  left: 22px; bottom: 16px;
  color: var(--or-lisible);
  transition: transform var(--pose) var(--ressort);
}
#suite .lecture:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--or), 0 26px 44px -30px rgba(0, 0, 0, 0.4); }
#suite .lecture:hover::after { transform: translateX(4px); }
#suite .lecture .donnee { color: var(--or-lisible); }
#suite .lecture-nom { margin: 0; font-size: 1.125rem; line-height: 1.35; }
#suite .cadre-lis { max-width: 80ch; }

@media (max-width: 760px) {
  .article-corps { font-size: 1.0625rem; line-height: 1.7; }
  .article-corps > p:first-of-type { font-size: 1.1875rem; }
  .article-corps blockquote { font-size: 1.1875rem; }
  .article-couv img { border-radius: 14px; }
  .ar-auteur { grid-template-columns: auto minmax(0, 1fr); }
  .ar-auteur .ar-partage { grid-column: 1 / -1; justify-content: flex-start; }
  .ar-appel { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .ar-appel-boutons { grid-auto-flow: row; }
  #suite .lectures { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ar-progression { display: none; }
  .ar-partager, .ar-bouton, #suite .lecture, #suite .lecture::after, .article-corps .ar-lien-final { transition: none; }
}
@media print {
  .ar-progression, .ar-sommaire, .ar-partage, .ar-appel { display: none !important; }
}
.ar-auteur-texte b a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--or), var(--or)); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size var(--pose) ease; }
.ar-auteur-texte b a:hover { background-size: 100% 1.5px; }

/* ─── La signature sous le chapeau, et l'autrice du journal (15/10/2026) ───
   Capucine Morreaux, rédactrice éditoriale : même losange que le fondateur,
   en négatif (crème et or), pour qu'on distingue les deux signatures. */
.ar-signature { display: inline-flex; align-items: center; gap: 12px; margin: var(--e5) auto 0; text-align: left; }
.ar-signature-marque { position: relative; display: grid; place-items: center; flex: none; width: 38px; height: 38px; }
.ar-signature-marque::before { content: ''; position: absolute; inset: 6px; border-radius: 5px; background: var(--noir); transform: rotate(45deg); }
.ar-signature-marque span { position: relative; color: var(--or); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.ar-signature > span:last-child { display: grid; line-height: 1.25; font-size: var(--p-4); color: var(--encre-3); }
.ar-signature a { color: var(--encre); font-weight: 600; text-decoration: none; box-shadow: 0 1px 0 rgba(209, 163, 38, 0.6); }
.ar-signature small { font-size: var(--p-5); letter-spacing: 0.04em; }
.ar-signature--capucine .ar-signature-marque::before,
.ar-auteur--capucine .ar-auteur-marque::before { background: #FBF3DE; box-shadow: inset 0 0 0 1.5px var(--or); }
.ar-signature--capucine .ar-signature-marque span,
.ar-auteur--capucine .ar-auteur-marque span { color: var(--or-lisible); }
