/* Legal pages (privacy, terms - EN + ES) on the new design system
   (layouts/privacy/page.html + layouts/terms/page.html). Loaded with home.css (reset + tokens via
   chrome.css); no Bootstrap on these pages. One ~70ch reading column, a
   compact tinted header band, and a sticky H2-only TOC on desktop. */

/* ---------- Header band ---------- */

.legal-head {
  background: var(--hc-surface-alt);
  border-bottom: 0.5px solid var(--hc-border);
  padding-block: 40px 36px;
}
@media (min-width: 768px) {
  .legal-head { padding-block: 56px 48px; }
}
.legal-head-inner { max-width: 72ch; }
.legal-h1 {
  font-size: clamp(30px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--hc-text-strong);
}
.legal-effective {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hc-text-muted);
}
.legal-effective strong { color: var(--hc-text-muted); font-weight: 600; }

/* ---------- Body grid: TOC sidebar + prose column ---------- */

.legal-body { padding-block: 40px 80px; }
@media (min-width: 768px) {
  .legal-body { padding-block: 56px 104px; }
}
.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (min-width: 1024px) {
  .legal-grid { grid-template-columns: 230px minmax(0, 1fr); gap: 64px; }
}

/* TOC: sticky sidebar on desktop, hidden on phones (the H2s stay in the
   prose column, so nothing is lost below the breakpoint). */
.legal-toc-col { display: none; }
@media (min-width: 1024px) {
  .legal-toc-col { display: block; position: sticky; top: 88px; }
}
.legal-toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hc-text-muted);
  margin-bottom: 12px;
}
.legal-toc #TableOfContents ul { list-style: none; }
.legal-toc ul li { margin: 0; }
.legal-toc ul li a {
  display: block;
  padding: 6px 0 6px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--hc-text-muted);
  border-left: 2px solid var(--hc-border);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.legal-toc ul li a:hover {
  color: var(--hc-teal);
  border-left-color: var(--hc-teal);
}

/* ---------- Prose column ---------- */

.legal-prose {
  max-width: 70ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--hc-text-body);
  min-width: 0; /* never let a long token widen the grid track */
}
.legal-prose > * { overflow-wrap: anywhere; }
.legal-prose p { margin: 0 0 1.1em; }
.legal-prose h2 {
  margin: 2.4em 0 0.9em;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--hc-text-strong);
  scroll-margin-top: 84px; /* clear the sticky navbar when jumping from the TOC */
}
.legal-prose h2:first-child { margin-top: 0; }
.legal-prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--hc-text-strong);
  scroll-margin-top: 84px;
}
.legal-prose ul, .legal-prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}
.legal-prose ul { list-style: disc; }
.legal-prose ol { list-style: decimal; }
.legal-prose li { margin: 0.4em 0; }
.legal-prose li::marker { color: var(--hc-teal); }
.legal-prose a {
  color: var(--hc-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-prose a:hover { color: var(--hc-teal-hover); }
.legal-prose strong { color: var(--hc-text-strong); font-weight: 600; }
.legal-prose hr {
  border: 0;
  border-top: 0.5px solid var(--hc-border);
  margin: 2.2em 0;
}

/* Tables: full width inside the column, scroll sideways on phones. */
.legal-prose .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.2em;
}
.legal-prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
}
.legal-prose th, .legal-prose td {
  border: 1px solid var(--hc-border);
  padding: 9px 12px;
  text-align: left;
}
.legal-prose th { background: var(--hc-surface-alt); color: var(--hc-text-strong); font-weight: 600; }
