/* ===========================================================================
   Legal documents — Privacy Policy, Terms of Service, Cookie Policy.
   Enqueued only on the legal pages (handle: rabbit-legal).
   Scoped via .legal-doc which lives inside the theme's .entry wrapper.
   Brand tokens come from tokens.css (--forest / --lime / --paper / --sage ...).
   =========================================================================== */

/* Let the legal layout breathe wider than the default 760px reading column. */
.entry:has(.legal-doc){max-width:1060px}

/* ---- "Last updated" meta pill (sits above the TOC, brand eyebrow style) ---- */
.legal-meta{
  display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;
  margin-bottom:14px;
}
.legal-updated{
  display:inline-flex;align-items:center;gap:8px;
  color:var(--forest);font-weight:800;font-size:12.5px;
  letter-spacing:.04em;text-transform:uppercase;
  background:var(--sage);border-radius:var(--r-pill);padding:7px 15px;
}
.legal-updated i{
  width:8px;height:8px;border-radius:50%;background:var(--forest);
  display:inline-block;flex:none;
}
.legal-effective{color:var(--gray-500);font-size:13.5px;font-weight:600}

/* ---- Lead intro paragraph ---- */
.legal-lead{
  font-size:19px;line-height:1.6;color:var(--forest);font-weight:500;
  margin:0 0 8px;
}

/* ---- Two-column grid: sticky TOC + body ---- */
.legal-doc{
  display:grid;grid-template-columns:248px 1fr;gap:52px;
  align-items:start;margin-top:30px;
}

/* ---- Table of contents (sage card, sticky under the fixed nav) ---- */
.legal-toc{
  position:sticky;top:104px;
  background:var(--sage);border:1px solid var(--card-border);
  border-radius:var(--r-card);padding:22px 22px 24px;
}
.legal-toc h2{
  margin:0 0 12px;font-size:12.5px;font-weight:800;
  letter-spacing:.08em;text-transform:uppercase;color:var(--forest);
}
.legal-toc ol{list-style:none;margin:0;padding:0;counter-reset:toc}
.legal-toc li{margin:0}
.legal-toc a{
  display:block;padding:6px 0;padding-inline-start:30px;position:relative;
  color:var(--gray-700);font-size:14px;font-weight:600;line-height:1.35;
  border:0;text-decoration:none;transition:color .15s var(--ease);
}
.legal-toc a::before{
  counter-increment:toc;content:counter(toc);
  position:absolute;inset-inline-start:0;top:6px;
  width:20px;height:20px;border-radius:6px;
  background:#fff;color:var(--forest);
  font-size:11px;font-weight:800;
  display:flex;align-items:center;justify-content:center;
}
.legal-toc a:hover{color:var(--forest)}
.legal-toc a:hover::before{background:var(--lime)}

/* ---- Document body ---- */
.legal-body{min-width:0}
.legal-body > section{scroll-margin-top:104px}
.legal-body > section + section{margin-top:40px}
.legal-body h2{
  font-size:clamp(21px,2.6vw,27px);font-weight:800;color:var(--forest);
  margin:0 0 14px;padding-bottom:12px;position:relative;
}
.legal-body h2::after{
  content:"";position:absolute;bottom:0;inset-inline-start:0;
  width:54px;height:4px;border-radius:3px;background:var(--lime);
}
.legal-body h3{
  font-size:17px;font-weight:800;color:var(--forest);
  margin:22px 0 8px;
}
.legal-body p{margin:0 0 12px;line-height:1.72}
.legal-body ul,.legal-body ol{margin:0 0 14px;padding-inline-start:1.3em}
.legal-body li{margin:0 0 8px;line-height:1.65}
.legal-body li::marker{color:var(--forest);font-weight:700}
.legal-body a{color:var(--forest);border-bottom:2px solid var(--lime);word-break:break-word}
.legal-body strong{color:var(--forest);font-weight:700}

/* Definition list-ish callouts (e.g. "Application" means ...) */
.legal-body .def{
  margin:0 0 10px;padding-inline-start:14px;
  border-inline-start:3px solid var(--sage);
}
.legal-body .def strong{color:var(--forest)}

/* ---- Third-party / cookie reference table ---- */
.legal-table{width:100%;border-collapse:collapse;margin:6px 0 16px;font-size:14.5px}
.legal-table th,.legal-table td{
  text-align:start;padding:11px 14px;border-bottom:1px solid var(--card-border);
  vertical-align:top;line-height:1.5;
}
.legal-table thead th{
  background:var(--forest);color:#fff;font-weight:700;font-size:12.5px;
  letter-spacing:.03em;text-transform:uppercase;border-bottom:0;
}
.legal-table tbody tr:nth-child(even){background:rgba(216,230,216,.35)}
.legal-table a{font-weight:600}

/* ---- Contact / questions callout at the end ---- */
.legal-contact{
  margin-top:44px;background:var(--forest);color:#fff;
  border-radius:var(--r-card);padding:30px 32px;position:relative;overflow:hidden;
}
.legal-contact h2{color:#fff;margin:0 0 8px;font-size:22px;font-weight:800}
.legal-contact h2::after{display:none}
.legal-contact p{color:rgba(255,255,255,.85);margin:0 0 6px;line-height:1.6}
.legal-contact a{color:var(--lime);border-bottom:1px solid rgba(224,255,23,.4);font-weight:700}

/* ---------- Responsive ---------- */
@media(max-width:920px){
  .legal-doc{grid-template-columns:1fr;gap:14px;margin-top:22px}
  .legal-toc{position:static;top:auto}
  .legal-lead{font-size:17.5px}
  .legal-contact{padding:24px 22px}
  .legal-table{display:block;overflow-x:auto;white-space:nowrap}
  .legal-table td,.legal-table th{white-space:normal}
}

/* ---------- RTL niceties (Polylang AR pages set dir=rtl) ---------- */
[dir="rtl"] .legal-body,
[dir="rtl"] .legal-toc,
[dir="rtl"] .legal-lead{font-family:var(--font-arabic)}
