/* ============================================
   AGARTHA.BZ — V4 "LA GAZETTE DÉFINITIVE"
   AR-104 — Architecte en Chef
   
   RÉGIME TYPOGRAPHIQUE :
     Playfair Display 700/900 → Titres
     Literata opsz 7-72, 400→700 → Corps
     JetBrains Mono 400/500/700 → Technique
   
   PALETTE :
     Crème papier → #F5F0E8
     Noir chaud   → #1A1610
     Rouge sang   → #8B1A1A
   ============================================ */

/* ——————————————————————————————————————————————
   I. CUSTOM PROPERTIES
   —————————————————————————————————————————————— */

:root {
  /* — Surfaces — */
  --bg-primary: #f5f0e8;
  --bg-secondary: #ebe6dc;
  --bg-accent: #1a1610;
  --bg-card: #fefcf8;
  --bg-code: #e8e3d9;

  /* — Texte — */
  --text-primary: #1a1610;
  --text-secondary: #4a4540;
  --text-muted: #89847a;

  /* — Accent rouge — usage ≤5% de la surface — */
  --accent-red: #8b1a1a;
  --accent-red-light: #a62c2c;
  --accent-red-glow: #8b1a1a22;

  /* — Bordures — */
  --border-dark: #1a1610;
  --border-medium: #b5afa3;
  --border-light: #d5d0c6;
  --border-faint: #e5e0d7;

  /* — Sémantique — */
  --success: #2d5a27;
  --warning: #8b6914;
  --danger: #8b1a1a;

  /* — Typographie — */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;

  /* — Échelle d'espacement (modular, ratio ~1.5) — */
  --space-3xs: 0.25rem; /* 4px */
  --space-2xs: 0.375rem; /* 6px */
  --space-xs: 0.5rem; /* 8px */
  --space-sm: 1rem; /* 16px */
  --space-md: 2rem; /* 32px */
  --space-lg: 3.5rem; /* 56px */
  --space-xl: 5rem; /* 80px */
  --space-2xl: 7rem; /* 112px */

  /* — Conteneurs — */
  --reading-width: 680px;
  --outer-width: 1020px;

  /* — Transitions — */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.1s;
  --duration-normal: 0.2s;
}

/* ——————————————————————————————————————————————
   II. RESET & FONDATIONS
   —————————————————————————————————————————————— */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) var(--bg-primary);
}

::selection {
  background: var(--accent-red);
  color: #fff8f0;
}

:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 3px;
}

/* ——————————————————————————————————————————————
   III. CORPS TYPOGRAPHIQUE
   
   Literata à 19px, interligne 1.78.
   font-optical-sizing: auto active les tailles
   optiques — les glyphes s'adaptent à la taille
   d'affichage. À 19px les compteurs s'ouvrent,
   les jonctions s'affinent, la lisibilité est
   maximale. L'œil entre en "flow state".
   —————————————————————————————————————————————— */

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.78;
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1,
    "onum" 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   IV. HEADER
   
   Fond noir chaud. Filet rouge épais.
   Playfair Display 900 : la marque est un
   monument typographique.
   ============================================ */

header {
  background: var(--bg-accent);
  color: var(--bg-primary);
  padding: 1.25rem var(--space-md) 1.15rem;
  border-bottom: 5px solid var(--accent-red);
  position: relative;
}

/* Filigrane décoratif subtil (optionnel) */
header::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-red-glow) 20%,
    var(--accent-red-glow) 80%,
    transparent 100%
  );
}

