/* =========================================
   KENNISBANK
   Hub + article styling for /pages/kennisbank/.

   Deliberately thin: the article shell reuses the .news-article__*
   component set already in main.css (header banner, lead, dropcap,
   sections, highlight, stats, cta, sidebar, toc, author, share) and
   the hub reuses .news-hub__list + .news-card. Everything below is
   only what those components do not already cover — prose elements
   authored inside scripts/data/guides.mjs (lists, tables, callouts),
   the hub's tag filter, and the related-article grid.

   Mobile-first. Tokens only. No fixed-px layout widths.
   ========================================= */

/* ── Hub ────────────────────────────────────────────────────────── */

.kb-hub {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.kb-hub__intro {
  max-width: 62ch;
  margin: 0 0 var(--space-xl);
}

.kb-hub__intro h1 {
  margin: 0 0 var(--space-sm);
}

.kb-hub__lead {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* Tag filter — client-side only, so the hub stays a single indexable URL.
   Chips are real <button>s: no ?tag= URLs are created and nothing thin
   enters the sitemap. */
.kb-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.kb-filter__chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}

.kb-filter__chip:hover {
  color: var(--heading);
  border-color: color-mix(in srgb, var(--cta) 40%, var(--stroke));
}

.kb-filter__chip[aria-pressed="true"] {
  background: var(--cta);
  border-color: var(--cta);
  color: #ffffff;
}

.kb-filter__count {
  margin-left: 6px;
  opacity: 0.7;
  font-weight: 500;
}

/* The whole card is the link — one strong internal link per article
   instead of a title link plus a competing "lees meer" link. */
.kb-card {
  position: relative;
}

.kb-card__title a {
  color: inherit;
}

.kb-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.kb-card__title a:hover {
  color: var(--cta);
}

.kb-card[hidden] {
  display: none;
}

.kb-hub__empty {
  margin: var(--space-lg) 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Article prose ──────────────────────────────────────────────── */
/* .news-article__section styles <p> only; guides also author lists,
   tables and callouts. */

.news-article__section ul,
.news-article__section ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.35em;
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--text);
}

.news-article__section li {
  margin-bottom: var(--space-xs);
}

.news-article__section li:last-child {
  margin-bottom: 0;
}

.news-article__section li strong {
  font-weight: 700;
  color: var(--heading);
}

.news-article__section a,
.news-article__lead a {
  color: var(--cta);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-article__section a:hover,
.news-article__lead a:hover {
  color: var(--cta-hover);
}

/* Tables authored in guides.mjs. Scrolls inside its own wrapper so the
   page body never scrolls horizontally. */
.guide-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 var(--space-md);
  border-radius: var(--radius-sm);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
}

.guide-table th,
.guide-table td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--stroke);
  vertical-align: top;
  line-height: 1.6;
}

.guide-table th {
  background: var(--soft);
  color: var(--heading);
  font-weight: 700;
  white-space: nowrap;
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-note,
.guide-price-callout {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--soft);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: 0 0 var(--space-md);
  line-height: 1.6;
}

/* ── FAQ inside the article body ────────────────────────────────── */
/* .faq-item / .faq-accordion come from category-page.css; only the
   heading spacing is added here. */

.kb-faq {
  margin-bottom: var(--space-xl);
}

.kb-faq .news-article__section-title {
  margin-bottom: var(--space-md);
}

/* ── Related articles + product links ───────────────────────────── */

.kb-related {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--stroke);
}

.kb-related__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 var(--space-md);
}

.kb-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .kb-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kb-related__item {
  display: block;
  padding: var(--space-md);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}

.kb-related__item:hover {
  border-color: color-mix(in srgb, var(--cta) 45%, var(--stroke));
  transform: translateY(-2px);
}

.kb-related__item-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
}

.kb-related__item-note {
  display: block;
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Sidebar ────────────────────────────────────────────────────── */
/* .news-article__sidebar / __toc / __author / __share are fully styled
   in main.css but were never used by any page. The generator now emits
   them; these rules only add the states main.css lacks. */

.news-article__toc-link[aria-current="true"] {
  color: var(--cta);
  border-left-color: var(--cta);
  font-weight: 700;
}

.news-article__toc-nav {
  max-height: 60vh;
  overflow-y: auto;
}

.kb-sidebar__cta {
  background: var(--soft);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kb-sidebar__cta-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}

.kb-sidebar__cta-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* On narrow screens the sidebar sits under the body; the TOC is the
   only part worth keeping there. */
@media (max-width: 1023px) {
  .news-article__toc {
    grid-column: 1 / -1;
  }
}

/* ── Article footer meta ────────────────────────────────────────── */

.kb-byline {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.85);
  margin: var(--space-sm) 0 0;
}

.kb-updated {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--stroke);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* .news-hub__list jumps straight from 3 columns to 1 at 768px, which leaves
   the tablet range with three very narrow cards. */
@media (min-width: 769px) and (max-width: 1023px) {
  .kb-hub .news-hub__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
