/* Fac de droit : papier froid, encre, et le rouge des codes. Les rubriques ont chacune leur couleur, reprise par le signe § des titres. */
:root {
  color-scheme: light dark;
  --bg: #F5F6F3;
  --panneau: #FFFFFF;
  --encre: #1B1F2A;
  --sourdine: #59606E;
  --filet: #D9DCE2;
  --lien: #1D4E89;
  --marine: #1B1F2A;
  --code: #A3242F;
  --titre: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --texte: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --ui: 'Public Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mesure: 41rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171F;
    --panneau: #1C2029;
    --encre: #E8EAEE;
    --sourdine: #A4ABB8;
    --filet: #2E3441;
    --lien: #8DB8F2;
    --marine: #E8EAEE;
    --code: #E2606A;
  }
}
.vc { --voie: var(--v-c, var(--marine)); }
@media (prefers-color-scheme: dark) {
  .vc { --voie: var(--v-s, var(--v-c, var(--marine))); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--encre);
  font: 400 1.125rem/1.62 var(--texte);
  font-variant-numeric: oldstyle-nums proportional-nums;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--lien); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 3px solid var(--lien); outline-offset: 2px; border-radius: 2px; }

.evitement {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--panneau); color: var(--encre);
  padding: 0.6rem 1rem; border: 2px solid var(--lien); border-radius: 0.4rem;
}
.evitement:focus { top: 1rem; }

.enveloppe { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- En-tête ---------- */
.entete { background: var(--panneau); border-bottom: 1px solid var(--filet); }
.entete .enveloppe { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.marque {
  display: flex; align-items: center; gap: 0.55rem;
  font: 700 1.2rem/1 var(--titre); letter-spacing: -0.01em;
  color: var(--encre); text-decoration: none; white-space: nowrap;
}
.marque svg { width: 1.7rem; height: 1.7rem; flex: none; }
.entete nav { flex: 1 1 100%; min-width: 0; }
.entete nav ul { list-style: none; margin: 0; padding: 0 0 0.15rem; display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: thin; }
.entete nav a {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.65rem; border-radius: 999px;
  color: var(--encre); text-decoration: none; font-size: 0.95rem; white-space: nowrap;
}
.entete nav a:hover { background: color-mix(in srgb, var(--voie) 14%, transparent); }
.entete nav a[aria-current] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--voie); border-radius: 0.3rem 0.3rem 0 0; }
.pastille { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--voie); flex: none; }
@media (min-width: 62rem) {
  .entete nav { flex: 1 1 0; }
  .entete nav ul { justify-content: flex-end; }
}

/* ---------- Pages ---------- */
.page { max-width: 72rem; margin: 0 auto; padding: 1.75rem 1rem 4.5rem; }
@media (min-width: 48rem) {
  .enveloppe, .page { padding-left: 1.5rem; padding-right: 1.5rem; }
}
.bandeau { border-left: 0.45rem solid var(--voie); padding: 0.15rem 0 0.15rem 1.1rem; margin: 0 0 2.2rem; max-width: 48rem; }
.fil ol { list-style: none; margin: 0 0 0.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 0.4rem; font-size: 0.9rem; color: var(--sourdine); }
.fil li + li::before { content: "/"; margin-right: 0.4rem; opacity: 0.6; }
.fil a { color: var(--sourdine); }
h1 { font: 700 clamp(1.95rem, 4.2vw, 2.85rem)/1.1 var(--titre); letter-spacing: -0.012em; margin: 0 0 0.8rem; text-wrap: balance; }
.chapo { font-size: 1.2rem; line-height: 1.5; margin: 0 0 0.8rem; max-width: 40rem; }
.maj { font-size: 0.9rem; color: var(--sourdine); margin: 0; }

.grille { display: grid; gap: 1.5rem; }
@media (min-width: 62rem) {
  .grille { grid-template-columns: minmax(0, var(--mesure)) 15rem; gap: 4rem; justify-content: start; }
}

.prose { max-width: var(--mesure); min-width: 0; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font: 700 1.6rem/1.2 var(--titre); letter-spacing: -0.01em; margin: 2.6rem 0 0.8rem; scroll-margin-top: 1rem; text-wrap: balance; }
.prose h3 { font: 700 1.2rem/1.3 var(--titre); margin: 1.8rem 0 0.5rem; scroll-margin-top: 1rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--voie); }
.prose hr { border: 0; border-top: 1px solid var(--filet); margin: 2rem 0; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.92em; background: color-mix(in srgb, var(--voie) 10%, transparent); padding: 0.08em 0.35em; border-radius: 0.25rem; }

