/* ============================================================================
   05 — ÉDITORIAL
   ----------------------------------------------------------------------------
   Style magazine soigné : titres typographiquement marqués, mélange serif/
   sans-serif, accents typographiques (petites capitales, lettrines optionnelles),
   palette anthracite et orange brûlé. Pour articles longs, billets, dossiers.
   ============================================================================ */

/* ============================================================================
   CORRECTIF — Neutralisation des puces de liste générées par l'extension
   ----------------------------------------------------------------------------
   L'extension logseq-pdf-export-plugin transforme CHAQUE bloc LogSeq en un
   élément <li> d'une liste HTML. Les "cercles" visibles dans le PDF sont donc
   les puces standard des <li>. On les masque ici pour avoir un rendu lisse.
   Conséquence : les listes Markdown explicites n'auront pas non plus de puces
   dans le PDF — c'est un compromis nécessaire puisque tout est rendu en liste.
   Si tu veux RESTAURER les puces, supprime ce bloc.
   ============================================================================ */

/* Neutralisation totale des puces de liste */
ul, ol {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

li {
  list-style: none !important;
}

li::marker {
  content: "" !important;
}

/* Au cas où LogSeq préserverait aussi ses classes internes : on les masque */
.bullet,
.bullet-container,
.bullet-link-wrap,
.block-control,
.rotating-arrow,
.control-hide,
.block-control-wrap {
  display: none !important;
}

/* Annule le décalage négatif que LogSeq applique au conteneur de blocs */
.page-blocks-inner {
  margin-left: 0 !important;
}

:root {
  --couleur-titre: #1A1A1A;
  --couleur-accent: #D55D2A;               /* Orange brûlé éditorial */
  --couleur-lien: #D55D2A;
  --couleur-texte: #2A2A2A;
  --couleur-filet: #E0E0E0;
  --couleur-encadre: #FFF8F2;

  /* Mélange typographique : titres sans-serif marqués, corps en serif */
  --police-titre: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;
  --police-texte: 'Lora', 'Merriweather', 'Liberation Serif', 'Georgia', serif;
  --police-code:  'JetBrains Mono', 'Source Code Pro', monospace;

  --taille-base: 11pt;
  --interligne: 1.6;
}

/* === 2. MISE EN PAGE & PAGINATION === */
@page {
  size: A4;
  margin: 2.8cm 2.5cm 2.8cm 2.5cm;

  @bottom-right {
    content: counter(page);
    font-family: 'Inter', sans-serif;
    font-size: 9pt;
    font-weight: 700;
    color: var(--couleur-accent, #D55D2A);
    padding-top: 0.5cm;
  }

  @bottom-left {
    content: "Article";                    /* Modifie selon le type */
    font-family: 'Inter', sans-serif;
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #888888;
    padding-top: 0.5cm;
  }
}

@page :first { margin-top: 3.2cm; }

/* === 3. STRUCTURE DE BASE === */
body {
  font-family: var(--police-texte);
  font-size: var(--taille-base);
  line-height: var(--interligne);
  color: var(--couleur-texte);
  text-align: justify;
  hyphens: auto;
}

/* === 4. TITRES === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--police-titre);
  color: var(--couleur-titre);
  font-weight: 800;
  page-break-after: avoid;
  break-after: avoid;
  text-align: left;
  hyphens: none;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Titre principal très marqué, style "Une de magazine" */
h1 {
  font-size: 2.6em;
  margin: 0 0 0.3em 0;
  font-weight: 900;
}

/* Date / sous-titre en couleur d'accent */
h1 + p,
h1 + h2 {
  color: var(--couleur-accent);
  font-family: var(--police-titre);
  font-size: 1.1em;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 2em 0;
}

h2 {
  font-size: 1.6em;
  margin: 2em 0 0.5em 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

h3 { font-size: 1.25em; margin: 1.4em 0 0.4em 0; color: var(--couleur-accent); }
h4 { font-size: 1.1em; margin: 1.1em 0 0.3em 0; font-style: italic; font-weight: 700; }
h5, h6 { font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.15em;
         color: var(--couleur-accent); margin: 1em 0 0.3em 0; font-weight: 700; }

/* === 5. PARAGRAPHES === */
p { margin: 0 0 1.1em 0; orphans: 3; widows: 3; }

/* LETTRINE : la première lettre du premier paragraphe après un H1 est agrandie
   Pour DÉSACTIVER, commenter le bloc ci-dessous */
h1 + p::first-letter,
h2 + p::first-letter {
  font-family: var(--police-titre);
  font-size: 3.5em;
  font-weight: 900;
  float: left;
  line-height: 0.9;
  margin: 0.05em 0.1em 0 0;
  color: var(--couleur-accent);
}

strong, b { font-weight: 700; color: var(--couleur-titre); }
em, i { font-style: italic; }

/* === 6. LIENS === */
a, a:link, a:visited {
  color: var(--couleur-lien);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--couleur-accent);
}
a:hover { border-bottom-style: solid; }

/* === 7. LISTES === */
ul, ol { margin: 0.6em 0 1em 0; padding-left: 1.8em; }
li { margin-bottom: 0.3em; text-align: left; }
ul li::marker { color: var(--couleur-accent); font-weight: 700; }
ol li::marker { color: var(--couleur-accent); font-weight: 700; }

/* === 8. TABLEAUX === */
table { width: 100%; border-collapse: collapse; margin: 1.2em 0 1.5em;
        page-break-inside: avoid; font-family: var(--police-titre);
        font-size: 0.95em; }
th, td { padding: 0.6em 0.8em; text-align: left; vertical-align: top;
         border-bottom: 1px solid var(--couleur-filet); }
thead th { font-weight: 700; color: var(--couleur-accent);
           text-transform: uppercase; font-size: 0.85em;
           letter-spacing: 0.1em;
           border-bottom: 2px solid var(--couleur-accent); }

/* === 9. CITATIONS === */
/* Style "pull quote" magazine : grosse police, sans guillemets ajoutés */
blockquote {
  margin: 1.5em 0;
  padding: 0.8em 1.5em;
  border-left: 5px solid var(--couleur-accent);
  background-color: var(--couleur-encadre);
  font-family: var(--police-titre);
  font-size: 1.2em;
  font-weight: 500;
  font-style: italic;
  color: var(--couleur-titre);
  line-height: 1.4;
  page-break-inside: avoid;
}
blockquote p:last-child { margin-bottom: 0; }

/* === 10. CODE === */
code { font-family: var(--police-code); font-size: 0.9em;
       background-color: var(--couleur-encadre); padding: 0.15em 0.4em;
       border-radius: 3px; color: var(--couleur-accent); }
pre { font-family: var(--police-code); font-size: 0.85em;
      background-color: #2A2A2A; color: #F5F5F5;
      padding: 1em; border-radius: 4px; margin: 1.2em 0;
      overflow-x: auto; white-space: pre-wrap;
      page-break-inside: avoid; }
pre code { background: none; padding: 0; color: inherit; }

/* === 11. IMAGES & HR === */
img { max-width: 100%; height: auto; display: block; margin: 1.5em auto; }
/* Séparateur décoratif : 3 traits courts en couleur d'accent */
hr {
  border: none;
  text-align: center;
  margin: 2em 0;
  color: var(--couleur-accent);
  font-size: 1.4em;
  font-weight: 900;
  letter-spacing: 0.5em;
}
hr::before { content: "— — —"; }

/* === 12. IMPRESSION === */
@media print {
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; break-after: avoid; }
}
