/* ============================================================
   LEGAL — long-form prose pages (privacy, terms, DPA, cookies)
   Uses the same tokens as the rest of the site; only the reading
   measure and vertical rhythm are specific to these pages.
   ============================================================ */

.legal {
  padding-top: calc(var(--nav-height) + var(--space-4xl));
  padding-bottom: var(--space-4xl);
  padding-inline: var(--section-padding-x);
}

.legal__inner {
  max-width: 44rem;        /* ~70 characters at this size */
  margin-inline: auto;
}

.legal__meta {
  display: block;
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.legal__body h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: var(--fw-light);
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
}

.legal__body h2 {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: var(--fw-medium);
  line-height: 1.35;
  color: var(--text-primary);
  margin-top: var(--space-4xl);
  margin-bottom: var(--space-md);
}

/* Sub-headings take the site's mono label treatment. In the same sans as h2
   they were nearly indistinguishable from it — this reads as a different tier
   at a glance rather than as a slightly smaller heading. */
.legal__body h3,
.legal__body h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--fw-book);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.legal__body p,
.legal__body li {
  font-size: 0.9375rem;              /* 15px */
  font-weight: var(--fw-light);      /* 300 — Modern Era Light */
  line-height: 2em;                  /* open leading for long legal passages */
  color: var(--text-secondary);
}

.legal__body p {
  margin-bottom: var(--space-lg);
}

.legal__body ul,
.legal__body ol {
  margin: 0 0 var(--space-lg);
  padding-left: var(--space-xl);
  list-style: disc;
}

.legal__body ol {
  list-style: decimal;
}

.legal__body li {
  margin-bottom: var(--space-sm);
}

.legal__body li::marker {
  color: var(--text-faint);
}

.legal__body strong,
.legal__body b {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

.legal__body a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-muted);   /* --border-primary was 1.4:1 in light mode */
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}

.legal__body a:hover {
  text-decoration-color: currentColor;
}

/* First heading after the title should not add its large top margin */
.legal__body h1 + h2 {
  margin-top: 0;
}

@media (max-width: 48rem) {
  .legal {
    padding-top: calc(var(--nav-height) + var(--space-3xl));
  }

  .legal__body h2 {
    margin-top: var(--space-3xl);
  }
}

/* --- Tables (definitions, DPA annexes, data categories) --- */
/* The wrapper scrolls rather than the page, so a wide table cannot break the
   layout on a phone. tabindex makes it keyboard-scrollable. */
.legal__table-wrap {
  margin: 0 0 var(--space-xl);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-weight: var(--fw-light);
  line-height: 2;                    /* tighter than the prose — cells are short */
}

.legal__table th,
.legal__table td {
  padding: var(--space-md);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.legal__table tr:last-child td {
  border-bottom: none;
}

.legal__table th {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.legal__table td:first-child {
  color: var(--text-primary);
  min-width: 9rem;
}

.legal__table b,
.legal__table strong {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

.legal__table p {
  margin: 0 0 var(--space-sm);
}

.legal__table p:last-child {
  margin-bottom: 0;
}

.legal__table ul,
.legal__table ol {
  margin: 0 0 var(--space-sm);
  padding-left: var(--space-lg);
}

/* --- Metadata chips (cookie entries) --- */
/* "Type: Session Cookies" and "Administered by: Us" were full paragraphs, so
   the 2.5em prose leading pushed them a line apart each. As chips they sit on
   one row and read as attributes rather than sentences. */
.legal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-sm) 0 var(--space-md);
}

.legal__chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
}

.legal__chip-key {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* The analytics switch on the cookies page. js/analytics.js says
   where it stands and shows the button; without JavaScript the
   status line explains why there is none. */
.legal__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border-subtle);
}

.legal__body .legal__control-status {
  flex: 1 1 18rem;
  margin: 0;
  line-height: 1.6;
  color: var(--text-primary);
}

.legal__control-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
