/* ==========================================================================
   Aide (/aide) — le guide de l'équipe, dans le site (même contenu que docs/GUIDE_EQUIPE.md).
   À l'écran : des sections repliables (details / summary), gros titres, lisible sur téléphone.
   À l'impression : tout est ouvert, noir sur blanc, 3 à 4 pages A4 (voir /js/pages/aide.js).
   ========================================================================== */
.aide { max-width: 860px; margin: 0 auto 20px; color: var(--noir); }
.aide-outils { display: flex; flex-wrap: wrap; gap: 10px; }
.aide-tete { display: none; } /* l'en-tête avec le logo ne sert que sur le papier */

/* ---------- Sommaire : trois gros liens ---------- */
.aide-sommaire { display: grid; gap: 10px; margin-bottom: 26px; }
.aide-sommaire a {
  display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 16px;
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
  color: var(--noir); text-decoration: none; line-height: 1.25; color: var(--texte-doux);
  transition: transform var(--rapide) ease-out;
}
.aide-sommaire a:active { transform: scale(.985); }
.aide-sommaire strong {
  display: block; color: var(--noir);
  font-family: var(--police-titre); font-weight: 800; font-size: 1.45rem; line-height: 1.1; text-transform: uppercase;
}
@media (min-width: 760px) { .aide-sommaire { grid-template-columns: repeat(3, 1fr); } }

.aide-lettre {
  flex: none; width: 1.75em; height: 1.75em; border-radius: 50%; border: 2px solid var(--noir);
  display: inline-grid; place-items: center; background: var(--jaune); color: var(--noir);
  font-family: var(--police-titre); font-weight: 800; font-size: 1.35rem; line-height: 1;
}
.aide-lettre-alerte { background: var(--noir); color: var(--jaune); }

/* ---------- Les parties et leurs sections repliables ---------- */
.aide-partie { margin: 0 0 30px; scroll-margin-top: 12px; }
.aide-partie > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 1.9rem; line-height: 1.05; }
.aide-partie > h2 .aide-lettre { font-size: 1.25rem; }

.aide-section {
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
  margin-bottom: 10px; overflow: hidden;
}
.aide-section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 16px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  font-family: var(--police-titre); font-weight: 700; font-size: 1.45rem; line-height: 1.12;
}
.aide-section > summary::-webkit-details-marker { display: none; }
.aide-section > summary > span:not(.aide-numero) { flex: 1; min-width: 0; }
.aide-section > summary small { font-family: var(--police); font-weight: 500; font-size: .95rem; color: var(--texte-doux); white-space: nowrap; }
@media (max-width: 520px) { .aide-section > summary small { display: block; white-space: normal; } }
/* La flèche : un chevron dessiné en CSS, qui se retourne quand la section est ouverte. */
.aide-section > summary::after {
  content: ''; flex: none; width: 12px; height: 12px; margin: 0 6px 4px 4px;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg); transition: transform var(--normal) var(--sortie);
}
.aide-section[open] > summary::after { transform: translateY(5px) rotate(225deg); }
.aide-section[open] > summary { border-bottom: 1px solid var(--bordure); background: #fffbe0; }
.aide-section > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.aide-numero {
  flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--surface-2);
  display: inline-grid; place-items: center; font-weight: 800; font-size: 1.2rem; line-height: 1;
}
.aide-pannes .aide-section > summary { border-left: 6px solid var(--jaune); }

.aide-corps { padding: 14px 16px 16px; font-size: 1.08rem; line-height: 1.5; }
.aide-corps > :first-child { margin-top: 0; }
.aide-corps > :last-child { margin-bottom: 0; }
.aide-corps p { margin: 0 0 10px; }
.aide-corps h3 { margin: 16px 0 6px; font-size: 1.3rem; }
.aide-corps ol, .aide-corps ul { margin: 0 0 10px; padding-left: 1.35em; }
.aide-corps li { margin: 0 0 9px; padding-left: .15em; }
.aide-corps li > ul { margin: 8px 0 0; }
.aide-corps ol > li::marker { font-weight: 700; }
.aide-corps code { font-size: .95em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); white-space: nowrap; }
.aide-encadre, .aide-corps li.aide-important {
  border-left: 5px solid var(--jaune); background: #fffbe0; border-radius: 0 var(--rayon) var(--rayon) 0; padding: 9px 12px;
}
.aide-corps li.aide-important { margin-left: -.35em; }
.aide-tire { color: var(--vert-fonce); }
.aide-pas-parti { color: var(--rouge); }
.aide-corps .btn { margin-top: 4px; }

