/* ============================================================
   GUIDE DES ÉCOLES K-12 — FLORIDE
   Système graphique identique au Guide des licences (Terre & Ocre),
   pour une cohérence visuelle immédiate entre les deux guides.
   Copie du fichier licences/assets/style.css — ne pas diverger
   sans raison ; toute évolution commune doit être répercutée
   dans les deux guides.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy:        #36302A;
  --navy-light:  #4A3D2E;
  --gold:        #97742F;
  --gold-light:  #B8924A;
  --white:       #FFFFFF;
  --off-white:   #F3EEE4;
  --gray-light:  #E7E0D2;
  --gray:        #6B6457;
  --text:        #2E2A22;
  --text-light:  #6B6457;
  --border:      #DCD4C4;

  --cat1:        #6E7B5C;
  --cat1-bg:     #EEF0E7;
  --cat2:        #36302A;
  --cat2-bg:     #E7E0D2;
  --cat3:        #8B4A3B;
  --cat3-bg:     #F1E3DE;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, monospace;

  --radius:      6px;
  --radius-lg:   12px;
  --shadow:      0 2px 12px rgba(54,48,42,.08);
  --shadow-lg:   0 8px 32px rgba(54,48,42,.12);

  --max-w:       1160px;
  --content-w:   740px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-sans); color: var(--text); background: var(--off-white); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; color: var(--navy); }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 600; margin: 2.4em 0 .9em; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.8em 0 .7em; }
h4 { font-size: 1rem; font-weight: 600; font-family: var(--font-sans); margin: 1.4em 0 .5em; }
p { color: var(--text); margin-bottom: 1em; }
p.lead { font-size: 1.1rem; color: var(--text-light); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(243,238,228,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.topbar__brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; }
.topbar__brand-name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.topbar__brand-sub { font-size: .62rem; font-weight: 500; letter-spacing: .08em; color: var(--gray); text-transform: uppercase; }
.topbar__nav { display: flex; gap: 22px; align-items: center; }
.topbar__nav a { font-size: .82rem; font-weight: 500; color: var(--text-light); }
.topbar__nav a:hover, .topbar__nav a.active { color: var(--navy); }
.topbar__back {
  font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px;
  text-decoration: none; white-space: nowrap;
}
.topbar__back:hover { border-color: var(--gold); color: var(--gold); }

.book-layout {
  display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 56px;
  max-width: var(--max-w); margin: 0 auto; padding: 48px 24px 96px;
  align-items: start;
}
.toc {
  position: sticky; top: 88px;
  max-height: calc(100vh - 88px - 24px);
  overflow-y: auto;
  border-right: 1px solid var(--border); padding-right: 28px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.toc__part { margin-bottom: 22px; }
.toc__part-label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.toc__part ul { display: flex; flex-direction: column; gap: 6px; }
.toc__part a { font-size: .85rem; color: var(--text-light); display: block; padding: 3px 0; }
.toc__part a:hover, .toc__part a.current { color: var(--navy); font-weight: 600; }
.toc__part a.disabled { color: var(--gray); opacity: .55; cursor: default; }
.toc__sub {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 6px 4px; padding-left: 10px;
  border-left: 1px solid var(--border);
}
.toc__sub a { font-size: .76rem; padding: 2px 0; }

.content { max-width: var(--content-w); }
.content > p, .content > ul, .content > ol, .content > table, .content > .callout { max-width: var(--content-w); }

.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.divider { width: 44px; height: 3px; background: var(--gold); border-radius: 2px; margin: 18px 0 30px; }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  font-size: .78rem; color: var(--gray); margin-bottom: 8px;
}
.meta-row strong { color: var(--text); font-weight: 600; }

/* ── Glossaire : terme en infobulle (mouse-over) ────────── */
.gloss-term {
  position: relative;
  border-bottom: 1px dotted var(--gold);
  cursor: help;
  outline: none;
}
.gloss-term .gloss-tip {
  position: absolute;
  left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 260px;
  background: var(--navy); color: var(--white);
  font-family: var(--font-sans); font-size: .78rem; font-weight: 400; line-height: 1.5;
  padding: 10px 13px; border-radius: 8px; box-shadow: var(--shadow);
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 60;
}
.gloss-term .gloss-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--navy);
}
.gloss-term:hover .gloss-tip,
.gloss-term:focus .gloss-tip,
.gloss-term--active .gloss-tip {
  visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0);
}
@media (max-width: 480px) {
  .gloss-term .gloss-tip { max-width: 200px; font-size: .74rem; }
}

/* ── Callouts / notes ───────────────────────────────────── */
.callout {
  border-left: 3px solid var(--gold); background: #FBF8F1;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; margin: 22px 0;
  font-size: .92rem; color: var(--text-light);
}
.callout h4 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.callout--risk { border-left-color: var(--cat3); }
.callout--risk h4 { color: var(--cat3); }
.callout--law { border-left-color: var(--navy); background: var(--off-white); }
.callout--law h4 { color: var(--navy); }
.callout--law blockquote { font-style: italic; color: var(--text); font-size: .9rem; line-height: 1.7; margin-top: 6px; }

