/* =====================================================================
   FiThrive - legal pages (privacy policy, terms of use)
   Extends css/styles.css. Uses the same design tokens; adds only the
   long-form document typography the landing page doesn't need.
   ===================================================================== */

.legal {
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

/* Reading column - narrower than the 1200px site container for legibility */
.legal-inner {
  max-width: 60rem;
  margin-inline: auto;
}

/* ---------- Document header ---------- */
.legal-back {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.15s var(--ease);
}
.legal-back:hover { color: var(--color-cta); }

.legal-head { margin-bottom: 2.5rem; }
.legal-head h1 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
}
.legal-meta {
  margin-top: 1rem;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ---------- Table of contents ---------- */
.legal-toc {
  margin-bottom: 3.25rem;
  padding: 1.35rem 1.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
}
.legal-toc h2 {
  margin-bottom: 0.9rem;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2.5rem;
  counter-reset: toc;
}
.legal-toc li {
  margin-bottom: 0.5rem;
  break-inside: avoid;
  counter-increment: toc;
}
.legal-toc a {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  transition: color 0.15s var(--ease);
}
.legal-toc a::before {
  content: counter(toc) ". ";
  color: var(--color-text-muted);
}
.legal-toc a:hover { color: var(--color-cta); }
@media (max-width: 560px) {
  .legal-toc ol { columns: 1; }
}

/* ---------- Document body ---------- */
.legal-body { color: var(--color-text-secondary); }

.legal-body section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 88px;   /* clears the sticky header on anchor jumps */
}

.legal-body h2 {
  margin-bottom: 1.1rem;
  color: var(--color-text);
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  letter-spacing: -0.01em;
}
.legal-body h3 {
  margin: 1.9rem 0 0.65rem;
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 700;
}
.legal-body p {
  margin-bottom: 1.05rem;
  line-height: 1.75;
}
.legal-body ul {
  margin: 0 0 1.15rem;
  padding-left: 1.3rem;
}
.legal-body li {
  margin-bottom: 0.55rem;
  line-height: 1.7;
}
.legal-body li::marker { color: var(--color-text-muted); }

.legal-body strong { color: var(--color-text); font-weight: 700; }
.legal-body a { color: var(--color-cta); }
.legal-body a:hover { text-decoration: underline; }

/* Lead paragraph under the title of a section group */
.legal-body .lead { color: var(--color-text-secondary); }

/* ---------- Tables (lawful bases, subprocessors) ---------- */
.legal-table-wrap {
  margin: 0.25rem 0 1.35rem;
  overflow-x: auto;                       /* the only element allowed to scroll sideways */
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.legal-table {
  width: 100%;
  min-width: 34rem;                        /* forces horizontal scroll on narrow phones */
  border-collapse: collapse;
  font-size: 0.95rem;
}
.legal-table th,
.legal-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}
.legal-table thead th {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  white-space: nowrap;
}
.legal-table td { color: var(--color-text-secondary); }
.legal-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Contact block ---------- */
.legal-contact {
  padding: 1.35rem 1.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
}
.legal-contact p { margin-bottom: 0.4rem; }
.legal-contact p:last-child { margin-bottom: 0; }
