/* legal.css — mise en page des documents légaux (CGU, confidentialité,
   mentions légales). Pages autonomes : pas de styles.css, pas de bundle JS,
   pour rester lisibles même si l'application ne charge pas. Palette alignée
   sur La Zone (navy, corail) avec bascule sombre système. */

:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --text: #334155;
  --text-soft: #52627a;
  --text-muted: #64748b;
  --line: #dbe2ea;
  --brand: #1b2a4a;
  --accent: #bd3c28;
  --accent-soft: #fdf0ed;
  --focus: #0596de;
  --max: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b;
    --surface: #161d26;
    --text: #cbd5e1;
    --text-soft: #a9b6c7;
    --text-muted: #8fa0b5;
    --line: #2a3644;
    --brand: #eef2f7;
    --accent: #f0836e;
    --accent-soft: #2a1b18;
    --focus: #45a9e8;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 12px;
  background: var(--surface);
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

/* ── En-tête de page ───────────────────────────────────────────────────── */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-head__inner {
  max-width: calc(var(--max) + 64px);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-head__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.site-head__brand img { display: block; height: 26px; width: auto; }
.site-head__back {
  font-size: 0.9rem;
  color: var(--text-soft);
  text-decoration: none;
}
.site-head__back:hover { color: var(--accent); text-decoration: underline; }

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}
.legal-nav a { color: var(--text-soft); text-decoration: none; }
.legal-nav a:hover { color: var(--accent); text-decoration: underline; }
.legal-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* ── Corps du document ─────────────────────────────────────────────────── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.doc-meta {
  margin: 0 0 8px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: var(--brand);
}

.doc-lede {
  margin: 0 0 32px;
  font-size: 1.05rem;
  color: var(--text-soft);
}

h2 {
  margin: 44px 0 12px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--brand);
  scroll-margin-top: 16px;
}

h3 {
  margin: 24px 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
}

p { margin: 0 0 14px; }

ul, ol { margin: 0 0 16px; padding-left: 1.3em; }
li { margin-bottom: 6px; }

strong { color: var(--brand); }

.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}
.callout p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
}
caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 6px;
}
th, td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
}
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 55%, transparent); }

/* Les tableaux à quatre colonnes ont besoin d'air : sur mobile, on laisse
   défiler horizontalement plutôt que d'écraser la lecture. */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 620px; }
.table-scroll table.wide { min-width: 760px; }

/* ── Bouton d'opposition Matomo ────────────────────────────────────────── */
.optout {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 6px;
}
.optout button {
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.optout button:hover { background: var(--accent); color: var(--surface); }
.optout button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--surface);
}
.optout__status {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

/* ── Pied de page ──────────────────────────────────────────────────────── */
.legal-foot {
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.legal-foot__inner {
  max-width: calc(var(--max) + 64px);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.legal-foot p { margin: 0; }
.legal-foot a { color: var(--text-muted); }
.legal-foot a:hover { color: var(--accent); }

/* ── Impression : le document, rien d'autre ────────────────────────────── */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --brand: #000; --text-muted: #333; }
  .site-head__back, .legal-foot, .optout button { display: none; }
  main { max-width: none; padding: 0; }
  a { color: #000; }
  h2 { break-after: avoid; }
  table { font-size: 0.8rem; }
}

@media (max-width: 560px) {
  main { padding: 28px 18px 48px; }
  .site-head__inner { padding: 14px 18px; }
  .table-scroll table { min-width: 540px; }
}