.callout {
  margin: 1.5rem 0; padding: 0.9rem 1.1rem;
  background: color-mix(in srgb, var(--voie) 9%, var(--panneau));
  border-left: 0.3rem solid var(--voie); border-radius: 0 0.5rem 0.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout-attention { border-left-style: double; border-left-width: 0.45rem; }

.table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--filet); border-radius: 0.5rem; background: var(--panneau); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; }
th, td { padding: 0.65rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--filet); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: color-mix(in srgb, var(--voie) 11%, var(--panneau)); font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 700; }
.table-wrap:focus-visible { outline-offset: 3px; }
@media (max-width: 40rem) { table { min-width: 34rem; } }

.sources { margin-top: 3rem; padding-top: 1.1rem; border-top: 2px solid var(--voie); font-size: 0.93rem; color: var(--sourdine); }
.sources h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.sources ul { margin-bottom: 0; }
.sources li { margin: 0.35rem 0; }

/* Sommaire */
.sommaire-mobile { margin: 0 0 1.6rem; padding: 0.6rem 0.9rem; background: var(--panneau); border: 1px solid var(--filet); border-radius: 0.5rem; font-size: 0.95rem; }
.sommaire-mobile summary { cursor: pointer; font-weight: 700; }
.sommaire-mobile ol { margin: 0.6rem 0 0.2rem; padding-left: 1.2rem; }
.sommaire-bureau { display: none; }
@media (min-width: 62rem) {
  .sommaire-mobile { display: none; }
  .sommaire-bureau { display: block; position: sticky; top: 1.25rem; align-self: start; font-size: 0.92rem; }
  .sommaire-titre { font: 700 0.95rem var(--titre); margin: 0 0 0.6rem; }
  .sommaire-bureau ol { list-style: none; margin: 0; padding: 0 0 0 0.9rem; border-left: 3px solid var(--voie); }
  .sommaire-bureau li { margin: 0.45rem 0; line-height: 1.35; }
  .sommaire-bureau a { color: var(--sourdine); text-decoration: none; }
  .sommaire-bureau a:hover { color: var(--encre); text-decoration: underline; }
}

/* Liste des guides d'une rubrique */
.guides { list-style: none; margin: 1rem 0 0; padding: 0 !important; }
.guides li { margin: 0; padding: 0.95rem 0 0.95rem 1rem; border-left: 4px solid var(--voie); border-bottom: 1px solid var(--filet); }
.guides li:last-child { border-bottom: 0; }
.guides a { font: 700 1.12rem/1.3 var(--titre); }
.guides p { margin: 0.2rem 0 0; color: var(--sourdine); font-size: 0.97rem; }

/* Pages voisines */
.voisins { margin-top: 3rem; padding: 1rem 1.2rem; background: var(--panneau); border: 1px solid var(--filet); border-top: 4px solid var(--voie); border-radius: 0.4rem; }
.voisins h2 { font: 700 1.05rem var(--titre); margin: 0 0 0.6rem; }
.voisins ul { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.voisins li { margin: 0; }

/* ---------- Accueil ---------- */
.hero { max-width: 48rem; padding-top: 0.5rem; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 1rem; }
.hero .chapo { font-size: 1.3rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0 0; }
.bouton {
  display: inline-block; padding: 0.7rem 1.15rem; border-radius: 0.5rem;
  background: var(--marine); color: var(--bg); font-weight: 700; text-decoration: none;
}
.bouton:hover { filter: brightness(1.12); }
.bouton-clair { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }


.plan, .essentiels { margin-top: 3.4rem; }
.plan h2, .essentiels h2, .accueil-texte h2 { font: 700 1.7rem/1.2 var(--titre); letter-spacing: -0.01em; margin: 0 0 1.1rem; }
.plan-liste { list-style: none; margin: 0; padding: 0; }
.plan-liste > li { display: grid; gap: 0.6rem 2rem; padding: 1.15rem 0 1.15rem 1.1rem; border-left: 0.45rem solid var(--voie); border-bottom: 1px solid var(--filet); }
.plan-liste > li:last-child { border-bottom: 0; }
.plan-tete h3 { margin: 0 0 0.25rem; font: 700 1.3rem/1.25 var(--titre); }
.plan-tete h3 a { color: var(--encre); }
.plan-tete p { margin: 0; color: var(--sourdine); font-size: 0.98rem; max-width: 34rem; }
.plan-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-content: start; font-size: 0.97rem; }
@media (min-width: 52rem) {
  .plan-liste > li { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
.essentiels ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem 2rem; }
@media (min-width: 44rem) { .essentiels ul { grid-template-columns: 1fr 1fr; } }
.essentiels li { padding: 0.55rem 0 0.55rem 0.9rem; border-left: 4px solid var(--voie); }
.essentiels a { font-weight: 700; }
.accueil-texte { margin-top: 3.4rem; }

/* Parcours type : une suite réelle d'étapes, d'où la numérotation */
.chemin { margin-top: 3rem; }
.chemin h2 { font: 700 1.7rem/1.2 var(--titre); margin: 0 0 1.2rem; }
.chemin ol { list-style: none; margin: 0; padding: 0; counter-reset: etape; display: grid; gap: 0; }
.chemin li { counter-increment: etape; position: relative; padding: 0.9rem 0 0.9rem 3.4rem; border-top: 1px solid var(--filet); }
.chemin li:last-child { border-bottom: 1px solid var(--filet); }
.chemin li::before {
  content: counter(etape); position: absolute; left: 0; top: 0.75rem;
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  font: 700 1.15rem/1 var(--titre); color: var(--bg); background: var(--code); border-radius: 2px;
}
.chemin a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.8rem; text-decoration: none; color: var(--encre); }
.chemin a:hover .chemin-nom { text-decoration: underline; text-decoration-thickness: 0.08em; }
.chemin-nom { font: 700 1.25rem/1.25 var(--titre); }
.chemin-duree { font: 600 0.9rem var(--ui); color: var(--code); }
.chemin p { margin: 0.2rem 0 0; color: var(--sourdine); font-size: 1rem; max-width: 38rem; }
@media (min-width: 62rem) {
  .chemin ol { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1.4rem; }
  .chemin li { padding: 3.2rem 0 0; border: 0; border-top: 3px solid var(--code); }
  .chemin li:last-child { border-bottom: 0; }
  .chemin li::before { top: 0.7rem; }
  .chemin a { display: block; }
  .chemin-duree { display: block; margin-top: 0.15rem; }
}

