/* ==========================================================================
   Chez Rémi — Pages de lecture
   Chargé après main.css. Tout ce qui touche à la lecture longue.
   ========================================================================== */

.article { padding-block: var(--sp-7); }

/* --- En-tête d'article --------------------------------------------------- */
.article__tete {
  max-width: var(--mesure);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--trait);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  margin-bottom: var(--sp-4);
}

.article__titre {
  font-size: var(--t-2xl);
  margin-bottom: var(--sp-4);
}

.article__chapo {
  font-size: var(--t-md);
  color: var(--encre-pale);
  margin-bottom: 0;
}

/* Calée sur la largeur de lecture : une image plus large que la colonne de
   texte casse l'alignement de la page. */
.article__cover {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  max-width: var(--mesure);
  margin-bottom: var(--sp-6);
  background: var(--braise-pale);
}

/* --- Corps --------------------------------------------------------------- */
.article__corps { max-width: var(--mesure); }

.article__corps h2 {
  font-size: var(--t-xl);
  margin-top: var(--sp-8);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--trait);
}
/* Le premier h2 suit déjà le filet de l'en-tête : pas de double ligne. */
.article__corps > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.article__corps h3 {
  font-size: var(--t-lg);
  margin-top: var(--sp-6);
}
.article__corps p { font-size: 1.04rem; line-height: 1.78; }

.article__corps ul,
.article__corps ol {
  margin: 0 0 var(--sp-5);
  padding-left: var(--sp-5);
}
.article__corps li { margin-bottom: var(--sp-2); }

.article__corps blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-5);
  border-left: 3px solid var(--braise);
  font-family: var(--font-titre);
  font-size: var(--t-md);
  color: var(--encre);
}
.article__corps blockquote p:last-child { margin-bottom: 0; }

.article__corps table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-6);
  font-size: var(--t-sm);
}
.article__corps th,
.article__corps td {
  text-align: left;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--trait);
  vertical-align: top;
}
.article__corps th {
  font-family: var(--font-texte);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* Filet fort réservé à une vraie ligne d'en-tête ; un tableau clé/valeur
   (th en première colonne) garde le filet léger de ses lignes. */
.article__corps thead th { border-bottom: 2px solid var(--encre); }

/* Les tableaux larges défilent seuls, jamais la page */
.tableau-defile {
  overflow-x: auto;
  margin-bottom: var(--sp-6);
  -webkit-overflow-scrolling: touch;
}
.tableau-defile table { margin-bottom: 0; }

.article__corps code {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
  font-size: 0.86em;
  background: var(--braise-pale);
  padding: 0.12em 0.36em;
}

/* --- Encadré « À retenir » ----------------------------------------------
   Fourni par Wisewand avec un style en dur ; on ne garde que le contenu. */
.a-retenir {
  max-width: var(--mesure);
  margin: 0 0 var(--sp-6);
  padding: var(--sp-5);
  background: var(--braise-pale);
  border-left: 3px solid var(--braise);
}
.a-retenir p:last-child { margin-bottom: 0; }
.a-retenir > .note {
  display: block;
  margin-bottom: var(--sp-3);
  color: var(--braise);
}

/* --- Repères de rubrique ------------------------------------------------ */
.reperes {
  background: var(--surface);
  border: 1px solid var(--trait);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.reperes h2 {
  font-family: var(--font-texte);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-pale);
  margin: 0 0 var(--sp-3);
  padding: 0;
  border: 0;
}
.reperes ul { margin-bottom: 0; }

/* --- FAQ dépliable -------------------------------------------------------
   <details> natif : accessible au clavier sans JS, et le contenu replié reste
   dans le DOM — donc indexable et lisible par les moteurs de réponse. */
.faq { max-width: var(--mesure); }

.question {
  border-bottom: 1px solid var(--trait);
}
.question:first-child { border-top: 1px solid var(--trait); }

.question summary {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  cursor: pointer;
  list-style: none;             /* masque le triangle par défaut */
}
.question summary::-webkit-details-marker { display: none; }

.question summary h3 {
  margin: 0;
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.18s ease;
}
.question summary:hover h3 { color: var(--braise); }

/* Indicateur d'ouverture */
.question summary::after {
  content: "+";
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-texte);
  font-size: var(--t-md);
  line-height: 1;
  color: var(--braise);
}
.question[open] summary::after { content: "–"; }

