/* ============================================================
   LE WIKI : mise en page propre à la page wiki.html
   ------------------------------------------------------------
   style.css donne déjà les couleurs, les boutons, l'en-tête et le
   pied de page. Ce fichier n'ajoute que ce qui n'existe que sur le
   wiki : le sommaire de gauche, les tableaux, les encadrés.
   ============================================================ */

/* ---------- La bannière du haut ---------- */
.wiki-hero {
  padding: 110px 0 34px;
  background:
    radial-gradient(900px 300px at 15% 0%, rgba(111, 216, 60, .28), transparent 70%),
    radial-gradient(700px 280px at 85% 10%, rgba(76, 195, 255, .25), transparent 70%);
  border-bottom: var(--line);
}
.wiki-hero h1 { font-size: clamp(34px, 6vw, 60px); }
.wiki-hero p { max-width: 62ch; color: var(--ink-soft); font-size: 18px; }
.wiki-hero .kicker { margin-bottom: 10px; }

/* ---------- Deux colonnes : sommaire + contenu ---------- */
.wiki-layout {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 30px 0 70px;
}
@media (max-width: 950px) {
  .wiki-layout { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Le sommaire ---------- */
.toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
}
@media (max-width: 950px) {
  .toc { position: static; max-height: none; }
  .toc .toc-list { max-height: 320px; overflow: auto; }
}
.toc h2 {
  font-size: 19px;
  margin-bottom: 10px;
}
.toc-search {
  width: 100%;
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
  border: var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 12px;
}
.toc-search::placeholder { color: var(--muted); font-weight: 600; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.3;
}
.toc-list a:hover { background: rgba(111, 216, 60, .18); color: var(--ink); }
.toc-list a.on {
  background: linear-gradient(180deg, var(--grass-1), var(--grass-2));
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
.toc-group {
  margin: 14px 0 4px;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.toc-empty { color: var(--muted); font-size: 15px; padding: 8px 10px; }

/* ---------- Les articles ---------- */
.wiki-main { min-width: 0; }
.art {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 26px;
  scroll-margin-top: 96px;
}
@media (max-width: 560px) { .art { padding: 18px 16px; } }
.art > h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  margin-bottom: 6px;
}
.art > h2 .emo { margin-right: 8px; }
.art h3 {
  font-size: 20px;
  margin: 24px 0 8px;
  padding-top: 2px;
}
.art h3:first-of-type { margin-top: 16px; }
.art p { margin: 10px 0; }
.art ul, .art ol { margin: 10px 0; padding-left: 22px; }
.art li { margin: 5px 0; }
.art .lead { color: var(--ink-soft); font-size: 17.5px; }
.art strong { font-weight: 800; }

/* ---------- Tableaux ---------- */
.tbl-wrap { overflow-x: auto; margin: 14px 0; border-radius: 14px; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  min-width: 420px;
}
table.tbl th, table.tbl td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(22, 19, 31, .12);
  white-space: nowrap;
}
table.tbl th {
  background: rgba(111, 216, 60, .16);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: rgba(76, 195, 255, .10); }
table.tbl td.wrap-ok, table.tbl th.wrap-ok { white-space: normal; min-width: 180px; }
table.tbl .num { font-variant-numeric: tabular-nums; }

/* ---------- Encadrés ---------- */
.note {
  border: var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  background: rgba(76, 195, 255, .12);
  box-shadow: 0 4px 0 var(--ink);
}
.note.tip { background: rgba(111, 216, 60, .16); }
.note.warn { background: rgba(255, 168, 31, .18); }
.note.danger { background: rgba(255, 107, 107, .16); }
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.note .note-t {
  display: block;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 4px;
}

/* ---------- Petites étiquettes ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  white-space: nowrap;
}
.tag.r1 { background: #e9ebf0; }
.tag.r2 { background: #cdf3d6; }
.tag.r3 { background: #cfe3ff; }
.tag.r4 { background: #e8d4ff; }
.tag.r5 { background: #ffe8ad; }
.tag.r6 { background: #ffd4ee; }
.key-cap {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  border-radius: 8px;
  background: #fff;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Les étapes du guide de démarrage ---------- */
.steps-wiki { list-style: none; padding: 0; counter-reset: s; }
.steps-wiki > li {
  counter-increment: s;
  position: relative;
  padding: 2px 0 2px 48px;
  margin: 14px 0;
}
.steps-wiki > li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: var(--line); border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35);
  font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700;
  box-shadow: 0 3px 0 var(--ink);
}
.steps-wiki > li b { display: block; font-size: 17px; }

/* ---------- Grille de petites fiches ---------- */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.mini {
  border: var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
}
.mini b { display: block; font-family: 'Fredoka', system-ui, sans-serif; font-size: 17px; }
.mini span { font-size: 15px; color: var(--ink-soft); }

/* ---------- Le fil d'Ariane et le bouton « haut » ---------- */
.crumb { font-size: 15px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.crumb a { color: var(--blue-2); }
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 40;
  padding: 10px 16px;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .to-top { transition: none; }
}

/* ---------- Téléphone ---------- */
/* L'en-tête passe sur deux lignes sous 820 px (voir style.css) : les
   ancres doivent descendre d'autant, sinon le titre visé se retrouve
   caché derrière la barre du haut. */
@media (max-width: 820px) {
  .wiki-hero { padding: 26px 0 26px; }
  .wiki-hero p { font-size: 17px; }
  .art { scroll-margin-top: 128px; }
  .toc { top: 124px; }
}
