/* ===========================================================================
   legal.css — shared styling for the standalone legal pages
   (terms.html, privacy.html). Builds on base.css tokens; light theme.
   A centred reading column with a sticky table of contents on wide screens.
   =========================================================================== */

.legal-main {
  padding-top: clamp(56px, 9vh, 104px);
  padding-bottom: var(--section-pad);
}

/* -------------------------------- HEADER --------------------------------- */
.legal-head { max-width: var(--maxw-text); margin-inline: auto; text-align: center; }
.legal-title { margin-top: 4px; }

.legal-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-2);
}
.legal-meta span { display: inline-flex; align-items: center; gap: 7px; }
.legal-meta strong { color: var(--text); font-weight: 600; }
.legal-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

/* Short "at a glance" callout under the intro. */
.legal-note {
  max-width: var(--maxw-text);
  margin: clamp(28px, 4vw, 44px) auto 0;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 16px;
  padding: clamp(18px, 2.4vw, 26px) clamp(20px, 2.6vw, 30px);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.legal-note strong { color: var(--text); font-weight: 600; }

/* --------------------------- LAYOUT (TOC + body) ------------------------- */
.legal-layout {
  max-width: var(--maxw-wide);
  margin: clamp(44px, 6vw, 72px) auto 0;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

/* Sticky table of contents */
.legal-toc { position: sticky; top: calc(var(--nav-h) + 22px); }
.legal-toc-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}
.legal-toc ol { counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.legal-toc a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.legal-toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(10, 60, 111, 0.04);
}

/* ------------------------------- BODY COPY ------------------------------- */
.legal-body { max-width: 760px; }
.legal-body > section { scroll-margin-top: calc(var(--nav-h) + 20px); }
.legal-body > section + section { margin-top: clamp(34px, 4.5vw, 52px); }

.legal-body h2 {
  font-family: var(--font-head);
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.22;
  color: var(--text);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.legal-body h2 .legal-num {
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
}
.legal-body h3 {
  font-family: var(--font-head);
  font-size: clamp(16px, 1.7vw, 18px);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 26px 0 10px;
}
.legal-body p,
.legal-body li {
  font-size: 16px;
  line-height: 1.62;
  color: var(--text-2);
}
.legal-body p + p { margin-top: 14px; }

.legal-body ul,
.legal-body ol.legal-list { margin: 14px 0 0; padding-left: 4px; display: flex; flex-direction: column; gap: 10px; }
.legal-body ul li { position: relative; padding-left: 22px; }
.legal-body ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.legal-body ol.legal-list { counter-reset: li; }
.legal-body ol.legal-list > li { position: relative; padding-left: 30px; counter-increment: li; }
.legal-body ol.legal-list > li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.legal-body li strong { color: var(--text); font-weight: 600; }

.legal-body a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(10, 60, 111, 0.35);
  transition: color 0.2s var(--ease);
}
.legal-body a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

/* Definition / key-value rows (used in "Contact us" and definitions) */
.legal-defs { margin-top: 16px; display: grid; gap: 12px; }
.legal-def {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 4px 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.legal-def:last-child { border-bottom: none; padding-bottom: 0; }
.legal-def dt { font-weight: 600; color: var(--text); font-size: 15px; }
.legal-def dd { margin: 0; color: var(--text-2); font-size: 15.5px; }
.legal-def dd a { font-weight: 500; }

.legal-back { margin-top: clamp(40px, 5vw, 64px); text-align: center; }

/* ------------------------------ RESPONSIVE ------------------------------- */
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc {
    position: static;
    background: var(--bg-gray);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 20px 22px;
  }
  .legal-toc ol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 14px; }
  .legal-body { max-width: none; }
}

@media (max-width: 520px) {
  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-def { grid-template-columns: 1fr; gap: 2px; }
}