.header-inner {
  max-width: var(--outer-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.brand:hover {
  color: var(--accent-red-light);
}

.brand-accent {
  color: var(--accent-red-light);
}

.header-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}

/* ============================================
   V. NAVIGATION CATÉGORIES
   
   Sticky. Fond crème sombre.
   Bordure fine. Boutons carrés francs.
   Effet de "barre de commandement" sur scroll.
   ============================================ */

.categories-nav {
  background: var(--bg-secondary);
  border-bottom: 1.5px solid var(--border-dark);
  padding: 0.75rem var(--space-md);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

/* Ombre subtile au scroll pour détacher visuellement */
.categories-nav:hover {
  box-shadow: 0 4px 20px rgba(26, 22, 16, 0.08);
}

.categories-inner {
  max-width: var(--outer-width);
  margin: 0 auto;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

#categories-list {
  display: contents;
}

.category-btn {
  background: transparent;
  border: 1.5px solid var(--border-medium);
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.category-btn:hover {
  background: var(--bg-accent);
  color: var(--bg-primary);
  border-color: var(--bg-accent);
  transform: translateY(-1px);
}

.category-btn:active {
  transform: translateY(0);
}

.category-btn.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

/* ============================================
   VI. HERO ACCUEIL
   
   Fond crème sombre. Typographie massive.
   Ornement éditorial entre titre et sous-titre.
   
   Le titre est en Playfair Display 900.
   À clamp(3rem, 8vw, 4.8rem), les contrastes
   épais/fins du Playfair créent une tension
   visuelle spectaculaire. Les empattements
   délicats vs les fûts massifs = le paradoxe
   brutaliste incarné en typographie.
   ============================================ */

.hero-home {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-dark);
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  position: relative;
}

/* Double filet éditorial en bas du hero */
.hero-home::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: var(--space-md);
  right: var(--space-md);
  height: 1px;
  background: var(--border-dark);
}

.hero-home .hero-inner {
  max-width: var(--outer-width);
  margin: 0 auto;
}

.hero-home h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 4.8rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  max-width: 16ch;
}

/* Ornement éditorial : petits losanges
   entre le titre et le sous-titre */
.hero-home .hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.78;
  border-left: 3px solid var(--accent-red);
  padding-left: 1.5rem;
  max-width: 52ch;
  position: relative;
}

/* Petit carré rouge décoratif en haut de la bordure */
.hero-home .hero-subtitle::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0;
  width: 7px;
  height: 7px;
  background: var(--accent-red);
}

/* ============================================
   VII. CONTENEUR PRINCIPAL
   ============================================ */

.main-container {
  max-width: var(--outer-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
}

/* ============================================
   VIII. GRILLE D'ARTICLES
   
   Chaque carte = une entrée de registre.
   Fond crème très léger (--bg-card) pour
   créer un micro-relief par rapport au fond.
   Bordure gauche rouge discrète = fil conducteur.
   
   Au hover : le fond s'assombrit légèrement,
   la bordure rouge s'élargit. C'est subtil
   mais ça guide l'œil et la main.
   ============================================ */

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.article-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-bottom: none;
  border-left: 3px solid var(--accent-red);
  padding: var(--space-md) var(--space-md) var(--space-md)
    calc(var(--space-md) - 1.5px);
  display: block;
  position: relative;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-left-width var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.article-card:last-child {
  border-bottom: 1.5px solid var(--border-light);
}

.article-card:hover {
  background: var(--bg-secondary);
  border-left-width: 5px;
  padding-left: calc(var(--space-md) - 3.5px);
  box-shadow: 0 2px 16px rgba(26, 22, 16, 0.06);
}

.article-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Tag catégorie : tampon rouge, effet "cachet" */
.category-tag {
  display: inline-block;
  background: var(--accent-red);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem 0.2rem;
  position: relative;
}

/* Micro-détail : coin coupé sur le tag
   Effet "tampon administratif" */
.category-tag::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 6px 6px 0;
  border-color: transparent var(--bg-card) transparent transparent;
}

.article-card:hover .category-tag::after {
  border-color: transparent var(--bg-secondary) transparent transparent;
}

.article-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Titre d'article : Playfair 900.
   Le serif display crée l'autorité éditoriale
   même à une taille modérée. */
.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.8vw, 1.6rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

/* Extrait : Literata 400 — la font de lecture
   fait déjà son travail de séduction ici. */
.article-excerpt {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.65;
  margin-bottom: 1.2rem;
  max-width: 65ch;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-faint);
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

/* Soulignement animé sur le "lire plus" */
.read-more::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-red);
  transition: width var(--duration-normal) var(--ease-out);
}

.article-card:hover .read-more::after {
  width: 100%;
}

/* ============================================
   IX. ÉTATS DE CHARGEMENT / VIDE
   ============================================ */

