/* ==========================================================================
   Legal / policy pages (POPIA) — builds on Templates/templates.css
   ========================================================================== */

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Sticky contents nav
   -------------------------------------------------------------------------- */
.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  padding: 1.4rem 1.5rem;
}

.legal-toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 1rem;
}

.legal-toc ol {
  list-style: none;
  display: grid;
  gap: 0.15rem;
  counter-reset: toc;
}

.legal-toc a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all var(--dur) var(--ease);
}

.legal-toc a:hover,
.legal-toc a.is-current {
  color: var(--text);
  background: var(--brand-soft);
  border-left-color: var(--brand-400);
}

@media (max-width: 900px) {
  .legal-toc { position: static; }
  .legal-toc ol { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); display: grid; }
}

/* --------------------------------------------------------------------------
   Policy body
   -------------------------------------------------------------------------- */
.legal-body h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.55rem);
  margin-top: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
  /* Anchor jumps must clear the fixed header. */
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.legal-body > h2:first-child { margin-top: 0; }

.legal-body h3 {
  font-size: 1.02rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-body p,
.legal-body li { color: var(--text-muted); }

.legal-body a { text-decoration: underline; text-underline-offset: 3px; }

.legal-body ul {
  list-style: none;
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
}

.legal-body ul li {
  position: relative;
  padding-left: 1.6rem;
}

.legal-body ul li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
}

.legal-body strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Data table — what we collect and why
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
}

.legal-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.legal-table th,
.legal-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal-table th {
  font-family: var(--font-primary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-300);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.legal-table td { color: var(--text-muted); }

.legal-table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */
.callout {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 1px solid rgba(75, 194, 58, 0.25);
}

.callout .material-icons {
  color: var(--brand-300);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.callout p { margin: 0; font-size: 0.9rem; }

.callout p + p { margin-top: 0.6rem; }

/* Contact block for the Information Officer / Regulator */
.detail-card {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 1.25rem;
}

.detail-card h3 { margin-top: 0; }

.detail-card dl {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.detail-card dl > div {
  display: grid;
  grid-template-columns: minmax(90px, 26%) 1fr;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.detail-card dt { color: var(--text-dim); }
.detail-card dd { margin: 0; color: var(--text-muted); }

@media (max-width: 520px) {
  .detail-card dl > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Last-updated stamp */
.legal-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.legal-stamp .material-icons { font-size: 1rem; color: var(--brand-400); }
