/* ────────────────────────────────────────────────────────────────────────────
   legal-editorial.css
   Long-form legal pages (privacy, terms). Scoped to body.page-privacy and
   body.page-terms. Reuses mp-* tokens from marketing-pages.css so dark mode
   is automatic, but uses lg-* classes for the legal-specific structure
   (sticky TOC, numbered sections, dense body type).
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Hero meta strip (last-updated / controller) ───────────────────────── */
.lg-meta-strip {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--mp-line);
  padding-top: 1rem;
}
.lg-meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
}
.lg-meta-label {
  font-family: var(--mp-display);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mp-text-mute);
  min-width: 8.5rem;
}
.lg-meta-value {
  font-family: var(--mp-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--mp-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 140ms ease, color 140ms ease;
}
a.lg-meta-value:hover {
  color: var(--mp-accent);
  border-bottom-color: var(--mp-accent);
}

/* ── Grid: TOC + body ──────────────────────────────────────────────────── */
.lg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
}
@media (min-width: 980px) {
  .lg-grid { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
}

/* ── TOC ───────────────────────────────────────────────────────────────── */
.lg-toc {
  position: relative;
}
@media (min-width: 980px) {
  .lg-toc {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 0.5rem;
  }
}
.lg-toc-eyebrow {
  font-family: var(--mp-display);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mp-text-mute);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--mp-text);
}
.lg-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: lg-toc;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.lg-toc-list li {
  counter-increment: lg-toc;
  position: relative;
  padding-left: 2.3rem;
}
.lg-toc-list li::before {
  content: counter(lg-toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.2rem;
  font-family: var(--mp-display);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--mp-text-mute);
}
.lg-toc-list a {
  font-family: var(--mp-body);
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--mp-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.lg-toc-list a:hover {
  color: var(--mp-accent);
  border-bottom-color: var(--mp-accent);
}

/* ── Body article ──────────────────────────────────────────────────────── */
.lg-article {
  max-width: 72ch;
  font-family: var(--mp-body);
  color: var(--mp-text);
  font-size: 1.02rem;
  line-height: 1.7;
}
.lg-section {
  padding-top: clamp(2.25rem, 3.5vw, 3rem);
  padding-bottom: clamp(2rem, 3vw, 2.75rem);
  border-bottom: 1px solid var(--mp-line);
}
.lg-section:last-child { border-bottom: none; }
.lg-section:first-child { padding-top: 0; }
.lg-section-num {
  font-family: var(--mp-display);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mp-accent);
  margin: 0 0 0.4rem;
}
.lg-section-title {
  font-family: var(--mp-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--mp-text);
  margin: 0 0 1.2rem;
  max-width: 22ch;
}
.lg-article p {
  margin: 0 0 1.1rem;
  color: var(--mp-text);
}
.lg-article p:last-child { margin-bottom: 0; }
.lg-article a {
  color: var(--mp-text);
  text-decoration: none;
  border-bottom: 1px solid var(--mp-accent);
  padding-bottom: 1px;
  transition: color 140ms ease;
}
.lg-article a:hover { color: var(--mp-accent); }
.lg-article strong { color: var(--mp-text); font-weight: 700; }

.lg-list,
.lg-sublist {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.lg-sublist {
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
  padding-left: 1.5rem;
}
.lg-list li,
.lg-sublist li {
  position: relative;
  list-style: none;
  padding-left: 1rem;
  color: var(--mp-text);
}
.lg-list li::before,
.lg-sublist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.55rem;
  height: 1px;
  background: var(--mp-accent);
}
.lg-sublist li::before { background: var(--mp-text-mute); }

/* ── Terms-page tabs (Client + Employee) ───────────────────────────────── */
.lg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: clamp(2rem, 4vw, 3rem) 0 clamp(2rem, 4vw, 3rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--mp-line);
}
.lg-tab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--mp-text);
  color: var(--mp-text);
  font-family: var(--mp-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 1.25rem;
  border-radius: 0;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.lg-tab:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--mp-accent);
}
/* terms.js toggles `.active` on the button + panel — key our CSS off the
   same class so the legacy script keeps working without modification. */
.lg-tab.is-active,
.lg-tab.active {
  background: var(--mp-text);
  color: var(--mp-bg);
  border-color: var(--mp-text);
}
.lg-tab-panel { display: none; }
.lg-tab-panel.is-active,
.lg-tab-panel.active { display: block; }

/* ── Mobile: TOC collapses to a top bar ────────────────────────────────── */
@media (max-width: 979px) {
  .lg-toc {
    border: 1px solid var(--mp-line);
    padding: 1.25rem 1.25rem 1rem;
    background: var(--mp-bg-soft);
  }
  .lg-toc-list {
    max-height: 12rem;
    overflow-y: auto;
  }
}

/* ── Dark mode parity ──────────────────────────────────────────────────── */
:root[data-theme="dark"] .lg-tab.is-active {
  color: #0b1220;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lg-tab.is-active {
    color: #0b1220;
  }
}