/* ── Tableaux ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 20px 0 28px; font-size: .88rem; }
th { background: #FBF8F1; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-light); padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
td strong { color: var(--navy); }
tr:last-child td { border-bottom: none; }

/* ── Sources / footnotes ────────────────────────────────── */
.sources { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); }
.sources h4 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gray); margin-bottom: 12px; }
.sources ol { display: flex; flex-direction: column; gap: 8px; }
.sources li { font-size: .8rem; color: var(--text-light); padding-left: 1.4em; text-indent: -1.4em; }
.sources a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.last-verified {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: .74rem; color: var(--gray); font-family: var(--font-mono);
}

/* ── Dropdown nav (topbar interne au guide) ──────────────── */
.nav__dropdown { position: relative; align-self: stretch; display: flex; align-items: center; }
.nav__dropdown > a { display: flex; align-items: center; gap: 5px; height: 100%; font-size: .82rem; font-weight: 500; color: var(--text-light); }
.nav__dropdown > a::after { content: '▾'; font-size: .6rem; }
.nav__dropdown:hover > a, .nav__dropdown:focus-within > a { color: var(--navy); }
.nav__dropdown-menu {
  display: none; position: absolute; top: 100%; left: -14px;
  background: #FBF8F1; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg);
  min-width: 250px; padding: 6px 0; z-index: 200;
}
.nav__dropdown-menu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav__dropdown:hover .nav__dropdown-menu, .nav__dropdown:focus-within .nav__dropdown-menu { display: block; }
.nav__dropdown-menu li a { display: block; padding: 9px 18px; font-size: .82rem; color: var(--text-light); }
.nav__dropdown-menu li a:hover { color: var(--navy); background: var(--gray-light); }

/* ── Grappes / cluster (réutilisé pour le sommaire) ──────── */
.cluster { margin: 20px 0 36px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cluster__head { background: #FBF8F1; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.cluster__head h4 { font-family: var(--font-serif); font-size: 1.05rem; margin: 0 0 4px; }
.cluster__head p { font-size: .84rem; color: var(--text-light); margin: 0; }
.cluster__body { padding: 4px 22px 18px; }

/* ── Cross-links entre chapitres ───────────────────────── */
.crosslink {
  display: flex; gap: 16px; align-items: center;
  background: var(--navy); border-radius: var(--radius-lg); padding: 22px 26px; margin: 26px 0;
}
.crosslink__icon { font-size: 1.4rem; flex-shrink: 0; }
.crosslink__body h4 { color: var(--gold); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; font-family: var(--font-sans); }
.crosslink__body p { color: rgba(255,255,255,.8); font-size: .88rem; margin: 0 0 8px; }
.crosslink__body a { color: var(--white); font-weight: 600; font-size: .86rem; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }

.chapter-hero { margin-bottom: 8px; }

/* ── Cartes de ressources (liens de vérification externes) ─ */
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0 8px; }
.resource-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.resource-card h4 { font-family: var(--font-serif); font-size: 1rem; margin: 0 0 6px; }
.resource-card p { font-size: .84rem; color: var(--text-light); margin-bottom: 10px; }
.resource-card__tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.resource-card a.resource-card__link { font-size: .82rem; font-weight: 600; color: var(--navy); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
@media (max-width: 640px) { .resource-grid { grid-template-columns: 1fr; } }

/* ── Badge de type d'école (secteur / magnet / charter / privé) */
.type-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 20px; border: 1.5px solid var(--gold);
  color: var(--gold); background: transparent; margin: 0 6px 6px 0;
}

/* ── Responsive : mobile / iPhone ────────────────────────
   Le book-layout est en grille 2 colonnes (sidebar 250px fixe +
   contenu) sans repli mobile dans la maquette d'origine — sans
   ce bloc, le contenu se retrouve compressé dans une colonne
   très étroite sur un écran de téléphone. */
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .topbar__inner { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px 0; }
  .topbar__nav {
    width: 100%; gap: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
  }
  .topbar__nav::-webkit-scrollbar { display: none; }
  .topbar__nav a { white-space: nowrap; }
  .book-layout {
    grid-template-columns: 1fr; gap: 24px;
    padding: 28px 16px 64px;
  }
  .toc {
    position: static; max-height: none; overflow-y: visible;
    border-right: none; padding-right: 0;
    border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 4px;
  }
  .content { max-width: 100%; }
  .content > p, .content > ul, .content > ol, .content > table, .content > .callout { max-width: 100%; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .resource-grid { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .toc { display: none; }
  .book-layout { grid-template-columns: 1fr; padding: 0; }
}