/* ---------- Impression : le guide seul, tout ouvert ---------- */
@page { size: A4; margin: 12mm 13mm; }
@media print {
  html, body { height: auto !important; background: #ffffff !important; }
  /* Le cadre du site (grille de la hauteur de l'écran, contenu qui défile) ne s'imprime pas : page normale. */
  body { display: block !important; overflow: visible !important; }
  body > main { overflow: visible !important; padding: 0 !important; position: static !important; }
  .haut, .nav-bas, .lien-evitement, .toasts, .sans-impression { display: none !important; }
  .aide { max-width: none; margin: 0; font-size: 10pt; }
  .aide-tete { display: flex; align-items: center; gap: 16px; padding-bottom: 3mm; margin-bottom: 4mm; border-bottom: 3px solid var(--noir); }
  .aide-tete img { height: 13mm; width: auto; flex: none; }
  .aide-titre { margin: 0 0 1mm; font-family: var(--police-titre); font-weight: 800; text-transform: uppercase; font-size: 17pt; line-height: 1.05; }
  .aide-sous-titre { margin: 0; font-size: 10pt; }
  .aide-partie { margin-bottom: 4mm; }
  .aide-partie > h2 { font-size: 15pt; margin-bottom: 2.5mm; break-after: avoid; }
  .aide-partie > h2 .aide-lettre { font-size: 11pt; }
  .aide-section { border: 0; box-shadow: none; border-radius: 0; margin-bottom: 2.2mm; overflow: visible; }
  /* Une section fermée s'imprime quand même (secours si le script n'a pas pu les ouvrir). */
  .aide-section::details-content { content-visibility: visible !important; display: block !important; }
  .aide-section > summary, .aide-section[open] > summary {
    min-height: 0; padding: 0 0 .8mm; gap: 2mm; font-size: 12pt; background: none; border: 0; border-bottom: 1px solid #999; break-after: avoid;
  }
  .aide-section > summary::after { display: none; }
  .aide-section > summary small { font-size: 9pt; color: #333; }
  .aide-numero { width: 1.5em; height: 1.5em; font-size: 10pt; border: 1.5px solid var(--noir); background: none; }
  .aide-pannes .aide-section > summary { border-left: 0; }
  .aide-pannes .aide-section { break-inside: avoid; }
  /* Les pannes sur deux colonnes : le guide tient sur 3 pages. */
  .aide-pannes { columns: 2; column-gap: 8mm; }
  .aide-pannes > h2 { column-span: all; }
  .aide-corps { padding: 1.2mm 0 0; font-size: 9.7pt; line-height: 1.28; } /* (revue) 9,7 pt : le guide complété tient toujours sur 3 pages */
  .aide-corps p { margin-bottom: 1.2mm; }
  .aide-corps h3 { font-size: 11pt; margin: 2mm 0 1mm; break-after: avoid; }
  .aide-corps ol, .aide-corps ul { margin-bottom: 1.4mm; }
  .aide-corps li { margin-bottom: .8mm; break-inside: avoid; }
  .aide-corps li > ul { margin-top: 1mm; }
  .aide-encadre, .aide-corps li.aide-important { padding: 1mm 2.5mm; border-left-width: 3px; }
  .aide-lettre, .aide-encadre, .aide-corps li.aide-important, .aide-corps code { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .aide-tire, .aide-pas-parti { color: var(--noir); }
  .entree { animation: none !important; }
  a { text-decoration: none; }
}
