/*
 * legal.css — the legal documents (/legal/privacy, /terms, /clara,
 * /data-deletion) inside the website's frame. Builds on beta.css: its
 * tokens, header, footer and type. A reading column of 760px, a row of tabs
 * between the four documents, a contents list, then the document.
 *
 * The section bodies come from legalController.ts as HTML with a few classes
 * of their own (p.dim, .callout, table.matrix, td.dim); they are styled here
 * and only under .legal__doc.
 */

.legal {
  --wrap-max: 760px;
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.legal__title {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.legal__meta {
  margin-top: 10px;
  color: var(--faint);
  font-size: 13px;
}

/* the four documents, as tabs: the one being read is underlined in ink */
.legal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 24px;
  border-bottom: 1px solid var(--line);
}
.legal__tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: 500 14.5px/1 var(--sans);
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.legal__tabs a:hover {
  color: var(--ink);
}
.legal__tabs a[aria-current='page'] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.legal__lede {
  max-width: 60ch;
  margin-top: 28px;
  color: var(--dim);
  font-size: 16px;
  line-height: 1.65;
}

.legal__toc {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.legal__toc p {
  margin-bottom: 10px;
  color: var(--faint);
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.legal__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .legal__toc ol {
    columns: 2;
    column-gap: 24px;
  }
}
.legal__toc li {
  break-inside: avoid;
  margin-bottom: 6px;
}
.legal__toc a {
  color: var(--dim);
  font-size: 14px;
  text-decoration: none;
}
.legal__toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ── the document ───────────────────────────────────────────────────────── */

.legal__doc {
  margin-top: 40px;
  font-size: 16px;
  line-height: 1.7;
}
.legal__doc section {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.legal__doc section:last-of-type {
  margin-bottom: 0;
}
.legal__doc h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.legal__doc h2 .num {
  color: var(--faint);
  font: 500 13px/1 var(--mono);
}
.legal__doc h3 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 600;
}
.legal__doc p {
  margin-bottom: 14px;
}
.legal__doc p.dim {
  color: var(--dim);
}
.legal__doc ul,
.legal__doc ol {
  margin-bottom: 14px;
  padding-left: 22px;
}
.legal__doc li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.legal__doc li::marker {
  color: var(--faint);
}
.legal__doc strong {
  font-weight: 600;
}
.legal__doc a {
  text-decoration-color: var(--line-strong);
}
.legal__doc a:hover {
  text-decoration-color: currentColor;
}
.legal__doc .callout {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.legal__doc .callout p:last-child {
  margin-bottom: 0;
}
/* wide tables scroll inside the column rather than widening the page */
.legal__doc table.matrix {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 16px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}
.legal__doc table.matrix th,
.legal__doc table.matrix td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.legal__doc table.matrix th {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.legal__doc table.matrix td.dim {
  color: var(--faint);
}

.legal__totop {
  display: inline-block;
  margin-top: 28px;
  color: var(--faint);
  font-size: 13px;
  text-decoration: none;
}
.legal__totop:hover {
  color: var(--ink);
}

@media print {
  .site-header,
  .site-footer,
  .legal__tabs,
  .legal__toc,
  .legal__totop {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