.question summary:focus-visible {
  outline: 2px solid var(--braise);
  outline-offset: 2px;
}

.question > p {
  margin: 0;
  padding: 0 var(--sp-6) var(--sp-5) 0;
  color: var(--encre-pale);
}

/* --- Signature auteur ---------------------------------------------------- */
.signature {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  max-width: var(--mesure);
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 2px solid var(--encre);
}
/* En tête de corps (page rédaction), le filet de l'en-tête suffit. */
.article__corps > .signature:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.signature img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--braise-pale);
}
.signature__name {
  font-family: var(--font-titre);
  font-weight: 600;
  margin: 0 0 var(--sp-1);
}
.signature p {
  font-size: var(--t-sm);
  color: var(--encre-pale);
  margin: 0;
}

/* --- Mention partenaire -------------------------------------------------- */
/* Affichée sur tout contenu publié dans le cadre d'un partenariat. */
.mention-partenaire {
  max-width: var(--mesure);
  margin-bottom: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--trait);
  border-left: 3px solid var(--olive);
  background: var(--surface);
  font-size: var(--t-sm);
  color: var(--encre-pale);
}
.mention-partenaire strong {
  font-family: var(--font-texte);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
}

/* --- Sommaire ------------------------------------------------------------ */
.sommaire {
  max-width: var(--mesure);
  margin-bottom: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--trait);
}
.sommaire h2 {
  font-family: var(--font-texte);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-pale);
  margin: 0 0 var(--sp-3);
  padding: 0;
  border: 0;
}
.sommaire ol {
  margin: 0;
  padding-left: var(--sp-5);
  font-size: var(--t-sm);
}
.sommaire li { margin-bottom: var(--sp-2); }

/* --- À lire aussi -------------------------------------------------------- */
.related { padding-block: var(--sp-7); border-top: 1px solid var(--trait); }
.related > h2 {
  font-size: var(--t-lg);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
  border-bottom: 2px solid var(--encre);
}

/* --- Fil d'Ariane -------------------------------------------------------- */
.ariane {
  font-family: var(--font-texte);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-pale);
  padding-block: var(--sp-4);
  margin: 0;
}
.ariane a { color: var(--encre-pale); }
.ariane span { margin-inline: var(--sp-2); color: var(--trait-fort); }

@media (max-width: 720px) {
  .article__titre { font-size: var(--t-xl); }
  .signature { flex-direction: column; gap: var(--sp-3); }
}


/* --- Encart d'accord, collant en marge droite ---------------------------
   La colonne de lecture est bornée à --mesure ; au-delà d'un certain écran il
   reste une marge droite inutilisée. On y pose l'encart, qui suit le lecteur.

   Il est le dernier enfant de l'article dans le source — l'ordre de lecture le
   place donc après la signature, ce qui convient à un complément — et remonté
   en tête de la seconde colonne par la grille. `span 99` plutôt que `-1` : les
   lignes sont implicites, une ligne négative ne s'y résout pas. */
.rappel {
  border: 1px solid var(--trait);
  border-top: 3px solid var(--braise);
  padding: var(--sp-4);
  margin-block: var(--sp-6);
  background: var(--surface);
}
.rappel__intitule {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-titre);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--braise);
}
.rappel p { font-size: var(--t-sm); line-height: 1.6; }
.rappel p:last-child { margin-bottom: 0; }
.rappel .bouton { display: inline-block; }

@media (min-width: 1080px) {
  .article {
    display: grid;
    grid-template-columns: minmax(0, var(--mesure)) minmax(200px, 1fr);
    column-gap: var(--sp-7);
    align-items: start;
  }
  .article > *:not(.rappel) { grid-column: 1; }

  .rappel {
    grid-column: 2;
    grid-row: 1 / span 99;
    position: sticky;
    top: var(--sp-5);
    margin-block: 0;
    align-self: start;
  }
}

/* Un encart collant qui dépasse la hauteur de la fenêtre devient une prison :
   on le laisse défiler normalement si l'écran est bas. */
@media (min-width: 1080px) and (max-height: 620px) {
  .rappel { position: static; }
}
