/* ============================================================
   Juridisch - reusable textual / legal page
   (privacy policy, algemene voorwaarden, cookiebeleid...)
   Reading layout: header band + document switcher + sticky TOC.
   Built on the shared tokens + site.css.
   ============================================================ */

.leg-wrap { background: var(--bg); }

/* The CTA band sits directly below the white .leg-body, so its divider
   arrow should read as white (the section above), not the default subtle. */
.cta-band[data-divider-from]::after { background: var(--bg); }

/* ---- Header band ---- */
.leg-head {
  position: relative;
  background: linear-gradient(180deg, #FCFDFF 0%, #EEF3FC 100%);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--sec-pad-y) * 0.45 + 40px) 0 0;
  overflow: hidden;
}
.leg-head-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--neutral-100) 1px, transparent 1px),
    linear-gradient(90deg, var(--neutral-100) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, black 0%, transparent 62%);
  mask-image: radial-gradient(ellipse at 100% 0%, black 0%, transparent 62%);
  opacity: 0.4;
  pointer-events: none;
}
.leg-head-inner { position: relative; z-index: 2; max-width: 820px; }

/* No eyebrow (generic text page) - give the title more room up top */
.leg-head--no-eyebrow { padding-top: calc(var(--sec-pad-y) * 0.7 + 56px); }

.leg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jobit-blue-700);
  margin-bottom: 18px;
}
.leg-eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--jobit-blue);
}

.leg-title {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.032em;
  font-weight: 800;
  color: var(--fg-strong);
  margin: 0 0 18px;
  text-wrap: balance;
}
.leg-dek {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
  max-width: 640px;
  text-wrap: pretty;
}
.leg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 24px;
}
.leg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-subtle);
}
.leg-meta-item svg { color: var(--jobit-blue); flex-shrink: 0; }
.leg-meta-item b { color: var(--fg-muted); font-weight: 700; }

/* ---- Document switcher tabs ---- */
.leg-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 36px;
}
.leg-tab {
  appearance: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 18px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.leg-tab:hover { color: var(--jobit-blue-700); }
.leg-tab.is-active {
  color: var(--jobit-blue-700);
  font-weight: 700;
  border-bottom-color: var(--jobit-blue);
}

/* ---- Body grid: prose + sticky aside ---- */
.leg-body { padding: 56px 0 72px; }
.leg-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ============================================================
   Aside (sticky TOC + help)
   ============================================================ */
.leg-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 22px; }
.leg-toc-title, .leg-side-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 14px;
}
.leg-toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); counter-reset: leg-toc; }
.leg-toc li { margin: 0; }
.leg-toc a {
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.leg-toc li { counter-increment: leg-toc; }
.leg-toc a::before {
  content: counter(leg-toc);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--neutral-400);
  min-width: 16px;
}
.leg-toc a:hover { color: var(--jobit-blue-700); }
.leg-toc a.is-active {
  color: var(--jobit-blue-700);
  font-weight: 700;
  border-left-color: var(--jobit-blue);
}
.leg-toc a.is-active::before { color: var(--jobit-blue); }

.leg-side-help {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
}
.leg-side-help h4 { font-size: 15px; font-weight: 700; color: var(--fg-strong); margin: 0 0 6px; }
.leg-side-help p { font-size: 13.5px; line-height: 1.55; color: var(--fg-muted); margin: 0 0 16px; }
.leg-side-help .btn { width: 100%; justify-content: center; }

/* ============================================================
   Prose
   ============================================================ */
.leg-prose { min-width: 0; max-width: 720px; }
.leg-layout--no-toc { grid-template-columns: minmax(0, 1fr); }
.leg-layout--no-toc .leg-prose, .leg-prose--wide { max-width: 760px; margin: 0 auto; }
.leg-doc { scroll-margin-top: 96px; }
.leg-doc + .leg-doc { margin-top: 8px; }

.leg-lead {
  font-size: 19px;
  line-height: 1.62;
  color: var(--fg-strong);
  font-weight: 500;
  margin: 0 0 8px;
  text-wrap: pretty;
}

.leg-section { scroll-margin-top: 92px; }
.leg-section + .leg-section { margin-top: 44px; }

.leg-h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--fg-strong);
  margin: 0 0 16px;
}
.leg-h2-num {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--jobit-blue);
  letter-spacing: 0;
  transform: translateY(-1px);
}
.leg-h3 {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--fg-strong);
  margin: 28px 0 10px;
}

.leg-prose p {
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--fg);
  margin: 0 0 16px;
  text-wrap: pretty;
}
.leg-prose p:last-child { margin-bottom: 0; }
.leg-prose a { color: var(--fg-link); text-decoration: underline; text-underline-offset: 2px; }
.leg-prose a:hover { color: var(--fg-link-hover); }
.leg-prose strong { color: var(--fg-strong); font-weight: 700; }

.leg-prose ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leg-prose li {
  position: relative;
  padding-left: 28px;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--fg);
}
.leg-prose li strong { color: var(--fg-strong); }
.leg-prose ul > li::before {
  content: "";
  position: absolute;
  left: 5px; top: 10px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--jobit-blue);
}

/* Definition / data rows */
.leg-defs {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.leg-def {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 14px 20px;
  font-size: 15.5px;
  line-height: 1.55;
}
.leg-def + .leg-def { border-top: 1px solid var(--border); }
.leg-def dt { font-weight: 700; color: var(--fg-strong); }
.leg-def dd { margin: 0; color: var(--fg-muted); }

/* Table */
.leg-table-wrap { margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
.leg-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.leg-table th, .leg-table td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.leg-table th {
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.leg-table tr:last-child td { border-bottom: none; }
.leg-table td { color: var(--fg); line-height: 1.5; }
.leg-table td:first-child { font-weight: 600; color: var(--fg-strong); white-space: nowrap; }

/* Callout */
.leg-callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(67,100,173,0.18);
  background: var(--jobit-blue-50);
  margin: 0 0 16px;
}
.leg-callout-ic {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--jobit-blue);
  color: #fff;
  margin-top: 1px;
}
.leg-callout p { font-size: 15px; line-height: 1.6; color: var(--fg); margin: 0; }
.leg-callout p strong { color: var(--jobit-blue-800); }

/* Divider between top-level documents when all shown */
.leg-doc-sep { height: 1px; background: var(--border); border: 0; margin: 52px 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .leg-layout { grid-template-columns: 1fr; gap: 36px; }
  .leg-aside { position: static; flex-direction: row; flex-wrap: wrap; gap: 28px; }
  .leg-toc-block { flex: 1 1 280px; }
  .leg-side-help { flex: 1 1 240px; }
}
@media (max-width: 640px) {
  .leg-body { padding: 40px 0 56px; }
  .leg-def { grid-template-columns: 1fr; gap: 4px; }
  .leg-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 0; }
  .leg-h2 { font-size: 21px; }
}

/* ---- Static (no-JS) stacked layout: per-document title heading ---- */
.leg-doc-title {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--fg-strong);
  margin: 0 0 18px;
}
/* The doc-switcher tabs are anchor links in the static version. */
a.leg-tab { text-decoration: none; }
