/*
 * Punchbox — (c) 2026 Alexis Clement. Tous droits reserves.
 *
 * manuel.css — MISE EN PAGE du manuel utilisateur (mission pb-manuel-utilisateur).
 * STRUCTURE UNIQUEMENT. Aucune couleur hors charte : on ne fait que réutiliser
 * les variables de thème de style.css (--fond, --texte, --carte, --bordure,
 * --laiton-texte, --vert-texte…), donc les contrastes des DEUX thèmes sont
 * hérités et prouvés. Rayons FRANCS 2 px (arbitrage A019), comme la console :
 * on ramène les jetons de rayon à 2 px sur .page-manuel, aucun rayon > 2 px.
 * Règle 12 : on met en COLONNES (sommaire + corps), on n'empile pas.
 */

/* Rayons francs 2 px, comme la console (.page-app). Aucune ombre lourde. */
.page-manuel {
  --rayon:   2px;
  --rayon-s: 2px;
  --rayon-g: 2px;
}

/* ── Tête du manuel ─────────────────────────────────────────────────────── */
.manuel { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.manuel-tete { max-width: 68ch; }
.manuel-tete h1 { margin: 4px 0 12px; line-height: 1.15; }
.manuel-chapo { font-size: 1.1rem; line-height: 1.6; color: var(--texte); margin: 0 0 12px; }
.manuel-repli {
  font-size: .92rem; line-height: 1.55; color: var(--secondaire);
  border-inline-start: 2px solid var(--laiton); padding-inline-start: 12px; margin: 0;
}

/* ── Grille SOMMAIRE + CORPS (règle 12 : colonnes, pas d'empilement) ─────── */
.manuel-grille { display: block; margin-top: 28px; }

@media (min-width: 900px) {
  .manuel-grille {
    display: grid;
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
}

/* ── Sommaire (colonne latérale collante sur grand écran) ────────────────── */
.manuel-sommaire {
  background: var(--fond-alt);
  border: 1px solid var(--bordure);
  border-radius: 2px;
  padding: 16px;
  margin-bottom: 28px;
}
@media (min-width: 900px) {
  .manuel-sommaire { position: sticky; top: 16px; margin-bottom: 0; max-height: calc(100vh - 32px); overflow: auto; }
}
.manuel-sommaire-titre { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; }
.manuel-recherche { margin-bottom: 14px; }
.manuel-recherche .entree { width: 100%; }
.manuel-recherche-etat { margin: 6px 0 0; font-size: .82rem; color: var(--secondaire); min-height: 1.1em; }

.manuel-toc { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.manuel-toc li { margin: 0; }
.manuel-toc a {
  display: block; padding: 7px 10px; border-radius: 2px;
  color: var(--texte); text-decoration: none; line-height: 1.35;
  border-inline-start: 2px solid transparent;
}
.manuel-toc a:hover { background: var(--carte); }
.manuel-toc a.actif {
  border-inline-start-color: var(--laiton);
  background: var(--carte); font-weight: 600;
}
.manuel-toc a[hidden] { display: none; }

/* ── Corps ──────────────────────────────────────────────────────────────── */
.manuel-corps { min-width: 0; }
.manuel-chap { margin: 0 0 44px; scroll-margin-top: 16px; }
.manuel-chap > h2 {
  border-bottom: 2px solid var(--laiton);
  padding-bottom: 8px; margin: 0 0 16px; line-height: 1.2;
}
.manuel-chap h3 { margin: 26px 0 8px; line-height: 1.25; }
.manuel-chap p { line-height: 1.65; margin: 0 0 12px; max-width: 72ch; }
.manuel-chap em { color: var(--laiton-texte); font-style: normal; font-weight: 600; }

/* Pas à pas numérotés + listes */
.manuel-pas, .manuel-liste { max-width: 72ch; line-height: 1.6; }
.manuel-pas > li { margin: 0 0 12px; padding-inline-start: 4px; }
.manuel-liste > li { margin: 0 0 10px; }

/* Encadrés discrets (astuce, note) — bord franc, teinte laiton douce */
.manuel-astuce, .manuel-note {
  max-width: 72ch; line-height: 1.6; border-radius: 2px;
  padding: 12px 14px; margin: 14px 0;
  background: var(--fond-alt); border: 1px solid var(--bordure);
  border-inline-start: 2px solid var(--laiton);
}
.manuel-note { font-size: .92rem; color: var(--secondaire); }

/* Tableaux (raccourcis) — colonnes lisibles, bords francs */
.manuel-table {
  width: 100%; max-width: 72ch; border-collapse: collapse; margin: 8px 0 12px;
  border: 1px solid var(--bordure); border-radius: 2px; overflow: hidden;
}
.manuel-table th, .manuel-table td {
  text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--bordure);
  vertical-align: top; line-height: 1.5;
}
.manuel-table thead th { background: var(--fond-alt); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.manuel-table tbody tr:last-child td { border-bottom: 0; }
.manuel-table td:first-child { white-space: nowrap; }
.manuel-ou { color: var(--secondaire); }

/* kbd — touche, bord franc (déjà cadré par style.css sur .page-app ; on le
   pose ici pour la page-doc du manuel). */
.page-manuel kbd {
  display: inline-block; font: inherit; font-size: .85em; line-height: 1;
  padding: 3px 7px; border-radius: 2px;
  border: 1px solid var(--bordure-forte); background: var(--fond-alt); color: var(--texte);
}
.page-manuel code {
  font-size: .9em; padding: 1px 5px; border-radius: 2px;
  background: var(--fond-alt); border: 1px solid var(--bordure);
}

/* Glossaire — deux colonnes sur grand écran (règle 12) */
.manuel-glossaire { margin: 8px 0 0; }
.manuel-glossaire > div { margin: 0 0 14px; }
.manuel-glossaire dt { font-weight: 700; margin: 0 0 3px; }
.manuel-glossaire dd { margin: 0; line-height: 1.6; color: var(--texte); }
@media (min-width: 720px) {
  .manuel-glossaire { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
}

.manuel-retour { margin-top: 8px; }
.manuel-retour a { font-weight: 600; }

/* Résultat de recherche : chapitre masqué */
.manuel-chap[hidden] { display: none; }
.manuel-terme { background: var(--laiton); color: var(--sur-laiton); border-radius: 2px; padding: 0 2px; }
