/* « Décryptage de la loi intégrale » — feuille de style unique.
   Générée par scripts/build_refonte.py. Principes :
   - la couleur ne porte jamais seule une information ;
   - une boîte est rare et a une fonction ; sinon, filet, retrait, marge ;
   - toute distinction survit au noir et blanc et à l'impression. */

:root {
  --papier:      #F2F2EF;   /* fond de page */
  --hors-page:   #DEDDD8;   /* fond autour de la page */
  --pied:        #EAEAE6;   /* bandeau de pied, relevés */
  --encre:       #14151A;   /* texte principal */
  --encre-2:     #52545B;   /* métadonnées, notes */
  --encre-3:     #83858C;   /* texte inactif, placeholder */
  --accent:      #6E2433;   /* bordeaux : lien, élément actif, exergue */
  --accent-pale: #EDE2E4;   /* surlignage de ligne */
  --filet:       rgba(20, 21, 26, .18);
  --filet-fort:  #14151A;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:  'Archivo', system-ui, -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --page:    1320px;   /* largeur de travail : registres, tables, vues */
  --lecture:  740px;   /* largeur de lecture : analyses, méthode, extraits */
  --marge: clamp(20px, 4.5vw, 64px);

  --pas-1: 6px;  --pas-2: 12px; --pas-3: 20px;
  --pas-4: 32px; --pas-5: 48px; --pas-6: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--hors-page);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.page {
  max-width: var(--page);
  margin: 0 auto;
  background: var(--papier);
  border-left: 1px solid var(--filet);
  border-right: 1px solid var(--filet);
}

a { color: var(--accent); text-decoration: underline;
    text-decoration-thickness: 1px; text-underline-offset: .18em;
    text-decoration-color: rgba(110, 36, 51, .4); }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

.saut {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--encre); color: var(--papier); padding: 10px 16px;
}
.saut:focus { left: 0; }

/* ------------------------------------------------------- en-tête, nav */

.enseigne {
  display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
  justify-content: space-between; align-items: baseline;
  padding: var(--pas-3) var(--marge) var(--pas-2);
}
.enseigne__titre { font-family: var(--serif); font-size: 21px; font-weight: 700;
                   line-height: 1.2; margin: 0; }
.enseigne__titre a { color: var(--encre); text-decoration: none; }
.enseigne__titre a:hover { text-decoration: underline; }
.enseigne__sous { font-family: var(--serif); font-size: 16px; color: var(--encre-2);
                  margin: 2px 0 0; max-width: 62ch; }
.enseigne__etat { font-family: var(--mono); font-size: 12px; color: var(--encre-2);
                  text-align: right; line-height: 1.6; }
.enseigne__etat a { color: var(--encre-2); }

.nav {
  display: flex; flex-wrap: wrap; gap: 0 var(--pas-4);
  margin: 0; padding: 0 var(--marge); list-style: none;
  border-top: 1px solid var(--filet); border-bottom: 3px solid var(--filet-fort);
}
.nav li { margin: 0; }
.nav a, .nav span {
  display: inline-block; padding: 10px 0; font-size: 15px; font-weight: 500;
  color: var(--encre); text-decoration: none; border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.nav a:hover { border-bottom-color: var(--filet); }
.nav [aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }

.sous-nav {
  display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
  padding: 10px var(--marge); border-bottom: 1px solid var(--filet);
  font-size: 15px;
}
.sous-nav a { color: var(--encre-2); text-decoration: none; }
.sous-nav a:hover { text-decoration: underline; }
.sous-nav [aria-current="true"] { color: var(--encre); font-weight: 600;
  border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

.ariane {
  display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
  justify-content: space-between;
  padding: 10px var(--marge); border-bottom: 1px solid var(--filet);
  font-family: var(--mono); font-size: 13px; color: var(--encre-2);
}
.ariane a { color: var(--encre-2); }
.ariane__ici { color: var(--encre); }

/* -------------------------------------------------------------- bandes */

.bande { padding: var(--pas-5) var(--marge); border-bottom: 1px solid var(--filet-fort); }
.bande--mince { padding: var(--pas-4) var(--marge); }
.bande--pied { background: var(--pied); border-bottom: none; }
.bande:last-of-type { border-bottom: none; }

.duo { display: grid; grid-template-columns: minmax(0, 1fr) 380px;
       gap: clamp(24px, 4vw, 64px); align-items: start; }
.duo--large { grid-template-columns: minmax(0, 1fr) 440px; }
.duo--egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flanc { border-left: 1px solid var(--filet-fort); padding-left: var(--pas-4); }

@media (max-width: 1000px) {
  .duo, .duo--large, .duo--egal { grid-template-columns: minmax(0, 1fr); gap: var(--pas-4); }
  .flanc { border-left: none; border-top: 1px solid var(--filet-fort);
           padding-left: 0; padding-top: var(--pas-3); }
}

/* --------------------------------------------------------- typographie */

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0;
                 letter-spacing: -.01em; }
.constat { font-size: clamp(30px, 3.9vw, 50px); line-height: 1.06;
           letter-spacing: -.02em; max-width: 19ch; }
.titre { font-size: clamp(27px, 3vw, 38px); line-height: 1.12; }
.titre--fiche { max-width: 26ch; }
h2 { font-size: 24px; line-height: 1.22; }
h3 { font-size: 20px; line-height: 1.28; }

.section {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--encre-2);
  margin: 0 0 var(--pas-3); padding-bottom: 6px;
  border-bottom: 1px solid var(--filet);
}
.etiquette { font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
             text-transform: uppercase; color: var(--encre-2); margin: 0; }

