/* Kaleyo — pages légales (mentions légales, CGV, confidentialité) et page 404.
   Le contenu reprend les classes du site précédent (lg-…) ; ici, il prend l'allure du site : Chillax,
   titres en DM Serif, encre sur crème, lignes fines plutôt que cartes. Pages générées par outils/legal/generer.py. */

.legal { background: var(--bg); }
.lg-wrap { width: min(50rem, calc(100% - 2.5rem)); margin: clamp(8rem, 16vw, 11rem) auto clamp(5rem, 10vw, 8rem); }
.lg-eyebrow { margin-bottom: 1.25rem; font-size: .8125rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lg-wrap h1 {
  font-family: var(--serif); font-style: var(--accent-style); font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.5rem); line-height: .98; letter-spacing: -.03em; text-wrap: balance;
}
.lg-meta { margin-top: 1.25rem; font-size: .9375rem; color: var(--muted); }
.lg-lead { margin-top: 2rem; font-size: clamp(1.1875rem, 1.6vw, 1.35rem); line-height: 1.6; text-wrap: pretty; }
.lg-wrap a:not(.btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--line); transition: text-decoration-color .3s; }
.lg-wrap a:not(.btn):hover { text-decoration-color: currentColor; }
.lg-wrap strong { font-weight: 600; }

/* Sommaire */
.lg-toc { margin: 3rem 0 1rem; padding-block: 1.5rem; border-block: 1px solid var(--line); }
.lg-toc-title { margin-bottom: .9rem; font-size: .8125rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; columns: 2; column-gap: 2.5rem; }
.lg-toc li { counter-increment: toc; break-inside: avoid; padding: .3rem 0; }
.lg-toc li::before { content: counter(toc, decimal-leading-zero); display: inline-block; width: 2.2rem; font-size: .8125rem; font-weight: 500; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-wrap .lg-toc a { text-decoration: none; }
.lg-toc a:hover { text-decoration: underline; }

/* Sections */
.lg-sec { margin-top: clamp(3rem, 6vw, 4.5rem); }
.lg-sec h2 {
  display: flex; align-items: baseline; gap: .25rem; margin-bottom: 1.25rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em;
}
.lg-sec h2 .n { flex: none; min-width: 2.2rem; font-size: .8125rem; font-weight: 500; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-sec h3 { margin: 2rem 0 .6rem; font-size: 1.1875rem; }
.lg-sec p { margin: 0 0 1rem; line-height: 1.7; text-wrap: pretty; }
.lg-sec ul, .lg-sec ol { margin: 0 0 1.1rem; padding-left: 1.25em; line-height: 1.6; }
.lg-sec li { margin: .45rem 0; padding-left: .25rem; }
.lg-sec li::marker { color: var(--muted); }

/* Fiche d'identité (éditeur, hébergeur…) */
.lg-facts { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr; margin: 0 0 .5rem; border-top: 1px solid var(--line); }
.lg-facts dt, .lg-facts dd { margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.lg-facts dt { padding-right: 1.5rem; padding-top: 1.05rem; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lg-facts dd { font-weight: 500; }

/* Tableaux */
.lg-tablewrap { margin: .5rem 0 1.25rem; overflow-x: auto; }
.lg-table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 1rem; line-height: 1.55; }
.lg-table th { padding: .75rem 1rem .75rem 0; text-align: left; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.lg-table td { padding: 1rem 1rem 1rem 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.lg-table td:first-child { font-weight: 500; }

/* Encadrés */
.lg-note { margin: 1.25rem 0; padding: 1.1rem 1.4rem; border-radius: 1rem; background: rgba(4, 24, 28, .045); box-shadow: inset 2px 0 0 var(--ink); }
.lg-note p:last-child, .lg-note ul:last-child { margin-bottom: 0; }

/* Pied de page */
.lg-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  width: min(75rem, calc(100% - 2.5rem)); margin: 0 auto; padding-block: 2rem calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted);
}
.lg-foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.lg-foot a { color: var(--ink); transition: opacity .3s; }
.lg-foot a:hover { opacity: .6; }
.lg-foot a[aria-current] { text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }

/* 404 */
.legal--404 .lg-wrap { min-height: 60svh; display: grid; align-content: center; justify-items: center; text-align: center; }
.legal--404 .lg-wrap h1 em { display: block; }
.lg-404__actions { margin-top: 2.5rem; }
.lg-404__links { margin-top: 2rem; color: var(--muted); }

@media (max-width: 640px) {
  .lg-toc ol { columns: 1; }
  .lg-facts { grid-template-columns: 1fr; }
  .lg-facts dt { padding-bottom: 0; border-bottom: 0; }
  .lg-facts dd { padding-top: .3rem; }

  /* Tableaux : chaque ligne devient un bloc empilé, plus de défilement latéral. */
  .lg-tablewrap { overflow: visible; }
  .lg-table { min-width: 0; }
  .lg-table thead { display: none; }
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table td { display: block; width: 100%; }
  .lg-table tr { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .lg-table td { padding: .15rem 0; border: 0; }
}

@media print {
  .header, .lg-foot nav { display: none; }
  .lg-wrap { margin-top: 0; }
}