.loading {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Animation de pulsation subtile */
@keyframes pulse-muted {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.loading {
  animation: pulse-muted 2s ease-in-out infinite;
}

.no-articles {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-left: 3px solid var(--accent-red);
}

.no-articles p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   X. PAGE ARTICLE — HEADER
   ============================================ */

.article-page-header {
  background: var(--bg-accent);
  color: var(--bg-primary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 4px solid var(--accent-red);
}

.article-page-header .header-inner {
  max-width: var(--outer-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg-primary);
  padding: 0.55rem 1.1rem;
  border: 1.5px solid rgba(245, 240, 232, 0.4);
  min-height: 44px;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.back-link:hover {
  background: var(--bg-primary);
  color: var(--bg-accent);
  border-color: var(--bg-primary);
}

.brand-small {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-primary);
}

.brand-small .brand-accent {
  color: var(--accent-red-light);
}

/* ============================================
   XI. PAGE ARTICLE — HERO
   
   Le titre est l'événement. Tout converge
   vers lui. Playfair Display 900 à grande
   taille = tension épais/fin maximale.
   ============================================ */

.article-hero {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-dark);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  position: relative;
}

.article-hero::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: var(--space-md);
  right: var(--space-md);
  height: 1px;
  background: var(--border-dark);
}

.article-hero .hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.article-hero .category-tag {
  margin-bottom: 1.5rem;
}

.article-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.article-hero .hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.78;
  max-width: 700px;
  border-left: 3px solid var(--accent-red);
  padding-left: 1.5rem;
  margin-bottom: var(--space-md);
  position: relative;
}

.article-hero .hero-subtitle::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0;
  width: 7px;
  height: 7px;
  background: var(--accent-red);
}

.article-hero .hero-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   XII. CONTENU ÉDITORIAL
   
   C'est le sanctuaire de Literata.
   680px = ~65ch = longueur de ligne optimale.
   19px + line-height 1.78 = flow state garanti.
   
   ★ LETTRINE sur le premier paragraphe :
   tradition éditoriale majeure. Le premier
   caractère est un Playfair Display 900 de
   3.5 lignes de haut, en rouge sang.
   C'est le seuil d'entrée dans le texte.
   ============================================ */

.article-content {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
}

/* — Lead paragraph : Literata 600, entrée en matière — */
.article-content .lead-paragraph {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.78;
  margin-bottom: var(--space-md);
  text-indent: 0;
}

/* ★ LETTRINE : premier caractère du premier paragraphe.
   Playfair Display 900, rouge sang, 3 lignes de haut.
   Float left pour que le texte coule autour. */
.article-content .lead-paragraph::first-letter,
.article-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--accent-red);
  float: left;
  font-size: 3.8em;
  line-height: 0.8;
  padding-right: 0.08em;
  margin-top: 0.05em;
}

/* — Paragraphes — */
.article-content p {
  margin-bottom: 1.5rem;
  max-width: 65ch;
  font-weight: 400;
  color: var(--text-primary);
  text-align: justify;
  text-indent: 1.5rem;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article-content p:first-of-type {
  text-indent: 0;
}

/* — H2 : Playfair Display 900 —
   Filet rouge sous le titre.
   Marge supérieure massive = nouvelle section. */
.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-primary);
  margin: var(--space-xl) 0 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 3px solid var(--border-dark);
  position: relative;
}

/* Petit carré rouge au début du filet du H2 */
.article-content h2::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent-red);
}

/* — H3 : Playfair Display 700 — */
.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: var(--space-lg) 0 var(--space-sm);
}

.article-content strong {
  font-weight: 700;
  color: var(--text-primary);
}

.article-content em {
  font-style: italic;
  font-weight: 500;
}

/* — Listes : puces carrées rouges, indentation 2rem — */
.article-content ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
  list-style-type: square;
}

.article-content ul li::marker {
  color: var(--accent-red);
}

.article-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content ol li::marker {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85em;
  color: var(--accent-red);
}

.article-content li {
  margin-bottom: 0.75rem;
  max-width: 65ch;
  text-indent: 0;
  text-align: left;
  padding-left: 0.35rem;
}

/* — Blockquote / Pull-quote —
   
   ★ Grand guillemet décoratif en Playfair Display.
   Le guillemet français « est un artefact
   typographique massif, rouge, positionné
   en absolute. Le texte est en Literata italic 500.
   C'est une "affiche miniature" dans le flux. */
