/* ============================================================
 * RPD KNOWLEDGE BASE — Theme-isolated stylesheet
 * Alles onder .kb wrapper. Reset neutraliseert child theme.
 * Font erft van het parent theme (Rubik) via inherit.
 * ============================================================ */

/* ---------- SCOPED RESET — neutraliseer theme styles ---------- */
.kb,
.kb *,
.kb *::before,
.kb *::after {
  box-sizing: border-box;
}

.kb {
  /* design tokens */
  --kb-charcoal: #1a1a1a;
  --kb-charcoal-soft: #4a4a4a;
  --kb-charcoal-mute: #6b7280;
  --kb-primary: #0a3a8c;
  --kb-primary-dark: #062a66;
  --kb-primary-soft: #eaf0fb;
  --kb-cream: #f5f1ea;
  --kb-cream-deep: #ede7da;
  --kb-off-white: #fafaf7;
  --kb-orange: #d97706;
  --kb-orange-soft: #fef3e2;
  --kb-red: #dc2626;
  --kb-red-soft: #fef2f2;
  --kb-border: #e5e0d7;
  --kb-border-soft: #f0ede5;
  --kb-shadow-sm: 0 1px 2px rgba(10, 58, 140, 0.04), 0 1px 3px rgba(10, 58, 140, 0.06);
  --kb-shadow-md: 0 4px 12px rgba(10, 58, 140, 0.08);
  --kb-shadow-lg: 0 12px 32px rgba(10, 58, 140, 0.14);

  --kb-radius-sm: 8px;
  --kb-radius-md: 12px;
  --kb-radius-lg: 18px;
  --kb-radius-xl: 24px;
  --kb-radius-pill: 999px;

  --kb-accent: var(--kb-primary);

  /* ====== KRITIEK: font erft van theme (Rubik) ====== */
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: var(--kb-charcoal);
  background: transparent;
  text-align: left;
  width: 100%;
  max-width: 100%;
}

/* Reset bare elements binnen .kb zodat theme ze niet stylet */
.kb h1, .kb h2, .kb h3, .kb h4, .kb h5, .kb h6 {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-weight: 700;
  color: var(--kb-charcoal);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.kb p {
  margin: 0 0 1em 0;
  padding: 0;
  font-family: inherit;
  color: var(--kb-charcoal-soft);
}

.kb p:last-child {
  margin-bottom: 0;
}

/* ====== KRITIEK: list-style force op none ====== */
.kb ul,
.kb ol {
  margin: 0;
  padding: 0;
  list-style: none !important;
  list-style-type: none !important;
}

.kb li {
  margin: 0;
  padding: 0;
  list-style: none !important;
}

.kb li::marker {
  content: none;
  display: none;
}

.kb button {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  line-height: inherit;
}

.kb a {
  color: var(--kb-primary);
  text-decoration: none;
  background: transparent;
  border: none;
  transition: color 0.2s ease;
}

.kb a:hover {
  color: var(--kb-primary-dark);
}

.kb input,
.kb textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

.kb input:focus,
.kb textarea:focus,
.kb button:focus-visible {
  outline: 2px solid var(--kb-accent);
  outline-offset: 2px;
}

.kb button:focus {
  outline: none;
}

.kb svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.kb img {
  display: block;
  max-width: 100%;
  height: auto;
}

.kb strong, .kb b {
  font-weight: 700;
  color: var(--kb-charcoal);
}

/* ============================================================
 * HUB CONTAINER
 * ============================================================ */
.kb--hub {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 16px 96px;
}

/* ============================================================
 * HERO
 * ============================================================ */
.kb__hero {
  text-align: center;
  padding: 40px 0 32px;
}

.kb__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--kb-orange);
  margin-bottom: 16px;
}

.kb__hero-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--kb-primary);
  letter-spacing: -0.02em;
}

.kb .kb__hero-sub,
.kb__hero .kb__hero-sub,
.kb p.kb__hero-sub {
  font-size: 17px;
  line-height: 1.5;
  color: var(--kb-charcoal-soft);
  max-width: 560px;
  margin: 0 auto 32px;
  text-align: center;
}

/* Vangnet: alle p binnen hero gecentreerd, voor het geval theme p { text-align: left } heeft */
.kb .kb__hero p {
  text-align: center;
}

