/* ==========================================================================
   Legal pages — Terms & Privacy (sidebar TOC + article)
   ========================================================================== */

.legal {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-7) var(--container-pad-mobile) var(--sp-8);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-7);
  align-items: start;
}

/* Table of contents sidebar */
.toc {
  position: sticky;
  top: 76px;
}

.toc strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  margin-bottom: var(--sp-3);
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--duration-fast);
}

.toc a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Article content */
.doc h1 {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: var(--ls-display);
  margin-bottom: var(--sp-1);
}

.doc .meta {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: var(--sp-5);
}

.doc .summary {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  font-size: 15px;
  color: var(--text-2);
  line-height: var(--lh-body);
}

.doc section {
  margin-bottom: var(--sp-6);
}

.doc h2 {
  font-size: var(--fs-h4);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.doc p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: var(--sp-3);
}

.doc ul {
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-3);
}

.doc li {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: var(--sp-1);
}

.doc a {
  color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
  .legal {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc {
    position: static;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-5);
  }

  .toc ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
  }
}