.article-content blockquote {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-red);
  padding: 2rem 2rem 1.75rem 2.5rem;
  margin: var(--space-lg) 0;
  position: relative;
  font-style: italic;
  font-weight: 500;
  font-size: 1.05em;
  color: var(--text-primary);
}

/* Guillemet décoratif géant */
.article-content blockquote::before {
  content: "«";
  font-family: var(--font-display);
  font-weight: 900;
  font-style: normal;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent-red);
  opacity: 0.2;
  position: absolute;
  top: 0.75rem;
  left: 0.65rem;
}

.article-content blockquote p {
  text-indent: 0;
  text-align: left;
  margin: 0;
  max-width: none;
  hyphens: none;
  position: relative;
  z-index: 1;
}

/* — Code inline — */
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 400;
  background: var(--bg-code);
  color: var(--accent-red);
  padding: 0.12em 0.4em;
  border: 1px solid var(--border-light);
  border-radius: 0;
}

/* — Pre / Code blocks — */
.article-content pre {
  background: var(--bg-accent);
  color: var(--bg-primary);
  padding: 1.5rem;
  margin: var(--space-md) 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  border-left: 3px solid var(--accent-red);
}

.article-content pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* — Liens — */
.article-content a {
  color: var(--accent-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-red-light);
  transition:
    color var(--duration-fast) var(--ease-out),
    text-decoration-color var(--duration-fast) var(--ease-out);
}

.article-content a:hover {
  color: var(--accent-red-light);
  text-decoration-color: var(--accent-red);
  text-decoration-thickness: 2px;
}

/* — Séparateur horizontal — */
.article-content hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: var(--space-lg) auto;
  max-width: 120px;
  position: relative;
}

.article-content hr::after {
  content: "◆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  padding: 0 0.75rem;
  font-size: 0.6rem;
  color: var(--accent-red);
}

/* — Images dans le contenu — */
.article-content figure {
  margin: var(--space-lg) 0;
}

.article-content figure img {
  border: 1.5px solid var(--border-light);
}

.article-content figcaption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-faint);
}

/* ============================================
   XIII. SOMMAIRE (TOC)
   
   Cadre blanc sur fond crème.
   Chiffres romains rouges.
   Liens avec underline animé au hover.
   ============================================ */

.toc {
  background: var(--bg-card);
  border: 2px solid var(--border-dark);
  padding: var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
  position: relative;
}

/* Petit label "SOMMAIRE" en haut à gauche du cadre */
.toc::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 4px;
  height: 100%;
  background: var(--accent-red);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
}

.toc li {
  counter-increment: toc-counter;
  margin-bottom: 0.65rem;
  padding-left: 2.5rem;
  position: relative;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
}

.toc li::before {
  content: counter(toc-counter, upper-roman) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-red);
}

.toc a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.toc a:hover {
  color: var(--accent-red);
  border-bottom-color: var(--accent-red);
}

/* ============================================
   XIV. LISTES STRUCTURÉES (fact-list)
   ============================================ */

.fact-list {
  list-style: none;
  margin: var(--space-md) 0;
  background: var(--bg-card);
  border: 2px solid var(--border-dark);
  border-left: 4px solid var(--accent-red);
  padding: 0;
}

.fact-list li {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-faint);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
  align-items: start;
  transition: background var(--duration-fast) var(--ease-out);
}

.fact-list li:last-child {
  border-bottom: none;
}

.fact-list li:hover {
  background: var(--bg-secondary);
}

.fact-list .icon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  flex-shrink: 0;
}

.fact-list .icon.bad {
  background: var(--danger);
  color: white;
}

.fact-list .icon.mid {
  background: var(--warning);
  color: white;
}

.fact-list .icon.good {
  background: var(--success);
  color: white;
}

.fact-list .fact-title {
  font-family: var(--font-body);
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}

.fact-list .fact-desc {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-indent: 0;
  text-align: left;
  margin: 0;
  line-height: 1.6;
}

/* ============================================
   XV. ENCADRÉS (callout)
   
   Bordure gauche épaisse = grade d'alerte.
   Fond blanc. Titre monospace en couleur d'alerte.
   ============================================ */

