/* Accessibilité bâtiment — feuille de style
   Encre bleu nuit, bleu de signalétique pour les liens, fond « calque ».
   Le jaune de contraste (nez de marche, bandes d'éveil) est réservé aux cotes et au focus. */

@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0152-0153, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0152-0153, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-next-latin-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --encre: #14213D;
  --signal: #0B4FA0;
  --signal-fonce: #083A78;
  --calque: #F3F5F7;
  --papier: #FFFFFF;
  --contraste: #FFD400;
  --trait: #C3CCD7;
  --doux: #46536A;
  --vigueur: #1E6B45;
  --abroge: #8A1C14;
  --mesure: 68ch;
  --rayon: 4px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--calque);
  color: var(--encre);
  font: 400 1.125rem/1.6 "Atkinson", "Verdana", sans-serif;
}
a { color: var(--signal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--signal-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; box-shadow: 0 0 0 6px var(--contraste); border-radius: 2px; }
img { max-width: 100%; height: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 1rem; top: -4rem; background: var(--contraste); color: var(--encre); padding: .6rem 1rem; z-index: 10; font-weight: 700; }
.evitement:focus { top: 1rem; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); margin-top: .2em; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

/* ---------- barre du haut */
.barre {
  background: var(--encre);
  color: var(--papier);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: .9rem clamp(1rem, 3vw, 2.5rem);
}
.marque { color: var(--papier); text-decoration: none; display: grid; line-height: 1.15; }
.marque:hover { color: var(--papier); }
.marque-nom { font-weight: 700; font-size: 1.2rem; }
.marque-sous { font-size: .9rem; opacity: .85; }
.recherche { display: flex; max-width: 40rem; width: 100%; justify-self: center; }
.recherche input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: .55rem .8rem;
  border: 2px solid var(--papier); border-right: 0; border-radius: var(--rayon) 0 0 var(--rayon); background: var(--papier); color: var(--encre);
}
.recherche button {
  font: inherit; font-size: 1rem; font-weight: 700; padding: .55rem 1rem; cursor: pointer;
  background: var(--contraste); color: var(--encre); border: 2px solid var(--contraste); border-radius: 0 var(--rayon) var(--rayon) 0;
}
.raccourcis { display: flex; gap: 1.2rem; }
.raccourcis a { color: var(--papier); font-weight: 700; text-decoration: none; padding: .2rem 0; border-bottom: 3px solid transparent; }
.raccourcis a:hover, .raccourcis a[aria-current] { border-bottom-color: var(--contraste); color: var(--papier); }

