/* ═══════════════════════════════════════════════════════
   VARIABLES & RESET
   ═══════════════════════════════════════════════════════ */
:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f8fa;
  --bg-content: #ffffff;
  --bg-card: #f4f5f7;
  --bg-quote: #f0f2f5;
  --border: #dfe1e6;
  --border-active: #5b6abf;
  --text: #2c3e50;
  --text-muted: #7f8c9b;
  --text-heading: #1a1a2e;
  --text-bright: #0a0a0a;
  --accent: #5b6abf;
  --accent-glow: rgba(91, 106, 191, 0.10);
  --accent-warm: #c0813a;
  --gold: #8a6d2b;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --sidebar-width: 320px;
  --content-max: 780px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.75;
  display: flex;
  min-height: 100vh;
}

::selection {
  background: rgba(130, 146, 212, 0.3);
  color: var(--text-bright);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4ccc0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b8ae9f; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR — TABLE DES MATIÈRES
   ═══════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header .book-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.sidebar-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 4px;
}

.sidebar-header .subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.sidebar-nav a {
  display: block;
  padding: 10px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(130, 146, 212, 0.08);
}

.sidebar-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-nav .chapter-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  opacity: 0.7;
}

.sidebar-nav .chapter-title {
  font-weight: 600;
  display: block;
}

.sidebar-nav .chapter-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12.5px;
  opacity: 0.6;
  display: block;
  margin-top: 1px;
}

.sidebar-nav .divider {
  height: 1px;
  background: var(--border);
  margin: 12px 24px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════
   CONTENU PRINCIPAL
   ═══════════════════════════════════════════════════════ */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 60px 48px 120px;
}

/* ── COUVERTURE ───────────────────────── */
.cover {
  text-align: center;
  padding: 100px 0 80px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}

.cover .ornament {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 12px;
  margin-bottom: 40px;
  opacity: 0.5;
}

.cover h1 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.cover h1 span {
  color: var(--accent);
}

.cover .cover-subtitle {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.cover .cover-meta {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.cover .cover-meta strong {
  color: var(--text);
}

/* ── CHAPITRES ────────────────────────── */
.chapter {
  padding-top: 40px;
  margin-bottom: 80px;
}

.chapter-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.chapter-header .chapter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.chapter-header h2 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  margin-bottom: 8px;
}

.chapter-header .chapter-epigraph {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--accent-warm);
  opacity: 0.8;
}

/* ── SECTIONS ─────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 48px 0 20px;
  padding-top: 16px;
}

.section-title::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ── TEXTE ────────────────────────────── */
p {
  margin-bottom: 18px;
  color: var(--text);
}

strong { color: var(--text-heading); font-weight: 600; }

em { color: var(--text); font-style: italic; }

/* ── CITATIONS ────────────────────────── */
blockquote {
  margin: 28px 0;
  padding: 20px 28px;
  background: var(--bg-quote);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-display);
  font-size: 17.5px;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

blockquote .attribution {
  display: block;
  margin-top: 10px;
  font-size: 13.5px;
  font-style: normal;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* ── LISTES ───────────────────────────── */
.feature-list {
  margin: 20px 0 28px;
  padding-left: 0;
  list-style: none;
}

.feature-list li {
  padding: 6px 0 6px 24px;
  position: relative;
  color: var(--text);
}

.feature-list li::before {
  content: '›';
  position: absolute;
  left: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

/* ── ENCADRÉS / STATS ─────────────────── */
.stats-box {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stats-box h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 32px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14.5px;
}

.stat-item .label { color: var(--text-muted); }
.stat-item .value { color: var(--text-heading); font-weight: 600; font-family: var(--font-mono); font-size: 13.5px; background: rgba(130,146,212,0.1); padding: 1px 6px; border-radius: 3px; }

/* ── VERSIONS ─────────────────────────── */
.version-block {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}

.version-block .version-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
}

.version-block p {
  margin-bottom: 0;
  font-size: 15px;
}

/* ── SÉPARATEUR CHAPITRE ──────────────── */
.chapter-end {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 8px;
  opacity: 0.3;
}

/* ── FIN DU LIVRE ─────────────────────── */
.book-end {
  text-align: center;
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}

.book-end h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.book-end .tagline {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--accent-warm);
  margin-bottom: 40px;
}

.book-end .credits {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 2;
}