.callout {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-left: 7px solid var(--accent-red);
  padding: 1.75rem var(--space-md);
  margin: var(--space-lg) 0;
  position: relative;
}

.callout-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-faint);
}

.callout p {
  margin-bottom: var(--space-sm);
  text-indent: 0;
  text-align: left;
  font-size: 0.93rem;
  line-height: 1.7;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout.legal {
  border-left-color: var(--warning);
}

.callout.legal .callout-title {
  color: var(--warning);
}

.callout.tactical {
  border-left-color: var(--success);
}

.callout.tactical .callout-title {
  color: var(--success);
}

.callout.cnil {
  border-left-color: #2563eb;
}

.callout.cnil .callout-title {
  color: #2563eb;
}

/* ============================================
   XVI. TABLEAU COMPARATIF
   ============================================ */

.comparison-table-wrapper {
  overflow-x: auto;
  margin: var(--space-md) 0;
  border: 2px solid var(--border-dark);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.86rem;
  background: var(--bg-card);
}

.comparison-table thead {
  background: var(--bg-accent);
  color: var(--bg-primary);
}

.comparison-table th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.9rem 1rem;
  border-right: 1px solid #333;
}

.comparison-table th:last-child {
  border-right: none;
}

.comparison-table th.highlight {
  background: var(--accent-red);
}

.comparison-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-faint);
  border-right: 1px solid var(--border-faint);
  vertical-align: top;
  line-height: 1.5;
}

.comparison-table td:last-child {
  border-right: none;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: var(--bg-secondary);
}

.comparison-table td:first-child {
  font-weight: 600;
  background: var(--bg-secondary);
  font-size: 0.88rem;
}

.comparison-table tr:hover td:first-child {
  background: var(--border-faint);
}

.comparison-table .cell-bad {
  color: var(--danger);
  font-weight: 600;
}

.comparison-table .cell-mid {
  color: var(--warning);
  font-weight: 600;
}

.comparison-table .cell-good {
  color: var(--success);
  font-weight: 700;
}

/* ============================================
   XVII. SOURCES
   ============================================ */

.sources {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 2px solid var(--border-dark);
  position: relative;
}

.sources::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--accent-red);
}

.sources h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.sources ol {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 1.5rem;
  line-height: 1.6;
}

.sources ol li::marker {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-red);
  font-size: 0.78em;
}

.sources li {
  margin-bottom: 0.6rem;
  text-indent: 0;
  text-align: left;
}

/* ============================================
   XVIII. CTA SECTION
   ============================================ */

.cta-section {
  background: var(--bg-accent);
  color: white;
  padding: var(--space-xl) var(--space-md);
  margin: var(--space-xl) 0 0;
  text-align: center;
  position: relative;
}

/* Filet rouge en haut du CTA */
.cta-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-red);
}

.cta-section h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  margin-bottom: 0.85rem;
  color: white;
}

.cta-section p {
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: var(--space-md);
  text-indent: 0;
  text-align: center;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  hyphens: none;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--accent-red);
  color: white;
  padding: 0.9rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--accent-red);
  border-radius: 0;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.cta-btn:hover {
  background: transparent;
  color: white;
  border-color: white;
  transform: translateY(-1px);
}

.cta-btn:active {
  transform: translateY(0);
}

/* ============================================
   XIX. FOOTER
   
   Fond crème sombre. Sobre.
   Filet rouge centré = sceau final du document.
   ============================================ */

footer {
  background: var(--bg-secondary);
  border-top: 2px solid var(--border-dark);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  text-align: center;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--accent-red);
}

.footer-inner {
  max-width: var(--outer-width);
  margin: 0 auto;
}

.footer-rule {
  width: 30px;
  height: 2px;
  background: var(--accent-red);
  margin: 0 auto var(--space-md);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  line-height: 1.6;
}

/* ============================================
   XX. SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-red);
}

/* ============================================
   XXI. RESPONSIVE
   ============================================ */

