/* ==========================================================================
   Light Astra — legal pages (privacy.html, terms.html)
   One stylesheet for both: the hero's date column, the sticky table of
   contents beside the running text, the sections' rhythm and the data table
   that stacks on phones. Plain and readable on purpose.
   ========================================================================== */


.page-hero__copy {
  --flow: var(--space-5);
}

.page-hero__copy .eyebrow {
  color: var(--ink);
}

.legal__meta {
  font-size: var(--text-sm);
}

.legal__meta .spec__value {
  font-weight: 500;
}

.legal__meta a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---- layout: contents, then the text; two columns from 900px --------------------- */
.legal__layout {
  display: grid;
  gap: var(--space-7);
}

/* ---- table of contents -------------------------------------------------------------- */
.legal__toc .eyebrow {
  margin-bottom: var(--space-3);
}

.legal__toc-list {
  counter-reset: toc;
  border-top: var(--border);
}

.legal__toc-list li {
  counter-increment: toc;
  border-bottom: var(--border);
}

.legal__toc-list a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-2);
  min-height: var(--target);
  padding-block: 0.55rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.legal__toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.legal__toc-list a:hover {
  color: var(--accent);
}

/* ---- the running text ------------------------------------------------------------- */
.legal__content {
  max-width: var(--container-text);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--ink-2);
}

.legal__section + .legal__section {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: var(--border);
}

.legal__section > * + * {
  margin-top: 1em;
}

.legal__section h2 {
  font-size: var(--display-3);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.legal__section h3 {
  margin-top: 1.75em;
  font-size: var(--title-sm);
}

.legal__section ul,
.legal__section ol {
  padding-left: 1.25em;
}

.legal__section li + li {
  margin-top: 0.45em;
}

.legal__section a {
  color: var(--ink);
  font-weight: 600;
}

.legal__section a:hover {
  color: var(--accent);
}

/* ---- the data table (what is collected, why, how long) -------------------------------- */
.legal__table caption {
  caption-side: top;
  padding-bottom: 0.75rem;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.legal__table th[scope="row"] {
  font-weight: 600;
}

/* Phones: each row stacks, and the column header is repeated before its cell from
   data-label; the ARIA roles in the markup keep the table semantics. */
@media (max-width: 599.98px) {
  .legal__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .legal__table,
  .legal__table tbody,
  .legal__table tr,
  .legal__table th,
  .legal__table td {
    display: block;
  }

  .legal__table caption {
    display: block;
  }

  .legal__table tr {
    padding-block: 0.9rem;
    border-bottom: var(--border);
  }

  .legal__table th,
  .legal__table td {
    padding: 0.3rem 0;
    border: 0;
  }

  .legal__table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--ink-3);
  }
}

/* ---- breakpoints --------------------------------------------------------------- */
/* Tablets: the contents list runs in two columns above the text. */
@media (min-width: 600px) and (max-width: 899.98px) {
  .legal__toc-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-6);
  }
}

@media (min-width: 900px) {
  .legal__layout {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-8);
    align-items: start;
  }

  /* Sticky beside the text; compact rows so a twenty-item list fits a desktop viewport. */
  .legal__toc {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    max-height: calc(100vh - var(--header-h) - 3rem);
    overflow-y: auto;
    padding-right: var(--space-4);
  }

  .legal__toc-list a {
    min-height: 2.25rem;
    padding-block: 0.4rem;
  }
}

@media (min-width: 1200px) {
  .legal__layout {
    gap: var(--space-9);
  }
}
