/* ============================================================
   SARGAWATT – Legal pages (mentions légales / confidentialité)
   Sober reading layout – depends on styles.css for tokens & header/footer
   ============================================================ */

/* ---------- Hero ---------- */
.legal-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.legal-hero .wrap {
  padding-block: clamp(48px, 7vw, 92px) clamp(36px, 5vw, 56px);
}
.legal-hero .eyebrow { margin-bottom: 18px; }
.legal-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.04;
}
.legal-hero .sub {
  margin-top: 18px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-soft);
  max-width: 620px;
}
.legal-hero .updated {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  letter-spacing: 0.01em;
}

/* ---------- Document layout ---------- */
.legal-doc { background: var(--bg); }
.legal-doc .wrap {
  padding-block: clamp(44px, 6vw, 80px);
}
.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}

/* ---------- Table of contents (sticky) ---------- */
.legal-toc {
  position: sticky;
  top: 100px;
  font-size: 14px;
}
.legal-toc .toc-label {
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.legal-toc ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: toc;
  display: flex; flex-direction: column;
}
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  flex: none;
}
.legal-toc a:hover { color: var(--teal-700); }

/* ---------- Article body ---------- */
.legal-body { min-width: 0; }
.legal-section {
  padding-block: clamp(26px, 3vw, 38px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 100px;
}
.legal-section:first-child { border-top: 0; padding-top: 0; }
.legal-section h2 {
  font-size: clamp(21px, 2.2vw, 27px);
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.legal-section h2 .num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.62em;
  color: var(--teal);
  letter-spacing: 0;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.legal-section > p {
  margin-top: 16px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 64ch;
}
.legal-section > p strong { color: var(--ink); font-weight: 700; }
.legal-section > p + p { margin-top: 14px; }
.legal-section a:not(.btn) {
  color: var(--teal-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.legal-section a:not(.btn):hover { text-decoration-color: var(--teal); }

/* Identity block (éditeur) */
.legal-identity {
  margin-top: 18px;
  border-left: 2px solid var(--teal);
  padding: 4px 0 4px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-identity dt {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}
.legal-identity dd {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.5;
}
.legal-identity dd:last-child { margin-bottom: 0; }

/* "À compléter" callout (hébergeur) */
.legal-callout {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  background: var(--teal-tint-2);
  border: 1px solid var(--gray-300);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.legal-callout svg {
  flex: none;
  width: 20px; height: 20px;
  color: var(--teal-700);
  margin-top: 2px;
}
.legal-callout .co-body { min-width: 0; }
.legal-callout .co-tag {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-700);
  display: block;
  margin-bottom: 6px;
}
.legal-callout p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Inline contact / cross-link footer of a section */
.legal-inline-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--teal-700);
  text-decoration: none !important;
}
.legal-inline-link svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.legal-inline-link:hover svg { transform: translateX(4px); }

/* Foot note line under the document */
.legal-footnote {
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc {
    position: static;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 18px 20px;
  }
  .legal-toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
}

@media (max-width: 520px) {
  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-section h2 { gap: 10px; }
}