/* ── Tablette (≤1024px) ── */
@media (max-width: 1024px) {
  .hero-home {
    padding: var(--space-xl) var(--space-md) var(--space-lg);
  }

  .hero-home h1 {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }

  .categories-inner {
    justify-content: center;
  }

  .hero-home {
    padding: var(--space-lg) var(--space-sm) var(--space-lg);
  }

  .hero-home::after {
    left: var(--space-sm);
    right: var(--space-sm);
  }

  .hero-home h1 {
    font-size: clamp(2.2rem, 10vw, 3rem);
    max-width: none;
  }

  .hero-home .hero-subtitle {
    max-width: none;
  }

  .article-hero {
    padding: var(--space-md) var(--space-sm) var(--space-md);
  }

  .article-hero::after {
    left: var(--space-sm);
    right: var(--space-sm);
  }

  .article-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    max-width: none;
  }

  .article-hero .hero-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .article-content {
    padding: var(--space-md) var(--space-sm) var(--space-lg);
  }

  /* Interligne augmenté : anti-étouffement mobile */
  .article-content p,
  .article-content li {
    line-height: 1.85;
  }

  /* Retirer la justification sur mobile :
     écrans étroits = rivières blanches */
  .article-content p {
    text-align: left;
    hyphens: none;
    text-indent: 0;
  }

  /* Lettrine réduite sur mobile */
  .article-content .lead-paragraph::first-letter,
  .article-content > p:first-of-type::first-letter {
    font-size: 3em;
  }

  .main-container {
    padding: var(--space-md) var(--space-sm);
  }

  .comparison-table {
    font-size: 0.7rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.65rem 0.45rem;
  }

  .article-page-header .header-inner {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .cta-section {
    padding: var(--space-lg) var(--space-sm);
  }

  .article-card {
    padding: 1.5rem 1.25rem 1.5rem calc(1.25rem - 1.5px);
  }

  /* Blockquote : guillemet plus petit */
  .article-content blockquote::before {
    font-size: 3rem;
  }

  .article-content blockquote {
    padding: 1.5rem 1.25rem 1.25rem 1.75rem;
    margin: var(--space-md) 0;
  }
}

/* ── Petit mobile (≤380px) ── */
@media (max-width: 380px) {
  body {
    font-size: 17px;
  }

  .hero-home h1 {
    font-size: 2rem;
  }

  .article-hero h1 {
    font-size: 1.45rem;
  }

  .category-btn {
    font-size: 0.56rem;
    padding: 0.4rem 0.65rem;
    min-height: 36px;
  }

  .article-content {
    padding: 1.5rem 0.75rem var(--space-md);
  }

  .brand {
    font-size: 1.3rem;
  }

  /* Pas de lettrine sur très petit écran */
  .article-content .lead-paragraph::first-letter,
  .article-content > p:first-of-type::first-letter {
    float: none;
    font-size: inherit;
    color: inherit;
    padding-right: 0;
    margin-top: 0;
  }
}

/* ── Écrans larges (≥1400px) ── */
@media (min-width: 1400px) {
  :root {
    --outer-width: 1080px;
  }

  body {
    font-size: 20px;
  }

  .hero-home h1 {
    font-size: 5rem;
  }
}

/* ── 4K (≥1800px) ── */
@media (min-width: 1800px) {
  :root {
    --outer-width: 1140px;
  }

  body {
    font-size: 21px;
  }

  .hero-home h1 {
    font-size: 5.5rem;
  }

  .article-hero h1 {
    font-size: 3.8rem;
  }

  .hero-home,
  .article-hero {
    padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  }
}

/* ============================================
   XXII. PRINT
   
   Le document imprimé doit être lisible.
   Pas de fond, pas de couleur, pas de nav.
   Le contenu survit seul sur le papier.
   ============================================ */

@media print {
  *,
  *::before,
  *::after {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  header,
  .categories-nav,
  .cta-section,
  footer,
  .back-link {
    display: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.6;
  }

  .article-content {
    max-width: 100%;
    padding: 0;
  }

  .article-content a {
    text-decoration: underline;
  }

  .article-content a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666 !important;
  }

  .article-hero {
    border-bottom: 2px solid black;
    padding: 1rem 0;
  }

  .article-content h2 {
    page-break-after: avoid;
  }

  .article-content blockquote,
  .callout,
  .fact-list,
  .toc {
    page-break-inside: avoid;
  }
}