.book-end .credits strong {
  color: var(--text);
}

.philosophy {
  margin: 36px 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 4px;
}

/* ── RESPONSIVE ───────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-width: 260px; }
  .content-inner { padding: 40px 32px 80px; }
  .cover h1 { font-size: 38px; }
}

@media (max-width: 800px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 8px 12px; gap: 4px; }
  .sidebar-nav a { padding: 6px 12px; border-left: none; border-radius: 4px; font-size: 12px; }
  .sidebar-nav .chapter-quote { display: none; }
  .sidebar-nav .divider { display: none; }
  .content { margin-left: 0; }
  .content-inner { padding: 32px 20px 60px; }
  body { flex-direction: column; }
  .cover { padding: 60px 0 50px; }
  .cover h1 { font-size: 30px; }
}











    .definition-list {
      margin: 1.2em 0;
    }
    .definition-block {
      margin-bottom: 1em;
      padding-left: 0;
    }
    .definition-block dt {
      font-weight: 600;
      color: var(--accent);
      margin-bottom: 0.25em;
      font-size: 1.02em;
    }
    .definition-block dd {
      margin-left: 0;
      padding-left: 1.2em;
      border-left: 2px solid var(--accent-light, #d0d5ee);
      color: var(--text);
      line-height: 1.7;
    }
    pre.file-tree {
      background: var(--bg-card, #f4f5f7);
      border: 1px solid var(--border, #e0e0e0);
      border-radius: 6px;
      padding: 1em 1.2em;
      font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
      font-size: 0.88em;
      line-height: 1.6;
      overflow-x: auto;
      white-space: pre;
      color: var(--text);
    }
    .stats-list {
      columns: 2;
      column-gap: 2em;
      list-style: none;
      padding: 0;
      margin: 1em 0;
    }
    .stats-list li {
      padding: 0.3em 0;
      padding-left: 1.2em;
      position: relative;
      break-inside: avoid;
    }
    .stats-list li::before {
      content: '→';
      position: absolute;
      left: 0;
      color: var(--accent);
    }
    .credits-block {
      background: var(--bg-card, #f4f5f7);
      border-left: 3px solid var(--accent);
      padding: 0.8em 1.2em;
      margin: 1em 0;
      line-height: 1.8;
      border-radius: 0 6px 6px 0;
    }
    .highlight-text {
      text-align: center;
      font-size: 1.15em;
      font-weight: 600;
      color: var(--accent);
      margin: 1em 0;
      letter-spacing: 0.05em;
    }

/* ═══════════════════════════════════════════════════════
   NAVIGATION INTER-PAGES
   ═══════════════════════════════════════════════════════ */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.page-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.page-nav a:hover { opacity: 0.7; }

.page-nav .nav-prev { text-align: left; }
.page-nav .nav-center { text-align: center; }
.page-nav .nav-next { text-align: right; }
.page-nav .nav-label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-weight: 400;
}

.page-nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0 16px;
  margin-top: 60px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.page-nav-bottom a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}
.page-nav-bottom a:hover { opacity: 0.7; }
.page-nav-bottom .nav-prev { text-align: left; }
.page-nav-bottom .nav-center { text-align: center; }
.page-nav-bottom .nav-next { text-align: right; }
.page-nav-bottom .nav-label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-weight: 400;
}

/* Mini-sommaire du chapitre */
.chapter-toc {
  margin: 0 0 48px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.chapter-toc h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.chapter-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 2em;
}

.chapter-toc li {
  padding: 4px 0;
  break-inside: avoid;
}

.chapter-toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.chapter-toc a:hover { color: var(--accent); }

.chapter-toc a::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

/* Index page */
.index-grid {
  margin: 48px 0;
}

.index-chapter {
  margin-bottom: 32px;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.index-chapter:hover {
  border-color: var(--accent);
}

.index-chapter a {
  text-decoration: none;
  color: inherit;
}

.index-chapter .chapter-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

.index-chapter h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 8px 0 4px;
}

.index-chapter .epigraph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.index-chapter .sections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.index-chapter .sections-list span::before {
  content: '›';
  color: var(--accent);
  margin-right: 4px;
  font-weight: 700;
}

@media (max-width: 800px) {
  .chapter-toc ul { columns: 1; }
  .page-nav, .page-nav-bottom { font-size: 12px; }
}
