/* ============================================================================
   Kunskapsbanken: the archive, the category chips, and one article.
   ========================================================================== */

.cat-chips {
  background: var(--paper-1);
  border-bottom: 1px solid var(--line-1);
  overflow-x: auto;
}
.cat-chips .container {
  display: flex;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
}
/* Real links to /kunskap/kategori/<slug>, never a query-string variant of the
   same list: two URLs serving identical content is a duplicate-content problem
   we would be creating on purpose. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font: var(--body-sm);
  font-weight: 500;
  color: var(--ink-700);
  background: var(--paper-0);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  text-decoration: none;
}
.chip:hover { border-color: var(--navy-400); }
.chip--on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip-n { font-size: 12px; opacity: .7; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--sp-5);
}
.post-card {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-card);
  transition: box-shadow var(--speed) var(--ease);
}
.post-card:hover { box-shadow: var(--shadow-card); }
.post-card-link { display: block; text-decoration: none; height: 100%; }
.post-card-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.post-card-body { display: grid; gap: var(--sp-2); padding: var(--sp-5); }
.post-card-cat {
  font: var(--kicker);
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  color: var(--signal-500);
}
.post-card-title { font: var(--display-sm); color: var(--text-heading); }
.post-card-excerpt { font: var(--body-sm); color: var(--text-muted); }
.post-card-meta { display: flex; gap: var(--sp-3); font: var(--body-sm); color: var(--ink-500); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-5);
  margin-top: var(--sp-8);
}
.pager-link {
  font: var(--label);
  color: var(--navy-700);
  text-decoration: none;
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-4);
}
.pager-link:hover { border-color: var(--navy-400); }
.pager-now { font: var(--body-sm); color: var(--ink-500); }

/* ── One article ───────────────────────────────────────────────── */

.article-head { background: var(--paper-1); border-bottom: 1px solid var(--line-1); padding: var(--sp-8) 0; }
.article-head h1 { max-width: 22ch; }
.article-cat {
  display: inline-block;
  font: var(--kicker);
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  color: var(--signal-500);
  text-decoration: none;
  margin-bottom: var(--sp-3);
}
.article-meta { display: flex; gap: var(--sp-4); font: var(--body-sm); color: var(--ink-500); margin-top: var(--sp-4); }
.article-hero {
  width: 100%;
  /* 16:9 — the ratio the article crop role produces, and the one the empty
     frame needs: a placeholder is a <div>, and a div with only a max-height
     collapses to nothing. */
  aspect-ratio: 16 / 9;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-top: calc(var(--sp-7) * -1 + var(--sp-8));
  margin-bottom: var(--sp-7);
}

/* The article body is the one place on the site where measure matters more
   than the grid: 68ch at 18px is the readable column. */
.article-body {
  font: var(--body-lg);
  color: var(--text-body);
  /* Narrow measure, but starting on the page's own left rail rather than
     centred in the viewport: .article-head above it is left-aligned, and a
     body column that steps 180px to the right of the headline it belongs to
     reads as a template fault. Same fix as .section--narrow in layout.css. */
  max-width: calc(720px + var(--sp-5) * 2);
  margin-inline: max(0px, (100% - var(--container)) / 2) auto;
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-7);
}
.article-body > * + * { margin-top: var(--sp-5); }
.article-body h2 { font: var(--display-md); margin-top: var(--sp-8); }
.article-body h3 { font: var(--display-sm); margin-top: var(--sp-6); }
.article-body ul, .article-body ol { padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
.article-body a { color: var(--link); }
.article-body img { width: 100%; border-radius: var(--radius-md); }
.article-body blockquote {
  border-left: 3px solid var(--signal-500);
  padding-left: var(--sp-5);
  color: var(--text-muted);
}

.article-cta {
  max-width: 720px;
  margin: 0 0 var(--sp-8);
  padding: var(--sp-6);
  background: var(--navy-100);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-md);
}
.article-cta h2 { font: var(--display-md); }
.article-cta p { font: var(--body-md); color: var(--ink-700); margin: var(--sp-3) 0 var(--sp-5); }
