/* ═══════════════════════════════════════════════════════════
   legal.css : the three legal pages (privacy.php, cookies.php,
   terms.php). Prefix: lg-  (see _dev/docs/css-naming-legend.md)

   One stylesheet for all three: they are the same document type,
   and a legal page that looks different from its sibling reads as
   less trustworthy, not more.

   Design brief: this is the one place on the site where nothing
   should move, shimmer, or reveal on scroll. Someone reading a
   privacy policy wants to find a fact and leave. Long-form
   measure, big type, quiet everything.

   Breakpoints follow the base.css standard:
     phone max-width:767 / tablet 768..899 / desktop min-width:900
   Base rules come FIRST, media queries LAST (a base rule placed
   after a media query silently wins and the responsive value dies).
   ═══════════════════════════════════════════════════════════ */

/* ── Page shell ────────────────────────────────────────────── */

.page-legal { background: var(--bg); }

.lg { padding-top: clamp(7rem, 12vw, 9.5rem); padding-bottom: clamp(4rem, 8vw, 7rem); }

/* 74ch keeps a line of prose at a comfortable length. Past roughly
   80 the eye loses its place jumping back to the next line. */
.lg-inner { max-width: 74ch; }

/* ── Header ────────────────────────────────────────────────── */

.lg-head { padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }

.lg-title {
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-top: 1rem;
}

.lg-updated {
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Table of contents ─────────────────────────────────────── */

/* These pages are long and are read the way a manual is read: someone wants one
   fact, not the whole document. Two columns on desktop so the whole map fits
   above the fold instead of becoming its own scroll. */

.lg-toc { margin-bottom: 2.75rem; padding: 1.4rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); }

.lg-toc-t {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.lg-toc-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }

.lg-toc-list li { margin: 0 0 0.5rem; padding: 0; break-inside: avoid; }

.lg-toc-list a {
  font-family: var(--font-prose);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text2);
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease);
}

.lg-toc-list a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }

/* ── Body copy ─────────────────────────────────────────────── */

.lg-body { font-family: var(--font-prose); color: var(--body-color); }

.lg-body p { font-size: var(--body-size); line-height: 1.68; margin-bottom: 1.15rem; }

.lg-lede { font-size: clamp(1.05rem, 2.1vw, 1.2rem); line-height: 1.6; color: var(--text2); margin-bottom: 2rem; }

.lg-body h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.55rem);
  letter-spacing: -0.018em;
  margin: 2.75rem 0 0.9rem;
  /* scroll-margin so an in-page #anchor does not land under the fixed navbar */
  scroll-margin-top: 6rem;
}

.lg-body h3 {
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 1.9rem 0 0.6rem;
  color: var(--text);
}

.lg-body ul { margin: 0 0 1.3rem; padding-left: 1.15rem; }

.lg-body li {
  font-family: var(--font-prose);
  font-size: var(--body-size);
  line-height: 1.62;
  color: var(--body-color);
  margin-bottom: 0.5rem;
  padding-left: 0.3rem;
}

.lg-body li::marker { color: var(--accent); }

.lg-body strong { color: var(--text); font-weight: 600; }

/* Links inside prose need to look like links. This is a legal page:
   a reader must be able to tell what is clickable without hovering. */
.lg-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: opacity var(--dur-hover) var(--ease);
}

.lg-body a:hover { opacity: 0.68; }

.lg-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(206, 0, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.38em;
  color: var(--text);
  /* a long cookie name must not push the page sideways on a phone */
  overflow-wrap: anywhere;
}

/* ── Callout (the "short version" summary box) ─────────────── */

.lg-callout {
  margin: 2rem 0 2.5rem;
  padding: 1.5rem 1.6rem 1.25rem;
  background: rgba(206, 0, 184, 0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
}

.lg-callout-t {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.lg-callout ul { margin-bottom: 0; }

.lg-callout li:last-child { margin-bottom: 0; }

/* Warning flavour: the two things on /terms a reader must not miss. */
.lg-callout--warn { background: rgba(206, 0, 184, 0.05); border-color: var(--accent); }

/* ── The FDA / medical paragraph ───────────────────────────── */

.lg-strongblock {
  padding: 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--surface2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  margin-bottom: 1.4rem;
}

/* ── Tables (third parties, cookies) ───────────────────────── */

/* The wrapper scrolls, never the page. A table that widens the body
   breaks horizontal scroll for the whole document on a phone. */
.lg-tablewrap {
  margin: 1.4rem 0 1.8rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.lg-table { width: 100%; border-collapse: collapse; font-family: var(--font-prose); }

.lg-table th,
.lg-table td { padding: 0.85rem 1rem; text-align: left; vertical-align: top; font-size: var(--text-sm); line-height: 1.55; }

.lg-table thead th {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lg-table tbody tr + tr td { border-top: 1px solid var(--border); }

.lg-table td { color: var(--body-color); }

.lg-cell-sub { display: block; margin-top: 0.15rem; font-size: var(--text-xs); color: var(--muted); }

/* ── Small print ───────────────────────────────────────────── */

.lg-note {
  font-size: var(--text-sm) !important;
  color: var(--muted);
  padding-left: 0.9rem;
  border-left: 2px solid var(--border2);
}

.lg-addr { font-size: var(--text-sm) !important; color: var(--muted); line-height: 1.6 !important; }

/* Unfilled company detail. Deliberately loud: an incomplete legal page
   should look broken in review, not ship quietly with a hole in it. */
.lg-todo {
  background: #FFE8A3;
  color: #6B4E00;
  font-family: var(--font-body);
  font-size: 0.92em;
  font-weight: 600;
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

/* ── Sibling page links ────────────────────────────────────── */

.lg-sibs { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }

.lg-sib {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  transition: border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}

.lg-sib:hover { border-color: var(--accent); color: var(--accent); }

/* ── Phone ─────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .lg { padding-top: 6rem; }

  /* One column on a phone: two columns of 13px links is a tap-target minefield. */
  .lg-toc-list { columns: 1; }

  .lg-toc { padding: 1.15rem 1.15rem 1rem; }

  .lg-toc-list li { margin-bottom: 0.7rem; }

  .lg-callout { padding: 1.25rem 1.15rem 1rem; }

  .lg-strongblock { padding: 1rem 1.1rem; }

  /* Give the widest table a sensible floor so columns do not crush into
     one word per line. The wrapper scrolls it instead. */
  .lg-table { min-width: 520px; }
}
