/* aide/gabarit/aide.css — l'aide en ligne de CityHally (lot W2, 6 décembre 2026)
 *
 * Une seule feuille pour tout le wiki et pour l'impression des livrets PDF.
 * Aucune ressource extérieure : la police Archivo est servie par le site
 * (licence OFL, polices/OFL-Archivo.txt). Les teintes des applications sont
 * posées par une classe sur <body> (`app-techcity`…), écrite par la
 * construction depuis la roue municipale (commun/lib.js, THEMES).
 */

@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url('polices/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: italic; font-weight: 400; font-display: swap; src: url('polices/archivo-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url('polices/archivo-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; font-display: swap; src: url('polices/archivo-latin-700-normal.woff2') format('woff2'); }

:root {
  --primaire: #465463;
  --fonce: #35414E;
  --voile: #F3F5F8;
  --texte: #1e293b;
  --texte-doux: #475569;
  --fond: #ffffff;
  --fond-doux: #f8fafc;
  --bord: #e2e8f0;
  --bord-fort: #94a3b8;
  --focus: #1d4ed8;
  --alerte-fond: #FFFBEB; --alerte-bord: #F59E0B;
  --ok-fond: #F0FDF4; --ok-bord: #16A34A;
  --largeur-sommaire: 300px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font: 400 1rem/1.6 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--fonce); text-underline-offset: 2px; }
a:hover { color: var(--primaire); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .92em; background: var(--voile); color: var(--fonce); padding: 1px 4px; border-radius: 4px; }

.ch-lecteur-seul { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.evitement { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fond); padding: 8px 12px; border: 2px solid var(--focus); border-radius: 6px; }
.evitement:focus { left: 8px; }

/* ── L'en-tête ── */
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--fond); border-bottom: 3px solid var(--primaire); min-height: 60px; }
.entete .marque { font-weight: 700; font-size: 1.05rem; color: var(--texte); text-decoration: none; white-space: nowrap; }
.entete .marque span { color: var(--primaire); }
.entete form { flex: 1; display: flex; gap: 6px; max-width: 520px; margin-left: auto; }
.entete input[type=search] { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--bord-fort); border-radius: 8px; min-height: 44px; }
.entete button, .bouton { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--primaire); background: var(--primaire); color: #fff; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.bouton.secondaire { background: var(--fond); color: var(--fonce); border-color: var(--bord-fort); }
.entete .pdf { white-space: nowrap; }

/* ── Le cadre : le sommaire à gauche, la page à droite ── */
.cadre { display: grid; grid-template-columns: var(--largeur-sommaire) minmax(0, 1fr); min-height: calc(100vh - 63px); }
.sommaire { border-right: 1px solid var(--bord); background: var(--fond-doux); }
.sommaire > summary { display: none; }
.sommaire-defile { position: sticky; top: 63px; max-height: calc(100vh - 63px); overflow-y: auto; padding: 16px 12px 40px; font-size: .94rem; }
.sommaire ul { list-style: none; margin: 0; padding: 0; }
.sommaire li { margin: 0; }
.sommaire a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--texte); text-decoration: none; }
.sommaire a:hover { background: var(--voile); }
.sommaire a[aria-current="page"] { background: var(--voile); color: var(--fonce); font-weight: 700; box-shadow: inset 3px 0 0 var(--primaire); }
.sommaire details > summary { cursor: pointer; padding: 6px 10px; border-radius: 6px; font-weight: 600; list-style-position: outside; margin-left: 14px; }
.sommaire details > summary:hover { background: var(--voile); }
.sommaire .app > summary { font-weight: 700; }
.sommaire .app > ul, .sommaire .livret > ul { padding-left: 14px; }
.sommaire .ancres { padding-left: 14px; border-left: 2px solid var(--bord); margin: 2px 0 6px 14px; }
.sommaire .ancres a { padding: 3px 10px; font-size: .88rem; color: var(--texte-doux); }
.sommaire .accueil { font-weight: 700; margin-bottom: 8px; }