/* ---------- SEARCH ---------- */
.kb__search {
  position: relative;
  max-width: 580px;
  margin: 0 auto 28px;
  background: #fff;
  border: 1.5px solid var(--kb-border);
  border-radius: var(--kb-radius-pill);
  display: flex;
  align-items: center;
  padding: 4px 8px 4px 20px;
  box-shadow: var(--kb-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kb__search svg {
  width: 20px;
  height: 20px;
  color: var(--kb-charcoal-mute);
  flex-shrink: 0;
}

.kb__search input {
  flex: 1;
  padding: 14px 12px;
  font-size: 15px;
  background: transparent;
  outline: none;
  min-width: 0;
}

.kb__search:focus-within {
  border-color: var(--kb-primary);
  box-shadow: 0 0 0 4px rgba(10, 58, 140, 0.08), var(--kb-shadow-sm);
}

/* ============================================================
 * FILTER CHIPS — hard gedefinieerd, theme-resistant
 * ============================================================ */
.kb__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0;
  padding: 12px 0;
}

.kb .kb__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--kb-radius-pill);
  background-color: #fff;
  background-image: none;
  border: 1.5px solid var(--kb-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--kb-charcoal);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.kb .kb__chip:hover {
  border-color: var(--kb-chip-color, var(--kb-primary));
  color: var(--kb-chip-color, var(--kb-primary));
  transform: translateY(-1px);
  box-shadow: var(--kb-shadow-sm);
}

.kb .kb__chip--active {
  background-color: var(--kb-charcoal);
  border-color: var(--kb-charcoal);
  color: #fff;
}

.kb .kb__chip--active:hover {
  background-color: var(--kb-charcoal);
  border-color: var(--kb-charcoal);
  color: #fff;
  transform: translateY(-1px);
}

.kb .kb__chip--emergency {
  border-color: var(--kb-red);
  color: var(--kb-red);
}

.kb .kb__chip--emergency.kb__chip--active {
  background-color: var(--kb-red);
  border-color: var(--kb-red);
  color: #fff;
}

.kb__chip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: kb-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes kb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ============================================================
 * SECTIONS
 * ============================================================ */
.kb__sections {
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 48px;
}

.kb__section {
  position: relative;
}

.kb__section--emergency {
  background: var(--kb-red-soft);
  border-radius: var(--kb-radius-xl);
  padding: 36px 20px;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.kb__section-head {
  margin-bottom: 28px;
}

.kb__urgent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--kb-red);
  color: #fff;
  border-radius: var(--kb-radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.kb__urgent-badge svg {
  width: 13px;
  height: 13px;
}

.kb__section-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--kb-primary);
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}

.kb__section--emergency .kb__section-title {
  color: var(--kb-red);
}

.kb__section-desc {
  font-size: 15px;
  color: var(--kb-charcoal-soft);
  max-width: 640px;
  margin: 0;
  line-height: 1.55;
}

/* ============================================================
 * COMPACT EMBED (voor service-pagina's)
 * ============================================================ */
.kb--compact {
  max-width: 100%;
  padding: 40px 0;
}

.kb--compact .kb__section-head {
  margin-bottom: 24px;
}

.kb--compact .kb__section-title {
  font-size: 26px;
}

/* ============================================================
 * CARDS — accordion
 * ============================================================ */
.kb__cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb__card {
  background: #fff;
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin: 0;
}

.kb__card:hover {
  border-color: var(--kb-accent);
  box-shadow: var(--kb-shadow-sm);
}

.kb__card.is-open {
  border-color: var(--kb-accent);
  box-shadow: var(--kb-shadow-md);
}

/* ---------- CARD HEAD ---------- */
.kb .kb__card-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 18px 18px;
  align-items: center;
  background: transparent;
  transition: background 0.18s ease;
  cursor: pointer;
}

.kb .kb__card-head:hover {
  background: var(--kb-off-white);
}

.kb__icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--kb-primary-soft);
  color: var(--kb-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb__icon-circle svg {
  width: 20px;
  height: 20px;
}

.kb__section--emergency .kb__icon-circle {
  background: #fee2e2;
}

.kb__card-title-wrap {
  min-width: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb__card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--kb-charcoal);
  margin: 0;
}

/* ====== META: pill + read time naast elkaar ====== */
.kb__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.kb__pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--kb-radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

.kb__pill--high {
  background: var(--kb-red-soft);
  color: var(--kb-red);
}

.kb__pill--medium {
  background: var(--kb-orange-soft);
  color: var(--kb-orange);
}

