/* PLAN7 — aide publique (/aide). Téléphone d'abord ; thème clair et sombre selon le système. */

:root {
  --prune: #7A1E5A;
  --violet: #3B1A78;
  --rose: #D6336C;
  --jaune: #FFE066;
  --degrade: linear-gradient(135deg, var(--rose) 0%, var(--prune) 52%, var(--violet) 100%);
  --fond: #F6F2F7;
  --surface: #FFFFFF;
  --surface-2: #F1EBF3;
  --texte: #1E1424;
  --discret: #6C6075;
  --bord: rgba(59, 26, 120, 0.14);
  --accent: #B0245A;
  --focus: #3B1A78;
  --rayon: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #120D17;
    --surface: #1D1624;
    --surface-2: #271E30;
    --texte: #F4EEF7;
    --discret: #A99DB3;
    --bord: rgba(255, 255, 255, 0.1);
    --accent: #F06595;
    --focus: #FFE066;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.discret { color: var(--discret); }

/* Barre du haut */
.aide-barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--degrade); color: #fff;
}
.aide-marque { color: #fff; font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: 0.02em; }
.aide-marque span { font-weight: 500; opacity: 0.85; }
.aide-portail { color: #fff; font-weight: 600; text-decoration: none; margin-left: auto; }
.aide-recherche { display: flex; gap: 6px; flex: 1 1 100%; order: 3; }
.aide-recherche input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 12px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.95); color: #1E1424;
}
.aide-recherche button {
  font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 10px; border: 0;
  background: var(--jaune); color: #1E1424; cursor: pointer;
}

/* Mise en page */
.aide-page { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.aide-sommaire details, .sommaire-ordinateur { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 14px; }
.aide-sommaire summary, .sommaire-titre { font-weight: 700; cursor: pointer; margin: 0; }
.sommaire-ordinateur { display: none; }
.aide-sommaire ol { margin: 8px 0 0; padding-left: 22px; }
.aide-sommaire li { margin: 4px 0; }
.aide-sommaire a { text-decoration: none; }
.aide-sommaire a[aria-current="page"] { font-weight: 800; color: var(--texte); }

.aide-texte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 8px 18px 24px; min-width: 0; outline: none;
}

@media (min-width: 860px) {
  .aide-recherche { flex: 0 1 380px; order: 0; }
  .aide-page { grid-template-columns: 270px minmax(0, 1fr); align-items: start; padding: 24px; }
  .aide-sommaire { position: sticky; top: 16px; }
  .sommaire-telephone { display: none; }
  .sommaire-ordinateur { display: block; }
  .aide-texte { padding: 12px 36px 36px; }
}

/* Texte rendu depuis le Markdown */
.markdown h1, .aide-texte > h1 { font-size: 30px; line-height: 1.2; margin: 18px 0 12px; }
.markdown h2 { font-size: 22px; margin: 34px 0 8px; padding-top: 10px; border-top: 1px solid var(--bord); scroll-margin-top: 12px; }
.markdown h3 { font-size: 18px; margin: 24px 0 6px; scroll-margin-top: 12px; }
.markdown .ancre { float: left; margin-left: -1.1em; width: 1em; color: var(--discret); text-decoration: none; opacity: 0; }
.markdown h2:hover .ancre, .markdown h3:hover .ancre { opacity: 1; }
.markdown p, .markdown li { max-width: 72ch; }
.markdown ul, .markdown ol { padding-left: 24px; }
.markdown li { margin: 4px 0; }
.markdown code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.markdown pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote { margin: 12px 0; padding: 4px 14px; border-left: 4px solid var(--accent); color: var(--discret); }
.markdown table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 15px; margin: 12px 0; }
.markdown th, .markdown td { border: 1px solid var(--bord); padding: 7px 10px; text-align: left; vertical-align: top; }
.markdown th { background: var(--surface-2); }
.markdown img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--bord); }

.aide-suite { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--bord); }
.aide-suite a { text-decoration: none; font-weight: 600; }
.aide-suite .suivant { margin-left: auto; text-align: right; }

.cartes { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cartes a { display: block; padding: 14px; border-radius: 10px; background: var(--surface-2); text-decoration: none; font-weight: 700; color: var(--texte); }
.cartes a:hover { color: var(--accent); }

.resultats { list-style: none; padding: 0; }
.resultats li { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.resultats a { font-weight: 700; }
.resultats .discret { margin-left: 8px; font-size: 14px; }
.resultats p { margin: 4px 0 0; color: var(--discret); font-size: 15px; }
