/* ══════════════════════════════════════════════════════════════════
   ECG Prépa — index des chapitres de cours (refonte « atlas nocturne »)
   Chargé APRÈS le <style> de la page, sur <body class="ci">.
   Chaque page fixe sa couleur : <body class="ci" style="--ci-accent:…">.
   Les lignes de chapitre gardent la classe .chapter-item (verrouillage,
   Premium et favoris d'auth.js) : seul leur habillage change ici.
   ══════════════════════════════════════════════════════════════════ */
body.ci { background: #0a0a0b; color: #ecebe6; -webkit-font-smoothing: antialiased; }
body.ci .bg-orb { display: none; }
body.ci nav { background: rgba(10,10,11,0.92); border-bottom: 1px solid #1f1f22; }
body.ci .nav-logo { color: var(--ci-accent); white-space: nowrap; }
body.ci .breadcrumb span:hover { color: var(--ci-accent); }

/* ─── En-tête : texte à gauche, dessin à droite ─── */
.ci-hero { position: relative; border-bottom: 1px solid #1f1f22; overflow: hidden; }
.ci-fond { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ci-hero-in { position: relative; max-width: 1180px; margin: 0 auto; padding: 72px clamp(16px, 4vw, 48px) 64px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.ci-texte { flex: 1 1 480px; min-width: 0; }
.ci-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ci-accent); }
.ci-eyebrow::before { content: ''; width: 32px; height: 1px; background: currentColor; flex-shrink: 0; }
.ci-titre { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 0.98; letter-spacing: -0.02em; font-variation-settings: 'opsz' 144; color: #ecebe6; }
.ci-titre.long { font-size: clamp(2.4rem, 5.2vw, 4.2rem); }
.ci-intro { margin: 26px 0 0; max-width: 520px; font-family: 'Newsreader', Georgia, serif; font-size: 1.3rem;
  line-height: 1.55; color: #b9b7b0; }
.ci-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.ci-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid #2e2e33; background: rgba(10,10,11,0.7); color: #ecebe6; text-decoration: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500; transition: border-color 0.2s, transform 0.2s; }
.ci-btn:hover { border-color: var(--ci-accent); }
.ci-btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s; }
.ci-btn:hover svg { transform: translateX(3px); }
.ci-visuel { flex: 0 1 400px; min-width: 0; display: flex; justify-content: center; }
.ci-visuel svg { width: 100%; max-width: 400px; height: auto; display: block; }

/* Carte « fiche du jour » / « texte du jour » (mise à jour chaque jour par les routines) :
   une simple pastille sur une ligne, étiquette + titre. */
.ci-hero .colles-card { display: inline-flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%;
  box-sizing: border-box; margin-top: 14px; padding: 9px 18px 9px 14px; border: 1px solid #2e2e33; border-radius: 999px;
  background: rgba(15,15,17,0.85); color: #ecebe6; text-decoration: none; transition: border-color 0.2s; }
.ci-hero .colles-card:hover { border-color: var(--ci-accent); background: rgba(15,15,17,0.85); }
.ci-hero .colles-card .cc-tag { flex-shrink: 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ci-accent); }
.ci-hero .colles-card .cc-title { min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 0.98rem; }
.ci-hero .colles-card .cc-sub, .ci-hero .colles-card .cc-all { display: none; }

/* ─── Liste des chapitres ─── */
.ci-zone { width: 100%; box-sizing: border-box; max-width: 1180px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 48px) 110px; }
.ci-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.ci-tete h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  letter-spacing: -0.01em; line-height: 1.1; color: #ecebe6; }
.ci-compte { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: #a3a29c; }
/* Ordre en colonnes : 1, 2, 3… descendent la colonne de gauche, la suite reprend à droite. */
.ci-liste { columns: 2 460px; column-gap: 40px; border-top: 1px solid #1f1f22; }
.ci-liste > * { break-inside: avoid; }
.ci-liste .chapter-item { position: relative; display: flex; align-items: center; gap: 18px; min-height: 80px; margin: 0;
  padding: 18px 8px; box-sizing: border-box; border: 0; border-bottom: 1px solid #1f1f22; border-radius: 0; background: none;
  color: #ecebe6; text-decoration: none; cursor: pointer; transform: none; opacity: 1; animation: none; transition: background 0.2s; }
.ci-liste .chapter-item:hover { background: rgba(255,255,255,0.025); border-color: #1f1f22; transform: none; }
.ci-liste div.chapter-item:not([onclick]) { cursor: default; }
.ci-num { position: relative; flex-shrink: 0; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 500; color: var(--ci-accent); }
.ci-num svg { position: absolute; inset: 0; width: 46px; height: 46px; }
.ci-num span { position: relative; }
.ci-num.romain { font-family: 'Fraunces', Georgia, serif; font-size: 0.95rem; font-weight: 600; }
.ci-num.bulle { height: 40px; }
.ci-num.bulle svg { height: 40px; }
.ci-num.bulle span { margin-top: -6px; }
.ci-nom { flex: 1; min-width: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.22rem; line-height: 1.25; }
.ci-fleche { flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: #5a5955; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; transition: stroke 0.2s, transform 0.2s; }
.ci-liste .chapter-item:hover .ci-fleche { stroke: var(--ci-accent); transform: translateX(4px); }

@media (max-width: 600px) {
  .ci-hero-in { padding-top: 48px; padding-bottom: 44px; gap: 28px; }
  .ci-visuel svg { max-width: 240px; margin: 0 auto; }
  .ci-intro { font-size: 1.15rem; }
  .ci-nom { font-size: 1.1rem; }
}

/* ─── Groupes de révisions dépliables (maths de 2e année) ─── */
.ci-liste .rev-group { column-span: all; margin: 0; border-bottom: 1px solid #1f1f22; }
.ci-liste .rev-group .rev-toggle { width: 100%; border-bottom: 0; font: inherit; text-align: left; }
.ci-liste .rev-group.ouvert .rev-toggle { background: rgba(255,255,255,0.025); }
.ci-liste .rev-group.ouvert .rev-chevron { transform: rotate(90deg); stroke: var(--ci-accent); }
.ci-liste .rev-grid { gap: 12px; padding: 4px 8px 22px 72px; }
.ci-liste .rev-card { min-height: 96px; border: 1px solid #2e2e33; border-radius: 12px; background: #0f0f11; color: #ecebe6; }
.ci-liste .rev-card:hover { border-color: var(--ci-accent); background: #0f0f11; }
.ci-liste .rev-card-tag { font-family: 'IBM Plex Mono', monospace; color: var(--ci-accent); }
.ci-liste .rev-card-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.08rem; }
.ci-liste .rev-card:hover .rev-card-arrow { color: var(--ci-accent); }
@media (max-width: 700px) { .ci-liste .rev-grid { padding-left: 8px; } }

/* ─── Matière sans chapitres pour l'instant ─── */
.ci-venir { margin: 0; padding: 36px 0; border-top: 1px solid #1f1f22; font-family: 'Newsreader', Georgia, serif;
  font-size: 1.25rem; color: #a3a29c; }

/* ─── Emplacement du prochain cours (liste encore courte) ─── */
.ci-prochain { display: flex; align-items: center; gap: 18px; min-height: 80px; padding: 18px 8px; box-sizing: border-box;
  border-bottom: 1px solid #1f1f22; color: #6b6a66; }
.ci-prochain .ci-num { color: #6b6a66; font-weight: 400; }
.ci-prochain .ci-nom { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: 1.15rem; }

/* ─── Liste à vignettes (index d'HGG) : l'image du chapitre remplace le repère numéroté ─── */
.ci-vig { position: relative; flex-shrink: 0; width: 112px; height: 72px; border-radius: 10px; overflow: hidden; background: #16161a; }
.ci-vig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-vig span { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(10,10,11,0.8);
  font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; color: var(--ci-accent); }
body.ci-vignettes .ci-liste .chapter-item { gap: 16px; min-height: 0; padding: 14px 4px; }
body.ci-vignettes .ci-nom { font-size: 1.12rem; }
@media (max-width: 600px) { .ci-vig { width: 96px; height: 62px; } }