.kb__pill--low {
  background: var(--kb-primary-soft);
  color: var(--kb-primary);
}

.kb__read-time {
  font-size: 12.5px;
  color: var(--kb-charcoal-mute);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.kb__read-time::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--kb-charcoal-mute);
  margin-right: 10px;
  opacity: 0.5;
}

/* ---------- TOGGLE ---------- */
.kb__toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--kb-off-white);
  color: var(--kb-charcoal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.kb__toggle svg {
  width: 14px;
  height: 14px;
}

.kb__card.is-open .kb__toggle {
  transform: rotate(45deg);
  background: var(--kb-accent);
  color: #fff;
}

/* ---------- CARD BODY ---------- */
.kb__card-body {
  padding: 0 18px 22px;
  border-top: 1px solid var(--kb-border-soft);
  margin-top: 0;
  animation: kb-slide-down 0.25s ease;
}

.kb__card-body[hidden] {
  display: none;
}

@keyframes kb-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.kb__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 22px;
}

/* ---------- ANSWER ---------- */
.kb__answer {
  min-width: 0;
}

.kb__intro {
  font-size: 15.5px;
  color: var(--kb-charcoal);
  line-height: 1.65;
  margin-bottom: 18px;
}

.kb__intro p {
  color: var(--kb-charcoal);
  margin-bottom: 0.8em;
}

.kb__intro p:last-child {
  margin-bottom: 0;
}

/* ====== STEPS — fix voor overlap ====== */
.kb .kb__steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
  padding: 0;
  list-style: none !important;
  counter-reset: kb-step;
}

.kb .kb__step {
  position: relative;
  padding: 4px 0 4px 44px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--kb-charcoal-soft);
  list-style: none !important;
  counter-increment: kb-step;
  margin: 0;
  min-height: 30px;
}

.kb .kb__step::marker {
  content: none;
  display: none;
}

.kb .kb__step::before {
  content: counter(kb-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--kb-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- CALLOUT ---------- */
.kb__callout {
  background: var(--kb-orange-soft);
  border-left: 4px solid var(--kb-orange);
  border-radius: var(--kb-radius-sm);
  padding: 16px 18px;
  margin-top: 20px;
  font-size: 14.5px;
  line-height: 1.6;
}

.kb__callout-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--kb-orange);
  margin-bottom: 6px;
}

.kb__callout p {
  color: var(--kb-charcoal);
  margin-bottom: 0;
}

/* ---------- ASIDE ---------- */
.kb__aside {
  position: relative;
  background: var(--kb-cream);
  border-radius: var(--kb-radius-md);
  padding: 22px 20px;
  overflow: hidden;
  align-self: start;
}

.kb__aside-deco {
  position: absolute;
  top: -28px;
  right: -28px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.12);
  pointer-events: none;
}

/* Aside-tag is nu een nette eyebrow ipv Caveat */
.kb__aside-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--kb-orange);
  margin-bottom: 14px;
  position: relative;
}

.kb__tease {
  font-size: 14.5px;
  color: var(--kb-charcoal);
  line-height: 1.6;
  margin-bottom: 18px;
}

.kb__tease p {
  color: var(--kb-charcoal);
  margin-bottom: 0.6em;
}

.kb__tease p:last-child {
  margin-bottom: 0;
}

.kb .kb__aside-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0;
  list-style: none !important;
}

