/* Shared layout for the three legal pages (privacy-policy.html,
   terms-of-use.html, cookie-policy.html) — loaded only by those pages. The
   header/footer they use is the site's own real markup + layout.css/
   components.css rules, same convention as expertise.css/contact-flow.css:
   nothing for header/footer lives here. Editorial and minimal per brief:
   no cards, no icons, no gradients, no accordions for essential legal
   content, no animation beyond the sitewide standard. */

.legal-page {
  padding-top: clamp(72px, 9vh, 120px);
  padding-bottom: var(--cb-space-9);
  /* Single source of truth for the TOC column's width, shared between
     .legal-page__body's own grid-template-columns below and the hero's
     alignment margin further down — one token, not two independently
     hardcoded numbers that could drift apart. */
  --legal-toc-width: 220px;
}

.legal-page__header {
  max-width: 50rem;
}

/* Aligns the hero block (eyebrow/H1/last-updated/intro) with the article
   column's own left edge rather than the container's left edge — below
   64rem the TOC column doesn't exist yet (.legal-page__body collapses to
   one column starting at the same position as the hero), so no shift is
   needed there; this only applies once the two-column TOC+content grid
   below is actually active. */
@media (min-width: 64rem) {
  .legal-page__header {
    margin-left: calc(var(--legal-toc-width) + var(--cb-space-7));
  }
}

.legal-page__title {
  margin: var(--cb-space-3) 0 0;
  font-family: var(--cb-font-sans);
  font-weight: var(--cb-weight-medium);
  /* Deliberately smaller than the marketing H1s elsewhere on the site
     (--cb-text-display-size) — brief: "keep legal body copy materially
     smaller than marketing H1s". This reuses the page-heading scale
     already used for e.g. the Expertise intro's own H1. */
  font-size: var(--cb-text-page-heading-size);
  line-height: var(--cb-text-page-heading-leading);
  letter-spacing: var(--cb-text-page-heading-tracking);
  color: var(--cb-color-ink);
}

.legal-page__meta {
  margin: var(--cb-space-3) 0 0;
  font-size: var(--cb-text-metadata-size);
  letter-spacing: var(--cb-text-metadata-tracking);
  color: var(--cb-color-text-secondary);
}

.legal-page__intro {
  margin: var(--cb-space-5) 0 0;
  max-width: 46rem;
  font-size: var(--cb-text-subheading-size);
  line-height: 1.6;
  color: var(--cb-color-text-secondary);
}

.legal-page__body {
  margin-top: var(--cb-space-8);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--cb-space-7);
}

/* Table of contents — desktop only (brief: "optional small table of
   contents on desktop... normal continuous reading on mobile"). Sticky so
   it stays reachable while reading a long policy, without ever
   overlapping the header (top offset clears it) or trapping scroll of its
   own. */
@media (min-width: 64rem) {
  .legal-page__body {
    grid-template-columns: var(--legal-toc-width) minmax(0, 50rem);
    align-items: start;
  }

  .legal-page__toc {
    position: sticky;
    top: var(--cb-space-6);
  }
}

.legal-page__toc {
  display: none;
}

@media (min-width: 64rem) {
  .legal-page__toc {
    display: block;
  }
}

.legal-page__toc-label {
  margin: 0 0 var(--cb-space-3);
}

.legal-page__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--cb-space-2);
}

.legal-page__toc a {
  display: block;
  font-size: var(--cb-text-small-size);
  line-height: 1.5;
  color: var(--cb-color-text-secondary);
  text-decoration: none;
}

.legal-page__toc a:hover,
.legal-page__toc a:focus-visible {
  color: var(--cb-color-ink);
  text-decoration: underline;
}

.legal-page__content {
  min-width: 0;
  max-width: 50rem;
}

.legal-page__content section {
  padding-top: var(--cb-space-7);
}

.legal-page__content section:first-child {
  padding-top: 0;
}

.legal-page__content section + section {
  border-top: var(--cb-border-width) solid var(--cb-color-line);
}

.legal-page__content h2 {
  margin: 0 0 var(--cb-space-4);
  font-family: var(--cb-font-sans);
  font-weight: var(--cb-weight-medium);
  font-size: var(--cb-text-section-heading-size);
  line-height: var(--cb-text-section-heading-leading);
  letter-spacing: var(--cb-text-section-heading-tracking);
  color: var(--cb-color-ink);
  scroll-margin-top: var(--cb-space-6);
}

.legal-page__content h3 {
  margin: var(--cb-space-5) 0 var(--cb-space-3);
  font-family: var(--cb-font-sans);
  font-weight: var(--cb-weight-medium);
  font-size: var(--cb-text-subheading-size);
  line-height: var(--cb-text-subheading-leading);
  color: var(--cb-color-ink);
}

.legal-page__content p {
  margin: 0 0 var(--cb-space-4);
  font-size: var(--cb-text-body-size);
  line-height: var(--cb-text-body-leading);
  color: var(--cb-color-text-secondary);
}

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

.legal-page__content ul,
.legal-page__content ol.legal-page__list {
  margin: 0 0 var(--cb-space-4);
  padding-left: 1.25em;
  color: var(--cb-color-text-secondary);
}

.legal-page__content li {
  margin-bottom: var(--cb-space-2);
  font-size: var(--cb-text-body-size);
  line-height: var(--cb-text-body-leading);
}

.legal-page__content li:last-child {
  margin-bottom: 0;
}

.legal-page__content a {
  color: var(--cb-color-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-page__content a:hover,
.legal-page__content a:focus-visible {
  color: var(--cb-color-text-secondary);
}

.legal-page__content strong {
  font-weight: var(--cb-weight-medium);
  color: var(--cb-color-ink);
}

/* Development placeholder — easy to search ([LEGAL TODO: ...]), also
   visually flagged so it can never be mistaken for finished copy. */
.legal-page__todo {
  color: var(--cb-color-ink);
  background: color-mix(in srgb, var(--cb-color-ink) 6%, transparent);
  padding: 0.05em 0.4em;
  border-radius: var(--cb-radius);
  font-weight: var(--cb-weight-medium);
}

/* Readable technology table (cookie-policy.html) — plain, restrained,
   never a boxed/shadowed "pricing table" style. */
.legal-page__table-wrap {
  margin: 0 0 var(--cb-space-4);
  overflow-x: auto;
}

.legal-page__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--cb-text-small-size);
}

.legal-page__table caption {
  text-align: left;
  margin-bottom: var(--cb-space-3);
  color: var(--cb-color-text-secondary);
}

.legal-page__table th,
.legal-page__table td {
  text-align: left;
  vertical-align: top;
  padding: var(--cb-space-3) var(--cb-space-3) var(--cb-space-3) 0;
  border-bottom: var(--cb-border-width) solid var(--cb-color-line);
}

.legal-page__table th {
  font-weight: var(--cb-weight-medium);
  color: var(--cb-color-ink);
  white-space: nowrap;
}

.legal-page__table td {
  color: var(--cb-color-text-secondary);
}
