/* Long-form styling for the legal pages (privacy, terms, cookies, contact).
   Builds on hub.css: reuses its custom properties and header/footer styles. */

.legal {
  max-width: 760px;
  padding: 8px 16px 40px;
  color: var(--text);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.legal h1 {
  margin: 12px 0 6px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  line-height: 1.15;
}

.legal h2 {
  margin: 36px 0 10px;
  padding-top: 4px;
  font-size: 22px;
  line-height: 1.3;
  scroll-margin-top: 16px;
}

.legal h2 + p,
.legal h2 + ul,
.legal h2 + ol,
.legal h2 + .table-wrap {
  margin-top: 0;
}

.legal p,
.legal ul,
.legal ol {
  margin: 0 0 14px;
  color: var(--text);
}

.legal ul,
.legal ol {
  padding-left: 22px;
}

.legal li {
  margin: 6px 0;
}

.legal strong {
  font-weight: 700;
}

.legal a {
  color: #9fb0ff;
  text-underline-offset: 3px;
}

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

.legal a:focus-visible,
.legal .link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.legal code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(120, 135, 255, 0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.legal .updated {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

/* Table of contents */
.legal .toc {
  margin: 0 0 8px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--edge);
}

.legal .toc p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal .toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2 220px;
  column-gap: 28px;
}

.legal .toc li {
  margin: 2px 0;
  break-inside: avoid;
  font-size: 15px;
}

/* Buttons that should read as inline links */
.legal .link-button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #9fb0ff;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.legal .link-button:hover {
  color: var(--text);
}

/* Tables scroll sideways on narrow screens instead of overflowing the page */
.legal .table-wrap {
  margin: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--edge);
}

.legal table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.legal th,
.legal td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(120, 135, 255, 0.16);
}

.legal th {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.legal td {
  color: var(--muted);
}

.legal tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 600px) {
  .legal {
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal h2 {
    font-size: 20px;
  }

  .legal .toc ol {
    columns: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .legal a {
    transition: color 0.15s ease;
  }
}
