/* Legal pages: the index (/informations-legales) and the eight documents
   rendered from legal/*.md. Loaded by those pages only, after styles.css. */

/* ---------- Index: two columns of documents between hairlines ---------- */
.doc-index {
  display: grid;
  list-style: none;
}
.doc-index li {
  min-width: 0;
  border-top: 1px solid var(--line);
}
.doc-index li:last-child {
  border-bottom: 1px solid var(--line);
}
.doc-index a {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-block: 22px;
  color: var(--text);
  text-decoration: none;
}
.doc-index .icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--brand-blue);
}
.doc-index-text {
  flex: 1;
  min-width: 0;
}
.doc-index strong {
  display: block;
  color: var(--heading);
  font-size: 1.0625rem;
  font-weight: 620;
  line-height: 1.4;
}
.doc-index-text > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9375rem;
}
.doc-index .chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.doc-index a:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-index a:hover .chevron {
  color: var(--heading);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .doc-index .chevron {
    transition: transform 160ms var(--ease);
  }
  .doc-index a:hover .chevron {
    transform: translateX(2px);
  }
}
@media (min-width: 900px) {
  .doc-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
  }
  .doc-index li:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- A document ----------
   Phone: « Sur cette page » folded at the top, the text, then the other
   documents. From 1000 px: a sticky side column (sections, then documents)
   beside a 720 px text. The source order stays text first, side column last. */
.legal-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-block: clamp(24px, 3vw + 12px, 64px) var(--section);
}
/* Inside the text, after the title (see renderLegalWithToc): the text's own
   list and link styles are undone here. */
.prose .legal-toc-compact {
  margin-top: 28px;
}
.legal-toc-compact details {
  border-block: 1px solid var(--line-strong);
}
.legal-toc-compact summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  color: var(--heading);
  font-weight: 620;
  cursor: pointer;
  list-style: none;
}
.legal-toc-compact summary::-webkit-details-marker {
  display: none;
}
.legal-toc-compact summary .icon {
  color: var(--muted);
}
.legal-toc-compact details[open] summary .icon {
  transform: rotate(90deg);
}
@media (prefers-reduced-motion: no-preference) {
  .legal-toc-compact summary .icon {
    transition: transform 180ms var(--ease);
  }
}
.legal-toc-compact ul,
.legal-toc ul,
.legal-docs ul {
  list-style: none;
}
.prose .legal-toc-compact ul {
  padding: 0 0 12px;
}
.prose .legal-toc-compact li + li {
  margin-top: 0;
}
.prose .legal-toc-compact a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 4px;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}
.prose .legal-toc-compact a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-aside {
  min-width: 0;
  font-size: 0.9062rem;
}
.legal-toc {
  display: none;
}
.legal-aside-title {
  margin-bottom: 8px;
  color: var(--heading);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.legal-docs {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.legal-docs a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}
.legal-docs a:hover {
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-docs a[aria-current='page'] {
  color: var(--heading);
  font-weight: 600;
}
@media (min-width: 1000px) {
  .legal-page {
    grid-template-columns: minmax(200px, 260px) minmax(0, 720px);
    gap: clamp(40px, 6vw - 20px, 80px);
    align-items: start;
  }
  .legal-toc-compact {
    display: none;
  }
  .prose {
    grid-column: 2;
    grid-row: 1;
  }
  .legal-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    grid-column: 1;
    grid-row: 1;
    display: grid;
    gap: 32px;
    max-height: calc(100vh - var(--header-h) - 48px);
    padding-bottom: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .legal-toc {
    display: block;
  }
  .legal-toc ul {
    border-left: 1px solid var(--line);
  }
  .legal-toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-left: -1px;
    padding: 4px 0 4px 12px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.35;
    text-decoration: none;
  }
  .legal-toc a:hover {
    border-left-color: var(--line-strong);
    color: var(--heading);
  }
  .legal-toc a[aria-current] {
    border-left-color: var(--action);
    color: var(--heading);
    font-weight: 600;
  }
  .legal-docs {
    padding-top: 24px;
  }
}

.draft-note {
  max-width: 76ch;
  margin-bottom: 32px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
}

/* ---------- Long-form text ---------- */
.prose {
  min-width: 0;
  color: var(--text);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  overflow-wrap: break-word;
}
.prose > * + * {
  margin-top: 16px;
}
.prose h1 {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 3rem);
  line-height: 1.08;
}
/* The version line under the title. */
.prose h1 + p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9062rem;
  font-variant-numeric: tabular-nums;
}
.prose h2 {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.018em;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h3 {
  margin-top: 32px;
  font-size: 1.125rem;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h4 {
  margin-top: 20px;
  font-size: 1rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: 8px;
}
.prose li::marker {
  color: var(--muted);
}
.prose a {
  color: var(--link);
  text-underline-offset: 3px;
}
.prose strong {
  color: var(--heading);
  font-weight: 620;
}
.prose blockquote {
  margin-inline: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--line-strong);
  background: var(--bg-alt);
  color: var(--text);
}
.prose hr {
  margin-block: 32px;
  border: 0;
  border-top: 1px solid var(--line);
}
.prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--surface-2);
  color: var(--heading);
  font-weight: 620;
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose code {
  font-size: 0.92em;
}
.prose .legal-toc-compact + h2 {
  margin-top: 32px;
}