.kb .kb__aside-item {
  background: #fff;
  border-radius: var(--kb-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none !important;
  margin: 0;
  line-height: 1.4;
}

.kb__aside-label {
  font-weight: 700;
  color: var(--kb-charcoal-mute);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.kb__aside-value {
  color: var(--kb-charcoal);
  font-weight: 500;
}

.kb__aside-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--kb-charcoal);
  color: #fff;
  border-radius: var(--kb-radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.kb__aside-cta:hover {
  background: var(--kb-orange);
  color: #fff;
  transform: translateX(2px);
}

.kb__aside-cta svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
 * FOOTER CTA (compact embeds)
 * ============================================================ */
.kb__footer-cta {
  margin-top: 28px;
  padding: 24px;
  background: var(--kb-off-white);
  border-radius: var(--kb-radius-md);
  text-align: center;
  border: 1px solid var(--kb-border-soft);
}

.kb__footer-text {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--kb-charcoal);
}

.kb .kb__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  background-color: var(--kb-primary);
  color: #fff;
  border-radius: var(--kb-radius-pill);
  border: none;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.kb .kb__btn:hover {
  background-color: var(--kb-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.kb .kb__btn svg {
  width: 18px;
  height: 18px;
}

.kb .kb__btn--ghost {
  background-color: transparent;
  color: var(--kb-primary);
  border: 2px solid var(--kb-primary);
}

.kb .kb__btn--ghost:hover {
  background-color: var(--kb-primary);
  color: #fff;
}

/* ============================================================
 * BIG CTA (bodem hub)
 * ============================================================ */
.kb__big-cta {
  margin-top: 72px;
  padding: 48px 28px;
  background: var(--kb-primary-dark);
  color: #fff;
  border-radius: var(--kb-radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.kb__big-cta::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--kb-orange);
  opacity: 0.14;
  pointer-events: none;
}

.kb__big-cta::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -120px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.05;
  pointer-events: none;
}

/* Titel forceren wit — meervoudige selectors voor specificiteit */
.kb .kb__big-cta .kb__big-cta-title,
.kb .kb__big-cta h2.kb__big-cta-title,
.kb__big-cta h2.kb__big-cta-title {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
  position: relative;
  letter-spacing: -0.02em;
  font-family: inherit;
  text-align: center;
}

.kb .kb__big-cta .kb__big-cta-text,
.kb__big-cta .kb__big-cta-text {
  color: rgba(255, 255, 255, 0.88);
  margin: 0 auto 28px;
  font-size: 16px;
  max-width: 500px;
  position: relative;
  line-height: 1.55;
  text-align: center;
}

.kb__big-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  position: relative;
}

.kb__big-cta .kb__btn {
  background-color: var(--kb-orange);
}

.kb__big-cta .kb__btn:hover {
  background-color: #b15f04;
}

.kb__big-cta .kb__btn--ghost {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.kb__big-cta .kb__btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* ============================================================
 * FILTERING
 * ============================================================ */
.kb__section[hidden],
.kb__card[hidden] {
  display: none;
}

/* ============================================================
 * RESPONSIVE — Mobile first, dan tablet, dan desktop
 * ============================================================ */
@media (min-width: 640px) {
  .kb__hero {
    padding: 56px 0 40px;
  }

  .kb__hero-title {
    font-size: 48px;
  }

  .kb .kb__hero-sub,
  .kb__hero .kb__hero-sub {
    font-size: 18px;
  }

  .kb__section-title {
    font-size: 32px;
  }

  .kb .kb__card-head {
    padding: 22px 24px;
    gap: 18px;
  }

  .kb__icon-circle {
    width: 48px;
    height: 48px;
  }

  .kb__icon-circle svg {
    width: 22px;
    height: 22px;
  }

  .kb__card-title {
    font-size: 17px;
  }

  .kb__card-body {
    padding: 0 24px 26px;
  }

  .kb__grid {
    padding-top: 26px;
  }

  .kb__big-cta {
    padding: 56px 36px;
  }

  .kb__big-cta-title {
    font-size: 36px;
  }
}

@media (min-width: 768px) {
  .kb__grid {
    grid-template-columns: 1fr 300px;
    gap: 32px;
  }

  .kb__aside {
    padding: 24px 22px;
  }

  .kb--hub {
    padding: 40px 24px 100px;
  }

  .kb__section--emergency {
    padding: 44px 36px;
  }

  .kb__sections {
    gap: 80px;
  }
}

@media (min-width: 1024px) {
  .kb__hero-title {
    font-size: 56px;
  }

  .kb__grid {
    grid-template-columns: 1fr 320px;
    gap: 36px;
  }
}

/* ============================================================
 * THEME OVERRIDE VANGNET
 * Sommige themes hebben heel hoge specificiteit op headings
 * (bv body.page h2 of iets vergelijkbaars). Deze rule is een
 * laatste-resort voor de witte tekst op de dark big-CTA, omdat
 * een blauwe titel op zwart onleesbaar is.
 * ============================================================ */
.kb .kb__big-cta .kb__big-cta-title {
  color: #fff !important;
}

/* ============================================================
 * PRINT
 * ============================================================ */
@media print {
  .kb__chips,
  .kb__search,
  .kb__big-cta,
  .kb__footer-cta {
    display: none;
  }

  .kb__card {
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }

  .kb__card-body[hidden] {
    display: block;
  }
}