.facs-accueil { margin-top: 3.4rem; padding: 1.2rem 1.3rem; background: var(--panneau); border: 1px solid var(--filet); border-left: 0.45rem solid var(--voie); }
.facs-accueil h2 { font: 700 1.45rem/1.2 var(--titre); margin: 0 0 0.8rem; }
.facs-accueil ul { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; font-family: var(--ui); font-size: 0.98rem; }
.facs-accueil p { margin: 0; font-weight: 700; }

/* ---------- Pied de page ---------- */
.pied { background: var(--panneau); border-top: 1px solid var(--filet); font-size: 0.95rem; color: var(--sourdine); }
.pied-grille { display: grid; gap: 1.6rem 3rem; padding-top: 2rem; padding-bottom: 2.4rem; }
@media (min-width: 48rem) { .pied-grille { grid-template-columns: 1.4fr 1fr 1fr; } }
.pied p { margin: 0 0 0.5rem; }
.pied-nom { font: 700 1.15rem var(--titre); color: var(--encre); }
.pied-titre { font-weight: 700; color: var(--encre); }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin: 0.25rem 0; }
.pied-maj { font-size: 0.88rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .entete nav, .sommaire-bureau, .sommaire-mobile, .evitement, .voisins { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- Identité Fac de droit ---------- */
.entete nav a, .fil, .maj, .sommaire-mobile, .sommaire-bureau, .voisins, .pied, table, .bouton, .plan-pages, .essentiels ul, .guides p, .sources { font-family: var(--ui); }
.marque { font-family: var(--titre); font-size: 1.3rem; }
.marque svg { border-radius: 4px; }

/* Le signe § des titres d'article reprend la couleur de la rubrique */
.prose h2:not(#sources):not(#les-guides-de-cette-rubrique)::before {
  content: "§"; color: var(--voie); font-weight: 400; margin-right: 0.45rem;
}
.voisins h2::before, .sources h2::before { content: none; }

/* La page d'accueil s'ouvre sur un dos de code rouge */
.hero { position: relative; padding-left: 1.6rem; border-left: 0.6rem solid var(--code); }
.hero .chapo { font-size: 1.28rem; max-width: 37rem; }
.bouton { background: var(--code); color: #FFFFFF; border-radius: 3px; }
.bouton-clair { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }
.bandeau { border-left-width: 0.5rem; }
.callout { border-radius: 0 3px 3px 0; }
.table-wrap { border-radius: 3px; }
thead th { font-weight: 600; }
.pied-consent { font: inherit; color: var(--lien); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
/* Les tableaux à deux colonnes (fiches) tiennent sur mobile sans défilement */
@media (max-width: 40rem) { .table-wrap:has(thead th:nth-child(2):last-child) table { min-width: 0; } }
