/* ============================================================
   STYLE GLOBAL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--tk-police-texte);
  font-size: var(--tk-taille-corps);
  color: var(--tk-couleur-texte);
  background: var(--tk-couleur-fond);
  line-height: 1.6;
}

a { color: var(--tk-couleur-lien); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Entête ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  height: 56px; padding: 0 var(--tk-gouttiere);
  background: var(--tk-couleur-primaire);
  box-shadow: 0 2px 4px rgba(0,0,0,.14);
}
.entete-accueil { display: flex; align-items: center; gap: 12px; }
.entete-titre { color: #fff; font-weight: 500; font-size: 1.25rem; }
.entete-accueil:hover { text-decoration: none; }
.entete-logo { height: 32px; width: auto; }

/* ---------- Disposition 3 colonnes (normale) ---------- */
.disposition {
  display: grid;
  grid-template-columns: var(--tk-largeur-navigation) 1fr var(--tk-largeur-sommaire);
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 56px - 60px);
}

/* ---------- Colonne gauche : navigation ---------- */
.barre-laterale {
  padding: var(--tk-gouttiere) 12px;
  background: var(--tk-couleur-fond-2);
  position: sticky; top: 56px;
  height: calc(100vh - 56px); overflow-y: auto;
}
.nav-liste { list-style: none; margin: 0; padding: 0; }
.nav-liste .nav-liste { padding-left: 14px; }
.nav-bascule {
  display: flex; align-items: center; width: 100%;
  padding: 6px 8px; border: none; cursor: pointer;
  background: transparent; color: inherit; text-align: left;
  font: inherit; border-radius: var(--tk-rayon-boite);
}
.nav-bascule:hover { background: var(--tk-couleur-primaire-clair); }
.nav-section-titre { font-weight: 500; }
.nav-lien {
  display: block; padding: 6px 8px 6px 26px;
  border-radius: var(--tk-rayon-boite);
}
.nav-lien:hover { background: var(--tk-couleur-primaire-clair); text-decoration: none; }
.nav-lien.actif { font-weight: 700; }

/* Chevron à la Material : triangle qui pivote */
.chevron {
  width: 0; height: 0; flex: none; margin-right: 6px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--tk-couleur-texte-secondaire);
  transform: rotate(0deg);
  transition: transform var(--tk-vitesse) ease;
}
.nav-section.ouvert > .nav-bascule .chevron { transform: rotate(90deg); }
.nav-section:not(.ouvert) > .nav-liste { display: none; }

/* ---------- Corps de page ---------- */
.corps {
  padding: var(--tk-gouttiere) calc(var(--tk-gouttiere) * 2);
  max-width: 56rem;
  min-width: 0;              /* ← LA ligne magique : autorise .corps à rétrécir */
  overflow-wrap: break-word; /* coupe les mots/URLs trop longs */
}

/* Les blocs de code défilent horizontalement dans leur boîte,
   au lieu d'élargir toute la page */
.page pre,
.page code {
  max-width: 100%;
  overflow-x: auto;
}

/* Idem pour les images et tableaux */
.page img { max-width: 100%; height: auto; }
.page table { display: block; overflow-x: auto; max-width: 100%; }
/* ---------- Colonne droite : sommaire ---------- */
.sommaire-page {
  padding: var(--tk-goutiere);
  position: sticky; top: 56px;
  height: calc(100vh - 56px); overflow-y: auto;
  font-size: .8rem;
}
.toc-titre { font-size: .8rem; text-transform: uppercase;
             letter-spacing: .05em; color: var(--tk-couleur-texte-secondaire); }
.toc-liste { list-style: none; padding-left: 0; margin-top: 8px;
             border-left: 2px solid var(--tk-couleur-bordure); }
.toc-entree { padding-left: 12px; margin: 6px 0; }
.toc-entree .toc-liste { border-left: none; padding-left: 8px; }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--tk-couleur-bordure); }
.pied-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 8px; max-width: 1440px; margin: 0 auto;
  padding: 16px var(--tk-goutriere);
  color: var(--tk-couleur-texte-secondaire); font-size: .75rem;
}

/* ---------- Adaptation mobile (1 colonne) ---------- */
@media (max-width: 1000px) {
  .sommaire-page { display: none; }
  .disposition { grid-template-columns: var(--tk-largeur-navigation) 1fr; }
}
@media (max-width: 700px) {
  .disposition { grid-template-columns: 1fr; }
  .barre-laterale { display: none; }
}
/* Icônes des sections — injectées par JS */
.sommaire-icon {
  margin-right: 10px;
  color: var(--tk-couleur-primaire);
  font-size: 2rem;
  vertical-align: middle;
}

/* ============================================================
   PAGE D'ACCUEIL
   ============================================================ */
.disposition-accueil{
  display:block !important;
}

/* ============================================================
   BLOC CHAPEAU (sur les pages)
   ============================================================ */
.chapeau {
  font-size: var(--tk-taille-chapeau);   /* défini dans tokens.css : 1.15rem */
  line-height: 1.6;
  color: var(--tk-couleur-texte);
  margin: 0 0 1.5em;
}
