/* Le tutoriel « Refaire ce jeu dans ta commune » (tutoriel.html).
   Lecture d'abord : le texte est dans la page, le script n'ajoute que le bouton « Copier » et l'entrée courante
   du sommaire. Les couleurs ne portent jamais seules un sens ; le focus reste visible ; 390 px sans défilement
   horizontal ; au doigt, toute commande fait 44 px de haut au moins (contrôle tutoriel-page et pwa-cibles). */

.evitement { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--or); color: #1b160d; font-weight: 700; border-radius: 8px; text-decoration: none; }
.evitement:focus { top: 8px; }

.tuto-tete { padding: clamp(28px, 5vw, 60px) 0 6px; }
.tuto-tete .titre-bd { margin: 8px 0 16px; overflow-wrap: anywhere; }
.tuto-tete .chapeau { margin: 0; max-width: 62ch; }

.tuto-corps { padding: 18px 0 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.tuto-corps > * { min-width: 0; }
.tuto-corps h2 { font-size: clamp(22px, 2.8vw, 30px); margin: 0 0 12px; color: var(--or-clair); letter-spacing: -.01em; }
.tuto-corps h3 { font-size: clamp(19px, 2.3vw, 24px); margin: 0 0 10px; color: var(--creme); display: flex; gap: 12px; align-items: baseline; }
.tuto-corps h4 { margin: 20px 0 6px; font: 600 12px/1.4 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--or); }
.tuto-corps p, .tuto-corps li { line-height: 1.6; overflow-wrap: anywhere; }
.tuto-corps p { max-width: 70ch; }
.tuto-corps ul, .tuto-corps ol { margin: 8px 0 12px; padding-left: 22px; }
.tuto-corps li { margin: 6px 0; }
.tuto-corps code { font: 500 .9em var(--mono); background: rgba(232, 180, 92, .11); padding: .08em .35em; border-radius: 5px; overflow-wrap: anywhere; }

/* le sommaire : des liens pleine largeur, faciles au doigt */
.sommaire h2 { margin-bottom: 8px; }
.sommaire ol, .sommaire ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 2px; }
.sommaire li { margin: 0; }
.sommaire a { display: flex; gap: 12px; align-items: baseline; min-height: 44px; padding: 10px 8px; border-radius: 8px; text-decoration: none; color: var(--texte); }
.sommaire a:hover { background: var(--or-voile); color: var(--texte); }
.sommaire a[aria-current="location"] { background: var(--or-voile); box-shadow: inset 3px 0 0 var(--or); }
.sommaire-num, .etape-num { flex: none; min-width: 1.7em; text-align: center; font: 700 .9em var(--mono); color: #1b160d; background: var(--or); border-radius: 6px; padding: .1em .4em; }
.sommaire-autres { border-top: 1px solid var(--bord); padding-top: 8px; }

.etapes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.etapes-titre { margin: 8px 0 0; }
.but { font-size: 1.04em; color: var(--texte); margin: 0 0 4px; }
.actions li > .cmd { margin-top: 8px; }
.encadre h2, .tuto-bloc h2 { margin-bottom: 10px; }
.en-dur li { margin: 4px 0; }
.en-dur { columns: 1; }
@media (min-width: 900px) { .en-dur { columns: 2; column-gap: 28px; } .en-dur li { break-inside: avoid; } }

/* les commandes : un bloc qui défile au besoin, et le bouton « Copier » que le script ajoute */
.cmd { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.cmd pre { flex: 1 1 260px; min-width: 0; max-width: 100%; margin: 0; padding: 12px 14px; overflow-x: auto; background: var(--abysse); border: 1px solid var(--bord); border-radius: 10px; font: 500 14px/1.5 var(--mono); color: var(--creme); white-space: pre; }
.cmd pre code { background: none; padding: 0; font: inherit; overflow-wrap: normal; }
.cmd pre:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.cmd .copier { align-self: center; min-height: 40px; }
@media (pointer: coarse) { .bouton--petit, .cmd .copier { min-height: 44px; } }

.tuto-bloc .actions, p.actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.tuto-bloc .bouton { min-height: 44px; }

@media (max-width: 520px) {
  .tuto-corps { gap: 16px; }
  .panneau--pad { padding: 18px 16px; }
  .tuto-corps h3 { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) { .sommaire a { transition: none; } }
/* tableau des paliers (chantier CHF) : tableau lisible au bureau, fiches empilées sur téléphone */
.tableau-paliers { margin: 8px 0 12px; }
.tableau-paliers:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
table.paliers { width: 100%; border-collapse: collapse; font-size: .96em; }
table.paliers th, table.paliers td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--bord); }
table.paliers thead th { font: 600 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--or); }
table.paliers tbody th { color: var(--creme); font-weight: 600; white-space: nowrap; }
table.paliers .fourchette { color: var(--or-clair); font-weight: 600; }
@media (max-width: 760px) {
  table.paliers, table.paliers tbody, table.paliers tr, table.paliers td, table.paliers tbody th { display: block; width: auto; }
  table.paliers thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.paliers tr { padding: 10px 0; border-bottom: 1px solid var(--bord); }
  table.paliers th, table.paliers td { border: 0; padding: 3px 0; white-space: normal; }
  table.paliers td::before { content: attr(data-label) " : "; font-weight: 600; color: var(--or); }
}

@media print {
  .barre, .pied, .evitement, .copier, .sommaire { display: none !important; }
  body { background: #fff; color: #000; }
  .panneau { background: none !important; border: 1px solid #999; }
  .tuto-corps h2, .tuto-corps h3, .tuto-corps h4 { color: #000; }
  .cmd pre { background: #f3f3f3; color: #000; white-space: pre-wrap; overflow: visible; }
}

/* V7E1 : « Refaire ce jeu dans ta commune » en tête, ses étapes numérotées et l'encadré repliable du vocabulaire
   technique ; au doigt, le titre de l'encadré fait 44 px de haut au moins */
.tuto-commune h3, #pourquoi-2d h3 { margin-top: 18px; }
.tuto-corps ol.pas { padding-left: 26px; }
.plus-loin { margin-top: 16px; border-top: 1px solid rgba(243, 236, 224, .16); padding-top: 6px; }
.plus-loin summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--or-clair); font-weight: 600; }
.plus-loin summary:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 2px; border-radius: 6px; }
#origine q { font-style: italic; }
#origine .source { font-size: .92em; color: var(--texte-doux, var(--texte)); }
