/* ============================================================================
   Atherys — pages légales
   ----------------------------------------------------------------------------
   Un texte juridique se lit sur un écran de téléphone, dans une file d'attente,
   par quelqu'un qui cherche UNE réponse. D'où : une colonne étroite, un
   sommaire qui suit, des tableaux qui défilent sans casser la page, et des
   trous « à compléter » qu'on ne peut pas rater.

   Ce fichier vient APRÈS site.css et n'en redéfinit aucun token.
   ========================================================================== */

.doc-page { padding-top: 74px; }

.doc { padding-block: clamp(34px, 5vw, 64px) clamp(60px, 8vw, 110px); }

.doc__grid {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

/* ── Sommaire ───────────────────────────────────────────────────────────── */

.doc__aside { position: sticky; top: 104px; }
.doc__aside .eyebrow { margin-bottom: 14px; }
.doc__aside nav { display: grid; gap: 2px; }
.doc__aside a {
  display: block;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.doc__aside a:hover { color: var(--text); background: var(--surface); }

/* ── Le texte ───────────────────────────────────────────────────────────── */

.doc__body { max-width: 70ch; }

.doc__body h1 {
  font-size: clamp(1.95rem, 4.6vw, 2.85rem);
  letter-spacing: -0.035em;
  margin-bottom: 26px;
}

.doc__body h2 {
  font-size: clamp(1.24rem, 2.6vw, 1.5rem);
  letter-spacing: -0.025em;
  margin: 52px 0 14px;
  padding-left: 16px;
  border-left: 2.5px solid var(--accent);
  scroll-margin-top: 104px;
}

.doc__body h3 {
  font-size: 1.04rem;
  margin: 32px 0 10px;
  color: var(--text);
  scroll-margin-top: 104px;
}

.doc__body p {
  margin: 0 0 17px;
  color: var(--text-mid);
  line-height: 1.68;
}
.doc__body strong { color: var(--text); font-weight: 600; }
.doc__body em { color: var(--text-mid); }

.doc__body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.doc__body a:hover { color: var(--accent); }

.doc__body ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.doc__body li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 11px;
  color: var(--text-mid);
  line-height: 1.62;
}
.doc__body li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.doc__body hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 44px 0;
}

.doc__body code {
  font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ── Tableaux ────────────────────────────────────────────────────────────
   Seul élément autorisé à déborder — et il déborde dans son propre cadre,
   jamais en poussant la page de côté. */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.doc__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 460px;
}
.doc__body th,
.doc__body td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-mid);
}
.doc__body th {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.doc__body tbody tr:last-child td { border-bottom: 0; }

/* ── Ce qui manque encore ────────────────────────────────────────────────
   Un trou dans un texte légal ne se signale pas en gris clair. */

mark.todo {
  display: inline-block;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--text);
  border-radius: 8px;
  padding: 3px 10px;
  margin: 2px 0;
  line-height: 1.5;
}
mark.todo b {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--danger);
  margin-right: 8px;
  white-space: nowrap;
}

/* ── D'où vient cette page ──────────────────────────────────────────────── */

.doc__source {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ── Pied de page des documents ─────────────────────────────────────────── */

.doc-page .site-footer nav { margin-bottom: 8px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .doc__grid { grid-template-columns: minmax(0, 1fr); }
  .doc__aside {
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 16px 18px;
    margin-bottom: 34px;
  }
  .doc__aside nav {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-flow: row;
    display: grid;
  }
  .doc__body { max-width: none; }
}

@media (max-width: 700px) {
  .doc-page { padding-top: 66px; }
  .doc__body table { min-width: 380px; }
  .doc__body th, .doc__body td { padding: 10px 12px; }
}