/* ---------- pages de contenu */
.cadre {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 82rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem;
}
.themes details { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.themes summary { font-weight: 700; font-size: 1.1rem; cursor: pointer; padding: .3rem 0 .6rem; list-style: none; }
.themes summary::-webkit-details-marker { display: none; }
.themes ul { list-style: none; margin: 0; padding: 0; }
.themes .niv2 { padding-left: 1rem; }
.themes li > ul { display: none; }
.themes li.ouvert > ul { display: block; }
.themes a, .themes .lien-perdu {
  display: block; padding: .4rem .7rem; text-decoration: none; color: var(--encre);
  border-left: 4px solid var(--trait); line-height: 1.35; font-size: 1rem;
}
.themes a:hover { border-left-color: var(--signal); background: var(--papier); }
.themes a[aria-current] { border-left-color: var(--encre); background: var(--papier); font-weight: 700; }

.lecture { min-width: 0; }
.lecture > *, .texte > * { max-width: var(--mesure); }
.fil { font-size: .95rem; color: var(--doux); margin: 0 0 .4rem; }
.fil a { color: var(--doux); }

.onglets { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.2rem; }
.onglets a {
  text-decoration: none; padding: .45rem .9rem; border: 2px solid var(--encre); border-radius: var(--rayon);
  color: var(--encre); font-weight: 700; font-size: 1rem; background: var(--papier);
}
.onglets a[aria-current] { background: var(--encre); color: var(--papier); }

.avertissement {
  background: var(--papier); border-left: 6px solid var(--contraste); padding: .8rem 1rem;
  font-size: .98rem; margin: 1rem 0 1.5rem;
}

.texte { background: var(--papier); padding: clamp(1rem, 3vw, 2.2rem); border: 1px solid var(--trait); border-radius: var(--rayon); }
.texte > h2:first-child { margin-top: 0; }
.texte ul, .texte ol { padding-left: 1.4rem; }
.texte li { margin: .25rem 0; }
.texte table { border-collapse: collapse; margin: 1rem 0; font-size: 1rem; display: block; overflow-x: auto; max-width: 100%; }
.texte td, .texte th { border: 1px solid var(--trait); padding: .4rem .6rem; vertical-align: top; }
.texte img { display: block; margin: 1rem 0; border: 1px solid var(--trait); }
.texte .sommaire { background: var(--calque); padding: .8rem 1rem .8rem 2rem; border-radius: var(--rayon); }

/* La cote : une valeur réglementaire, lue comme sur un plan */
.cote {
  background: var(--contraste); color: var(--encre); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding: 0 .28em; border-inline: 2px solid var(--encre); border-radius: 1px;
}
/* Numéro d'article actuel, à côté de l'ancien */
.nv {
  display: inline-block; font-size: .8em; line-height: 1.3; color: var(--signal-fonce); white-space: nowrap;
  border: 1px solid var(--signal); border-radius: 999px; padding: 0 .5em; margin: 0 .25em; vertical-align: .08em; background: var(--papier);
}
.lien-perdu { text-decoration: underline dotted var(--doux); color: inherit; cursor: help; }
.schema-absent {
  display: block; margin: 1rem 0; padding: 1.4rem 1rem; text-align: center; color: var(--doux);
  border: 2px dashed var(--trait); border-radius: var(--rayon); font-size: .95rem;
}

/* ---------- accueil */
.accueil { max-width: 82rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 4rem; }
.ouverture { max-width: 52rem; }
.ouverture h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); margin-bottom: .4em; }
.intro p { margin: .6em 0; }
.choix { margin-top: 2.5rem; }
.choix h2 { margin-top: 0; }
.grille-defile { overflow-x: auto; }
.grille { border-collapse: separate; border-spacing: .5rem; width: 100%; min-width: 46rem; margin-left: -.5rem; }
.grille thead th { text-align: left; font-size: 1.05rem; padding: 0 .4rem; }
.grille tbody th { text-align: left; vertical-align: middle; width: 13rem; font-size: 1.1rem; padding-right: .6rem; }
.grille td { vertical-align: stretch; height: 1px; padding: 0; }
.case {
  display: flex; flex-direction: column; gap: .3rem; height: 100%; min-height: 7rem; padding: .9rem 1rem;
  background: var(--papier); border: 2px solid var(--encre); border-radius: var(--rayon); text-decoration: none; color: var(--encre);
}
.case:hover { background: var(--encre); color: var(--papier); }
.case-titre { font-weight: 700; font-size: 1.1rem; }
.case-desc { font-size: .95rem; }
.case-nouveau { border-top: 8px solid var(--contraste); }
.grille .vide span {
  display: flex; align-items: center; height: 100%; min-height: 7rem; padding: .9rem 1rem; color: var(--doux); font-size: .95rem;
  border: 1px solid var(--trait); border-radius: var(--rayon);
  background: repeating-linear-gradient(135deg, transparent 0 9px, var(--trait) 9px 10px);
}
.autres { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; margin-top: 1rem; font-weight: 700; }
.veille { margin-top: 3rem; max-width: 52rem; }
.veille ul, .liste-textes, .liste-articles { list-style: none; padding: 0; }
.veille li, .liste-textes li { padding: .7rem 0; border-bottom: 1px solid var(--trait); }
.date { display: block; color: var(--doux); font-size: .95rem; }
.liste-articles li { padding: .35rem 0; }
.etat { color: var(--doux); }
.etat-vigueur { color: var(--vigueur); }
.etat-vigueur_diff { color: var(--signal-fonce); font-weight: 700; }
.etat-abroge, .etat-abroge_diff { color: var(--abroge); }

/* ---------- pages simples */
.page-simple { max-width: 82rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 4rem; }
.chapo { font-size: 1.15rem; }
.a-completer { border: 2px dashed var(--abroge); padding: .8rem 1rem; background: var(--papier); }
.colonnes, .plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0 2rem; max-width: none !important; }
.colonnes ul, .plan ul { list-style: none; padding: 0; }
.colonnes li, .plan li { margin: .3rem 0; }
.plan .niv2 { padding-left: 1rem; }

/* Résultats de recherche */
#resultats ol { list-style: none; padding: 0; }
#resultats li { padding: 1rem 0; border-bottom: 1px solid var(--trait); }
#resultats .ou { display: block; color: var(--doux); font-size: .95rem; }
#resultats a { font-weight: 700; font-size: 1.1rem; }
#resultats mark { background: var(--contraste); color: var(--encre); }
#resultats .extrait { margin: .3rem 0 0; }

/* ---------- pied */
.pied { background: var(--encre); color: var(--papier); padding: 2rem clamp(1rem, 3vw, 2.5rem); font-size: .95rem; }
.pied nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.pied a { color: var(--papier); }
.pied p { margin: .3rem 0; }

