/* Legal and trust pages: privacy policy, cookie policy, website terms, accessibility statement,
 * trust and security FAQ, and the /legal/ hub.
 * Made to read like a proper document: one calm column, a short contents list at the top,
 * numbered sections, restrained headings, tables that turn into cards on a phone.
 * Tokens only, mobile first. Every rule is scoped to .legal-doc or a legal-* class so that the
 * shared type rules elsewhere are left alone. */

/* ---------------------------------------------------------------- header */
.legal-head { display: flex; align-items: flex-start; gap: var(--s-4); }
.legal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.legal-icon svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.legal-icon svg .dot { fill: currentColor; stroke: none; }
.legal-head__text { display: grid; gap: var(--s-2); min-width: 0; }
.legal-meta { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- the document column */
.legal-doc { max-width: 48rem; counter-reset: legal-section; }
.legal-doc > * + * { margin-top: var(--s-6); }

.legal-doc p,
.legal-doc li { font-size: var(--fs-0); line-height: 1.7; max-width: none; }
.legal-doc p + p { margin-top: var(--s-3); }

.legal-doc h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: pretty;
}
.legal-doc h3 {
  margin-top: var(--s-4);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}
.legal-doc h2 + p,
.legal-doc h2 + ul,
.legal-doc h2 + ol,
.legal-doc h3 + p,
.legal-doc h3 + ul { margin-top: var(--s-3); }

.legal-doc ul,
.legal-doc ol { display: grid; gap: var(--s-2); margin-top: var(--s-3); padding-left: 1.4em; }
.legal-doc p + ul,
.legal-doc p + ol { margin-top: var(--s-3); }
.legal-doc ul + p,
.legal-doc ol + p { margin-top: var(--s-3); }

/* A numbered section: a rule above, the number in the heading. */
.legal-section { padding-top: var(--s-5); border-top: 1px solid var(--line); }
.legal-doc--numbered .legal-section > h2::before {
  counter-increment: legal-section;
  content: counter(legal-section) ".";
  display: inline-block;
  min-width: 1.75rem;
  margin-right: 0.25rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------------------------------------------------------------- contents list at the top */
.legal__contents { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.legal__contents > summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--s-4);
  cursor: pointer;
  font-size: var(--fs-0);
  font-weight: 600;
  color: var(--ink);
}
.legal__contents .toc { border: 0; background: none; padding: 0 var(--s-4) var(--s-4); }
.legal__contents .toc__title { display: none; }
.legal__contents .toc__list { font-size: var(--fs-0); line-height: 1.5; gap: 6px; }
@media (min-width: 720px) {
  .legal__contents .toc__list { display: block; columns: 2; column-gap: var(--s-6); }
  .legal__contents .toc__list li { break-inside: avoid; padding-block: 3px; }
}

/* ---------------------------------------------------------------- summary box */
.legal-summary {
  padding: var(--s-4);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.legal-summary > :first-child { margin-top: 0; }
.legal-summary p { font-size: var(--fs-0); }
.legal-summary__label { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }

/* ---------------------------------------------------------------- tables */
.legal-doc .table-wrap { margin-top: var(--s-3); }
.legal-table th, .legal-table td { font-size: 0.9375rem; line-height: 1.55; vertical-align: top; }
.legal-table tbody th { min-width: 9rem; font-weight: 600; }
.legal-table p { font-size: 0.9375rem; }

@media (max-width: 719px) {
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; }
  .legal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .legal-table tr {
    margin-bottom: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .legal-table th, .legal-table td { padding: 4px 0; border: 0; }
  .legal-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .legal-table tbody th { font-size: var(--fs-0); padding-bottom: var(--s-2); }
}

/* ---------------------------------------------------------------- FAQ page */
.legal-doc .faqs { max-width: none; margin-top: var(--s-3); }
.legal-doc .faq__q { font-size: var(--fs-0); font-weight: 600; }
.legal-doc .faq__a p,
.legal-doc .faq__a li { font-size: var(--fs-0); }

/* ---------------------------------------------------------------- hub */
.legal-list { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.legal-list > li { margin: 0; }
.legal-list__item {
  display: grid;
  gap: 4px;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.legal-list__item .legal-list__title { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.legal-list__item p { margin: 0; }
.legal-list__item .doc-dates { font-size: var(--fs--1); }

.legal-facts { display: grid; gap: var(--s-3); margin: 0; }
.legal-facts > div { display: grid; gap: 2px; }
.legal-facts dt { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.legal-facts dd { margin: 0; font-size: var(--fs-0); }
@media (min-width: 640px) {
  .legal-facts > div { grid-template-columns: 12rem minmax(0, 1fr); gap: var(--s-4); }
}

.doc-dates { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- print */
@media print {
  .legal__contents { display: none; }
  .legal-summary { border: 1px solid var(--ink); background: none; break-inside: avoid; }
  .legal-section { break-inside: avoid-page; }
}