.chapo { font-family: var(--serif); font-size: clamp(17px, 1.4vw, 19px);
         line-height: 1.6; max-width: var(--lecture); margin: var(--pas-3) 0 0; }
.texte { font-family: var(--serif); font-size: 17px; line-height: 1.65;
         max-width: var(--lecture); }
.texte p { margin: 0 0 var(--pas-2); }
.texte p:last-child { margin-bottom: 0; }
.note { font-family: var(--serif); font-size: 15px; line-height: 1.55;
        color: var(--encre-2); max-width: var(--lecture); }
.mono { font-family: var(--mono); }
.lecture { max-width: var(--lecture); }

.actions { display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
           margin-top: var(--pas-3); font-family: var(--serif); font-size: 17px; }

/* ------------------------------------------------------------- relevés */

.releve { margin: 0; display: flex; flex-direction: column; }
.releve > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--pas-3); padding: 10px 0; border-bottom: 1px solid var(--filet);
}
.releve > div:first-child { border-top: 1px solid var(--filet); }
.releve dt, .releve .clef { font-family: var(--serif); font-size: 17px; }
.releve dd, .releve .valeur { margin: 0; font-family: var(--mono); font-size: 20px; }
.releve .valeur--texte { font-family: var(--serif); font-size: 16px; text-align: right; }
.releve .appui { font-weight: 600; }

/* ------------------------------------------------------------- tableau */

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; }

.tableau { font-family: var(--serif); font-size: 17px; }
.tableau th {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--encre-2); text-align: left;
  padding: 10px 14px 10px 0; border-bottom: 1px solid var(--filet-fort);
  vertical-align: bottom;
}
.tableau td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--filet);
              vertical-align: baseline; }
.tableau .droite, .tableau th.droite { text-align: right; font-family: var(--mono); }
.tableau tfoot td { border-bottom: 1px solid var(--filet-fort); font-weight: 700;
                    padding-top: 14px; padding-bottom: 14px; }
.tableau tfoot .base { font-weight: 400; font-size: 15px; color: var(--encre-2); }
.tableau .base { font-size: 15px; color: var(--encre-2); }
.tableau tbody tr:hover { background: var(--accent-pale); }

/* ------------------------------------------------------------ registre */

.outils { padding: var(--pas-3) var(--marge); border-bottom: 1px solid var(--filet);
          display: flex; flex-direction: column; gap: var(--pas-2); }
.rang-outils { display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
               align-items: baseline; }
.jeu { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.jeu__titre { font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
              text-transform: uppercase; color: var(--encre-2); }

.filtre {
  font: inherit; font-size: 15px; color: var(--encre-2); background: none;
  border: none; border-bottom: 2px solid transparent; padding: 0 0 2px; cursor: pointer;
}
.filtre:hover { color: var(--encre); }
.filtre[aria-pressed="true"] { color: var(--encre); font-weight: 600;
                               border-bottom-color: var(--accent); }

.recherche { display: flex; border: 1px solid var(--filet-fort);
             min-width: min(100%, 420px); }
.recherche input { flex: 1; min-width: 0; border: none; background: none;
                   padding: 11px 13px; font-family: var(--serif); font-size: 16px;
                   color: var(--encre); }
.recherche input::placeholder { color: var(--encre-3); }
.recherche button { background: var(--encre); color: var(--papier); border: none;
                    padding: 11px 18px; font: inherit; font-size: 14px;
                    font-weight: 600; cursor: pointer; }

.etat-filtres { font-family: var(--serif); font-size: 15px; color: var(--encre-2);
                display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-3);
                align-items: baseline; }