/* ---------- petits écrans */
@media (max-width: 60rem) {
  .barre { grid-template-columns: 1fr auto; }
  .recherche { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .cadre { grid-template-columns: 1fr; gap: 1rem; padding-top: 1rem; }
  .themes details { position: static; max-height: none; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .3rem .8rem; }
  .themes summary::after { content: " : thèmes"; font-weight: 400; }
}
@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .raccourcis { gap: .8rem; font-size: .95rem; }
  .recherche button { padding: .55rem .7rem; }
  .grille, .grille thead, .grille tbody, .grille tr, .grille th, .grille td { display: block; min-width: 0; width: auto; margin: 0; }
  .grille thead { display: none; }
  .grille tbody th { padding: 1.2rem 0 .4rem; }
  .grille-defile { overflow: visible; }
  .grille td { margin-bottom: .6rem; height: auto; }
  .case { height: auto; }
  .grille td::before { content: attr(data-situation); display: block; font-size: .95rem; color: var(--doux); margin-bottom: .2rem; }
  .case, .grille .vide span { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  .barre, .themes, .pied, .onglets, .evitement { display: none; }
  .cadre { display: block; padding: 0; }
  .texte { border: 0; padding: 0; }
  .cote { background: none; border-inline: 1px solid #000; }
}

/* ---------- texte officiel en vigueur */
.avertissement-vigueur { border-left-color: var(--vigueur); }
.article-vig + .article-vig { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--trait); }
.article-vig h3 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.statut { font-size: .85rem; font-weight: 400; color: var(--vigueur); border: 1px solid currentColor; border-radius: 999px; padding: 0 .6em; }
.statut-modifie { color: var(--encre); background: var(--contraste); border-color: var(--encre); font-weight: 700; }
.a-venir { border-left: 4px solid var(--signal); padding: .4rem .8rem; background: var(--calque); }
.source-art { font-size: .95rem; margin-top: 1rem; }
.origine { margin-top: 1.5rem; }
.origine > summary { cursor: pointer; font-weight: 700; padding: .7rem 1rem; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); }
.origine[open] > summary { border-radius: var(--rayon) var(--rayon) 0 0; }
.origine > .texte { border-top: 0; border-radius: 0 0 var(--rayon) var(--rayon); }

/* ---------- barre des rubriques (comme sur l'ancien site) */
.rubriques { background: var(--papier); border-bottom: 1px solid var(--trait); }
.rubriques ul { list-style: none; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); display: flex; gap: .2rem 1.6rem; max-width: 82rem; overflow-x: auto; scrollbar-width: thin; }
.rubriques a { display: block; padding: .7rem 0 .55rem; color: var(--encre); text-decoration: none; font-weight: 700; font-size: 1rem; white-space: nowrap; border-bottom: 4px solid transparent; }
.rubriques a:hover { border-bottom-color: var(--trait); color: var(--encre); }
.rubriques a[aria-current] { border-bottom-color: var(--encre); }
@media (max-width: 40rem) { .rubriques ul { gap: 1.1rem; } .rubriques a { font-size: .95rem; } }

/* ---------- comptes */
.page-compte { display: flex; justify-content: center; }
.carte-compte { width: 100%; max-width: 30rem; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: clamp(1.2rem, 4vw, 2.2rem); }
.carte-compte h1 { font-size: 1.8rem; }
.formulaire { display: grid; gap: .35rem; margin: 1rem 0; }
.formulaire label { font-weight: 700; margin-top: .6rem; }
.formulaire .aide { font-weight: 400; color: var(--doux); }
.formulaire input[type=email], .formulaire input[type=password] {
  font: inherit; padding: .6rem .7rem; border: 2px solid var(--encre); border-radius: var(--rayon); background: var(--papier); color: var(--encre);
}
.formulaire button, .bouton {
  justify-self: start; margin-top: 1rem; font: inherit; font-weight: 700; padding: .65rem 1.2rem; cursor: pointer;
  background: var(--encre); color: var(--papier); border: 2px solid var(--encre); border-radius: var(--rayon); text-decoration: none; display: inline-block;
}
.bouton:hover { color: var(--papier); background: var(--signal-fonce); }
.case-a-cocher { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0 0; }
.case-a-cocher input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; flex: none; }
.case-a-cocher label { font-weight: 400; margin: 0; }
.form-erreur { border-left: 6px solid var(--abroge); background: #FBEDEC; padding: .7rem 1rem; }
.form-ok { border-left: 6px solid var(--vigueur); background: #EAF4EE; padding: .7rem 1rem; }
.lien-bas { margin: .4rem 0; }
.infos-compte dt { font-weight: 700; margin-top: .6rem; }
.infos-compte dd { margin: 0; }
.zone-suppression { margin-top: 2rem; border-top: 1px solid var(--trait); padding-top: 1rem; }
.zone-suppression summary { cursor: pointer; color: var(--abroge); font-weight: 700; }
.bouton-danger { background: var(--abroge) !important; border-color: var(--abroge) !important; }
.prix { font-size: 1.3rem; font-weight: 700; }
.schema { margin: 1.4rem 0; }
.schema img { border: 0; width: 100%; max-width: 36rem; height: auto; }
.schema figcaption { font-size: .9rem; color: var(--doux); }