/* ── La page ── */
main { padding: 24px 40px 80px; max-width: 900px; width: 100%; }
.ariane ol { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 4px; font-size: .9rem; color: var(--texte-doux); }
.ariane li + li::before { content: "›"; margin: 0 6px 0 2px; }
.ariane a { color: var(--texte-doux); }
article h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 18px; color: var(--fonce); padding-bottom: 10px; border-bottom: 3px solid var(--primaire); }
article h2 { font-size: 1.35rem; line-height: 1.3; margin: 34px 0 10px; color: var(--texte); }
article h3 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--fonce); }
article p { margin: 0 0 12px; }
article ul, article ol { margin: 0 0 14px; padding-left: 1.5em; }
article li { margin: 0 0 6px; }
article ol.etapes { counter-reset: etape; list-style: none; padding-left: 0; }
article ol.etapes > li { counter-increment: etape; position: relative; padding-left: 40px; min-height: 28px; }
article ol.etapes > li::before { content: counter(etape); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 999px; background: var(--primaire); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.centre { text-align: center; }
.manquant { color: #B45309; }

.encart { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin: 14px 0 18px; border-left: 5px solid var(--primaire); background: var(--voile); border-radius: 0 8px 8px 0; }
.encart p { margin: 0; }
.encart-alerte { border-color: var(--alerte-bord); background: var(--alerte-fond); }
.encart-ok { border-color: var(--ok-bord); background: var(--ok-fond); }
.encart-picto { font-size: 1.2rem; line-height: 1.4; }

.capture { margin: 18px auto 22px; text-align: center; }
.capture img { border: 1px solid var(--bord); border-radius: 8px; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.capture.etroite img { max-width: min(100%, 340px); }
.capture-lien { display: inline-block; cursor: zoom-in; }
.capture figcaption { font-size: .9rem; font-style: italic; color: var(--texte-doux); margin-top: 8px; }

.tableau { overflow-x: auto; margin: 14px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th { background: var(--primaire); color: #fff; text-align: left; font-weight: 700; padding: 8px 12px; }
td { border: 1px solid var(--bord); padding: 8px 12px; vertical-align: top; }
tr:nth-child(even) td { background: var(--fond-doux); }

.suite { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--bord); }
.suite a { display: block; max-width: 48%; padding: 10px 14px; border: 1px solid var(--bord); border-radius: 8px; text-decoration: none; }
.suite a:hover { border-color: var(--primaire); }
.suite .sens { display: block; font-size: .82rem; color: var(--texte-doux); }
.suite .suivante { margin-left: auto; text-align: right; }
.pied { margin-top: 28px; font-size: .85rem; color: var(--texte-doux); }

/* ── Les pages d'accueil ── */
.presentation { background: var(--voile); border-radius: 12px; padding: 24px 28px; margin: 0 0 24px; }
.presentation .picto { font-size: 2.2rem; }
.presentation h1 { border: 0; padding: 0; margin: 4px 0 6px; }
.presentation .sous-titre { color: var(--texte-doux); margin: 0 0 10px; }
.presentation .profil { font-weight: 700; color: var(--primaire); margin: 0; }
.presentation .version { font-size: .9rem; color: var(--texte-doux); margin: 4px 0 14px; }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.cartes > li { border: 1px solid var(--bord); border-top: 5px solid var(--primaire); border-radius: 10px; padding: 16px 18px; background: var(--fond); }
.cartes h2 { margin: 0 0 6px; font-size: 1.2rem; }
.cartes p { margin: 0 0 10px; color: var(--texte-doux); }
.cartes ul { padding-left: 1.1em; margin: 0; }
.chapitres { padding-left: 1.3em; }
.chapitres li { margin-bottom: 6px; }

/* ── La recherche ── */
.resultats { list-style: none; padding: 0; }
.resultats li { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.resultats a { font-weight: 700; font-size: 1.05rem; }
.resultats .ou { font-size: .85rem; color: var(--texte-doux); margin: 2px 0; }
.resultats .extrait { margin: 4px 0 0; }
mark { background: #fde68a; color: inherit; padding: 0 1px; }
.recherche-page form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.recherche-page input[type=search], .recherche-page select { font: inherit; padding: 8px 12px; border: 1px solid var(--bord-fort); border-radius: 8px; min-height: 44px; }
.recherche-page input[type=search] { flex: 1 1 260px; }

/* ── Téléphone : le sommaire se replie derrière « Sommaire » ── */
@media (max-width: 900px) {
  .cadre { grid-template-columns: 1fr; }
  .sommaire { border-right: 0; border-bottom: 1px solid var(--bord); }
  .sommaire > summary { display: block; cursor: pointer; padding: 12px 20px; font-weight: 700; min-height: 44px; }
  .sommaire-defile { position: static; max-height: none; padding-top: 0; }
  main { padding: 18px 18px 60px; }
  .entete { flex-wrap: wrap; padding: 8px 14px; gap: 8px; }
  .entete form { order: 3; flex-basis: 100%; max-width: none; }
  html { scroll-padding-top: 120px; }
  article h1 { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── L'impression : le livret PDF (Chromium, `construire.js --pdf`) ── */
@page { size: A4; margin: 22mm 20mm 20mm; }
@media print {
  body { font-size: 10.5pt; line-height: 1.5; }
  .entete, .sommaire, .ariane, .suite, .evitement { display: none !important; }
  .cadre { display: block; }
  main { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  .capture-lien { cursor: default; }
  .capture img { box-shadow: none; }
  .capture { break-inside: avoid; }
  .capture img { max-height: 135mm; width: auto; }
  .capture.etroite img { max-height: 120mm; }
  .encart, table tr, .etapes li { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  .livret-chapitre { break-before: page; }
  .couverture { height: 230mm; display: flex; flex-direction: column; justify-content: center; text-align: center; background: var(--voile); border-radius: 0; margin: -2mm 0 0; padding: 20mm; break-after: page; }
  .couverture .picto { font-size: 42pt; }
  .couverture .titre { font-size: 30pt; font-weight: 700; color: var(--fonce); margin: 6mm 0 2mm; }
  .couverture .sous-titre { font-size: 13pt; color: var(--texte-doux); margin: 0 0 14mm; }
  .couverture .genre { font-size: 17pt; font-weight: 700; margin: 0; }
  .couverture .profil { font-size: 14pt; font-weight: 700; color: var(--primaire); margin: 2mm 0; }
  .couverture .version { font-size: 11pt; color: var(--texte-doux); margin: 0; }
  .couverture .adresse { margin-top: 18mm; font-size: 10pt; color: var(--texte-doux); }
  .table-des-matieres { break-after: page; }
  .table-des-matieres ol { padding-left: 1.2em; }
  .table-des-matieres li { margin: 0 0 3mm; }
  .table-des-matieres ul { list-style: none; padding-left: 4mm; margin: 1mm 0 0; font-size: 9.5pt; color: var(--texte-doux); }
}
.couverture-ecran { display: none; }

/* « Quoi de neuf » (lot W3) */
.nouveautes { list-style: none; padding: 0; }
.nouveautes > li { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.nouveautes p { margin: 0 0 4px; }
.nouveaute-quand { font-size: .92rem; color: var(--texte-doux); }

/* « Votre accès » (lot W5) : un bandeau au-dessus de la page, quand la personne est connectée. */
.acces { display: flex; gap: 10px; padding: 10px 14px; margin: 0 0 18px; border-radius: 8px; border: 1px solid var(--bord); background: var(--fond-doux); font-size: .95rem; }
.acces p { margin: 0; }
.acces-alerte { border-color: var(--alerte-bord); background: var(--alerte-fond); }
.acces-info { border-color: var(--primaire); background: var(--voile); }
.acces-ok { color: var(--texte-doux); }