.etat-filtres strong { color: var(--encre); font-weight: 600; }
.lien-bouton { font: inherit; font-family: var(--serif); font-size: 15px;
               background: none; border: none; padding: 0; color: var(--accent);
               text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

.registre { font-size: 16px; }
.registre caption { padding: 0 var(--marge) var(--pas-2); }
.registre th {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--encre-2); text-align: left;
  padding: 10px 9px; border-bottom: 1px solid var(--filet-fort); white-space: nowrap;
}
.registre th:first-child { padding-left: var(--marge); }
.registre th:last-child { padding-right: var(--marge); }
.registre td { padding: 11px 9px; border-bottom: 1px solid var(--filet);
               vertical-align: baseline; }
.registre td:first-child { padding-left: var(--marge); }
.registre td:last-child { padding-right: var(--marge); }
.registre tbody tr:hover { background: var(--accent-pale); }
.registre tr[hidden] { display: none; }

.c-marque   { width: 26px; font-family: var(--mono); font-size: 15px; }
.c-ref      { width: 72px; font-family: var(--mono); font-size: 14px; }
.c-intitule { font-family: var(--serif); font-size: 17px; line-height: 1.35; }
.c-intitule a { color: var(--encre); text-decoration-color: rgba(20,21,26,.3); }
.c-domaine  { width: 170px; font-size: 14px; color: var(--encre-2); }
.c-statut   { width: 152px; font-family: var(--serif); font-size: 16px; }
.c-articles { width: 132px; font-family: var(--mono); font-size: 14px; }
.c-niveau   { width: 84px; font-family: var(--mono); font-size: 14px; letter-spacing: .06em; }
.c-verif    { width: 152px; font-family: var(--serif); font-size: 15px; color: var(--encre-2); }
.c-ouvrir   { width: 92px; font-family: var(--serif); font-size: 15px; text-align: right; }

.tri { background: none; border: none; padding: 0; margin: 0; cursor: pointer;
       font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.tri[aria-sort="ascending"]::after  { content: " ↑"; }
.tri[aria-sort="descending"]::after { content: " ↓"; }

@media (max-width: 1180px) { .c-domaine, .c-verif { display: none; } }
@media (max-width: 820px) {
  .registre, .registre tbody, .registre tr, .registre td { display: block; width: auto; }
  .registre thead { display: none; }
  .registre tr { padding: var(--pas-2) var(--marge); border-bottom: 1px solid var(--filet); }
  .registre td { border: none; padding: 1px 0; width: auto; text-align: left; }
  .registre td::before { content: attr(data-libelle); display: block; margin-top: 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--encre-2); }
  .c-marque::before, .c-intitule::before, .c-ref::before { content: none; }
  .c-marque, .c-ref { display: inline; }
  .c-intitule { font-size: 18px; margin-top: 2px; }
}

/* ------------------------------------------------- documents, sources */

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 12px 0; border-bottom: 1px solid var(--filet);
              font-family: var(--serif); font-size: 17px; line-height: 1.4; }
.liste > li:first-child { border-top: 1px solid var(--filet); }
.liste__meta { display: block; margin-top: 3px; font-family: var(--mono);
               font-size: 12px; color: var(--encre-2); line-height: 1.5; }
.liste__desc { display: block; margin-top: 3px; font-size: 15px; color: var(--encre-2); }

.rangs { list-style: none; margin: 0; padding: 0; }
.rangs > li {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 190px 128px;
  gap: var(--pas-3); align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--filet);
  font-family: var(--serif); font-size: 16px;
}
.rangs > li:first-child { border-top: 1px solid var(--filet); }
.rangs .mono { font-size: 14px; }
.rangs .etat { font-family: var(--mono); font-size: 13px; color: var(--encre-2); }
@media (max-width: 860px) { .rangs > li { grid-template-columns: 1fr; gap: 3px; } }

/* --------------------------------------------- extraits et citations */

.extrait { margin: var(--pas-3) 0 0; padding-left: var(--pas-3);
           border-left: 1px solid var(--filet); max-width: var(--lecture); }
.extrait__ref { font-family: var(--mono); font-size: 13px; color: var(--encre-2);
                margin: 0 0 4px; }
.extrait p + p, .extrait p { font-family: var(--serif); font-size: 16px;
                             line-height: 1.6; margin: 0 0 6px; }

.citation { margin: var(--pas-3) 0 0; padding-left: var(--pas-3);
            border-left: 2px solid var(--filet-fort);
            font-family: var(--serif); font-size: 18px; line-height: 1.65;
            max-width: var(--lecture); }

.depeche { padding: var(--pas-3) 0; border-bottom: 1px solid var(--filet); }
.depeche:first-of-type { border-top: 1px solid var(--filet); }
.depeche__meta { font-family: var(--mono); font-size: 12px; color: var(--encre-2);
                 display: flex; flex-wrap: wrap; gap: 4px 16px; }
.depeche__mot { margin: 8px 0 0; padding-left: var(--pas-3);
                border-left: 2px solid var(--accent); font-family: var(--serif);
                font-size: 18px; line-height: 1.6; max-width: var(--lecture); }
.depeche__qui { margin: 6px 0 0; font-family: var(--serif); font-size: 15px;
                color: var(--encre-2); max-width: var(--lecture); }
.depeche__resume { margin: 8px 0 0; font-family: var(--serif); font-size: 16px;
                   line-height: 1.55; max-width: var(--lecture); }

.encadre { border: 1px solid var(--filet-fort); padding: var(--pas-3);
           max-width: var(--lecture); }
.encadre > :first-child { margin-top: 0; }
.encadre > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ vue d'ensemble */

.echelle { display: flex; border: 1px solid var(--filet-fort); }
.echelle div { flex: 1; padding: 10px 8px; font-family: var(--mono); font-size: 12px;
               text-align: center; }

.domaine { display: grid; grid-template-columns: 220px minmax(0, 1fr) 190px;
           gap: var(--pas-4); align-items: start;
           padding: var(--pas-3) 0; border-top: 1px solid var(--filet); }
.domaine:last-of-type { border-bottom: 1px solid var(--filet); }
.domaine__nom { font-family: var(--serif); font-size: 18px; font-weight: 600;
                line-height: 1.3; margin: 0; }
.domaine__compte { font-family: var(--mono); font-size: 12px; color: var(--encre-2);
                   margin: 4px 0 0; }
.cases { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.case { display: flex; align-items: center; justify-content: center;
        width: 54px; height: 34px; border: 1px solid rgba(20,21,26,.4);
        font-family: var(--mono); font-size: 11px; text-decoration: none; }
.case:hover, .case:focus-visible { outline: 2px solid var(--encre); outline-offset: -1px; }
.case--relue { border-bottom-width: 4px; }
@media (max-width: 1000px) { .domaine { grid-template-columns: 1fr; gap: var(--pas-2); } }

/* ---------------------------------------------------------- pied de page */

.pied { display: grid; grid-template-columns: 200px repeat(2, minmax(0, 1fr));
        gap: clamp(20px, 3vw, 44px); padding: var(--pas-4) var(--marge);
        background: var(--pied); font-family: var(--serif); font-size: 16px;
        line-height: 1.55; }
.pied h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
           text-transform: uppercase; color: var(--encre-2); font-weight: 400; }
@media (max-width: 900px) { .pied { grid-template-columns: 1fr; } }

.pied-fiche { display: flex; flex-wrap: wrap; gap: var(--pas-2) var(--pas-4);
              justify-content: space-between; padding: var(--pas-3) var(--marge);
              border-top: 1px solid var(--filet-fort); background: var(--pied);
              font-family: var(--serif); font-size: 17px; }

/* ------------------------------------------------------------ impression */

@media print {
  body { background: #fff; font-size: 11pt; }
  .page { border: none; max-width: none; }
  .nav, .sous-nav, .outils, .recherche, .saut, .lien-bouton, .tri { display: none; }
  a { color: #000; text-decoration: none; }
  .c-intitule a::after { content: ""; }
  .case { border-color: #000 !important; }
  tr, .depeche, .domaine { break-inside: avoid; }
}
