/* Tietopankin artikkelisivut (/tietopankki/<slug>). Rakenne: src/tietopankki.mjs. Kaikki säännöt on rajattu
   .kp-hero- ja .kp-article-kääreisiin; sama visuaalinen kieli kuin uudistetuilla vuokralaissivuilla (.klik-uusi).
   Värit: public/klik-tokens.css. Artikkelin teema on sen kohderyhmän mukainen (vuokralaiset A: sininen hero,
   vuokranantajat B: vaalea hero); --kp-*-muuttujat ovat tokenien aliaksia. */
:is(.kp-hero, .kp-article) {
  --kp-navy: var(--klik-ink);
  --kp-blue: var(--klik-primary);
  --kp-text: var(--klik-text);
  --kp-muted: var(--klik-muted);
  --kp-bg: var(--klik-tint-1);
  --kp-bg2: var(--klik-surface-alt);
  --kp-yellow: var(--klik-accent);
  --kp-line: var(--klik-line);
  font-family: Lato, sans-serif;
}
:is(.kp-hero, .kp-article) *, :is(.kp-hero, .kp-article) *::before, :is(.kp-hero, .kp-article) *::after { box-sizing: border-box; }
:is(.kp-hero, .kp-article) .kp-ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
:is(.kp-hero, .kp-article) a:focus-visible { outline: 3px solid var(--kp-blue); outline-offset: 3px; border-radius: 4px; }
.kp-hero .kp-wrap, .kp-article .kp-wrap { width: 100%; max-width: 784px; margin: 0 auto; padding: 0 24px; }

/* Otsikkoalue */
.kp-hero {
  position: relative; overflow: hidden;
  padding: 32px 0 var(--klik-hero-y);
  color: var(--klik-on-hero-text);
  background: var(--klik-article-hero-bg);
  border-bottom: 1px solid var(--klik-hero-line);
}
/* Alareunan merkki: A:ssa koko levyinen keltainen raita, B:ssä lyhyt sininen viiva otsikon kohdalla. */
.kp-hero::after {
  content: ""; position: absolute; left: var(--klik-hero-mark-left); bottom: 0; width: var(--klik-hero-mark-width); height: var(--klik-hero-mark-height);
  background: var(--klik-hero-mark);
}
.kp-hero .kp-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0 0 var(--klik-stack); padding: 0; list-style: none; font-size: 14px; line-height: 1.4; }
.kp-hero .kp-crumbs li { display: inline-flex; align-items: center; min-width: 0; color: var(--klik-on-hero-muted); }
.kp-hero .kp-crumbs li + li::before { content: "›"; margin: 0 10px; color: var(--klik-on-hero-muted); opacity: .7; font-size: 16px; }
.kp-hero .kp-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--klik-on-hero); text-decoration: none; font-weight: 700; }
.kp-hero .kp-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kp-hero .kp-crumbs .kp-ico { width: 16px; height: 16px; }
.kp-hero .kp-crumbs [aria-current] span { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; vertical-align: bottom; }
.kp-hero .kp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 14px 6px 10px;
  border-radius: 999px; background: var(--klik-hero-chip-bg); border: 1px solid var(--klik-hero-chip-line); color: var(--klik-hero-chip-text);
  font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: .02em;
}
.kp-hero .kp-eyebrow .kp-ico { width: 18px; height: 18px; color: var(--klik-hero-accent); }
.kp-hero .kp-title {
  margin: 0 0 18px; padding: 0; color: var(--klik-on-hero); text-align: left;
  font-family: Leaguespartan, "League Spartan", Lato, sans-serif; font-weight: 700;
  font-size: clamp(32px, 5.2vw, 48px); line-height: 1.12; letter-spacing: -.005em;
  overflow-wrap: break-word; hyphens: auto;
}
.kp-hero .kp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0; font-size: 15px; line-height: 1.4; color: var(--klik-on-hero-muted); }
.kp-hero .kp-meta > * { display: inline-flex; align-items: center; gap: 7px; }
.kp-hero .kp-meta .kp-ico { width: 18px; height: 18px; color: var(--klik-hero-accent); }
.kp-hero .kp-meta a { color: var(--klik-on-hero); font-weight: 700; text-decoration: underline; text-decoration-color: var(--klik-hero-accent); text-underline-offset: 4px; }
.kp-hero .kp-meta a:hover { text-decoration-thickness: 2px; }
.kp-hero a:focus-visible { outline-color: var(--klik-hero-focus); }

/* Artikkeli */
.kp-article { padding: var(--klik-stack-lg) 0 var(--klik-section-y); background: #fff; color: var(--kp-text); }
.kp-article .kp-audience {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; margin: 0 0 var(--klik-stack); padding: 10px 16px 10px 14px;
  border-radius: 10px; background: var(--kp-bg); border: 1px solid var(--kp-line);
  color: var(--kp-navy); font-size: 15px; font-weight: 700; line-height: 1.4;
}
.kp-article .kp-audience .kp-ico { color: var(--kp-blue); }
.kp-article .kp-body { max-width: var(--klik-measure); }
.kp-article .kp-text { color: var(--kp-text); font-size: 18px; line-height: 1.7; overflow-wrap: break-word; }
.kp-article .kp-text p { margin: 0 0 1.2em; font-size: inherit; line-height: inherit; }
.kp-article .kp-text strong { color: var(--kp-navy); font-weight: 800; }
.kp-article .kp-text a { color: var(--kp-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.kp-article .kp-text a:hover { color: var(--klik-primary-hover); }
.kp-article .kp-text a strong { color: inherit; }
.kp-article .kp-text .kp-label {
  margin: 1.8em 0 .55em; color: var(--kp-navy);
  font-size: 19px; font-weight: 800; line-height: 1.35;
}
.kp-article .kp-text .kp-label + p { margin-top: 0; }
.kp-article .kp-text > .kp-label:first-child { margin-top: 0; }
/* Uudelleenkirjoitettujen artikkelien (content/pages/tietopankki) oikeat väliotsikot ja listat. */
.kp-article .kp-text :is(h2, h3) {
  margin: 2em 0 .6em; padding: 0; color: var(--kp-navy); text-align: left; text-transform: none; letter-spacing: normal;
  font-family: Lato, sans-serif; font-size: 22px; font-weight: 800; line-height: 1.3;
}
.kp-article .kp-text h3 { margin-top: 1.7em; font-size: 19px; line-height: 1.35; }
.kp-article .kp-text > :is(h2, h3):first-child { margin-top: 0; }
.kp-article .kp-text :is(h2, h3) + :is(p, ul, ol) { margin-top: 0; }
.kp-article .kp-text ol { margin: 0 0 1.4em; padding: 0; list-style: none; counter-reset: kp-step; display: grid; gap: 16px; }
.kp-article .kp-text ol > li { position: relative; margin: 0; padding-left: 46px; min-height: 32px; counter-increment: kp-step; font-size: inherit; line-height: inherit; }
.kp-article .kp-text ol > li::before {
  content: counter(kp-step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--klik-ol-bg); color: var(--klik-ol-text); box-shadow: inset 0 0 0 1px var(--klik-ol-ring);
  font-size: 16px; font-weight: 800; line-height: 1;
}
.kp-article :is(.kp-list, .kp-text ul) { margin: 0 0 1.3em; padding: 0; list-style: none; display: grid; gap: 6px; }
.kp-article .kp-text ul:not(.kp-list) { gap: 10px; }
.kp-article :is(.kp-list, .kp-text ul) li { position: relative; margin: 0; padding-left: 28px; font-size: inherit; line-height: 1.55; }
.kp-article :is(.kp-list, .kp-text ul) li::before {
  content: ""; position: absolute; left: 4px; top: .5em; width: 9px; height: 9px;
  border-radius: 50%; border: 2px solid var(--kp-blue); background: var(--kp-bg);
}
.kp-article .kp-note {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 1.3em; padding: var(--klik-card-pad-sm) var(--klik-card-pad);
  border-radius: 12px; background: var(--klik-callout-bg); border-left: var(--klik-callout-rule);
}
.kp-article .kp-note > .kp-ico { margin-top: 4px; color: var(--klik-callout-ico); }
.kp-article .kp-note > div { min-width: 0; }
.kp-article .kp-note p:last-child, .kp-article .kp-note ul:last-child { margin-bottom: 0; }

/* Yhteydenotto */
.kp-article .kp-cta {
  display: flex; gap: 20px; align-items: flex-start; margin: var(--klik-stack-lg) 0 0; padding: var(--klik-card-pad-lg) var(--klik-panel-pad);
  border-radius: 16px; background: var(--klik-cta-bg); color: var(--klik-on-primary);
  box-shadow: var(--klik-cta-shadow);
}
.kp-article .kp-cta-ico {
  display: flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px;
  border-radius: 14px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .3); color: var(--kp-yellow);
}
.kp-article .kp-cta-ico .kp-ico { width: 26px; height: 26px; }
.kp-article .kp-cta-main { min-width: 0; }
.kp-article .kp-cta h2 { margin: 0 0 8px; color: #fff; font-family: Lato, sans-serif; font-size: 22px; font-weight: 800; line-height: 1.3; }
.kp-article .kp-cta p { margin: 0 0 18px; color: var(--klik-on-primary-muted); font-size: 16px; line-height: 1.6; }
.kp-article .kp-cta a:focus-visible { outline-color: var(--klik-focus-on-primary); }
.kp-article .kp-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.kp-article .kp-cta-actions a { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.kp-article .kp-cta-actions a:not(.kp-button):hover { text-decoration: underline; text-underline-offset: 3px; }
.kp-article .kp-cta-actions a .kp-ico { color: var(--kp-yellow); }
.kp-article .kp-cta .kp-button {
  padding: 12px 22px; border-radius: 30px; background: var(--kp-yellow); color: var(--kp-navy); font-weight: 800;
}
.kp-article .kp-cta .kp-button .kp-ico { color: var(--kp-navy); }
.kp-article .kp-cta .kp-button:hover { background: #fff; }

/* Lue myös */
.kp-article .kp-related { margin: var(--klik-section-y-tight) 0 0; }
.kp-article .kp-h2 {
  margin: 0 0 var(--klik-heading-gap); color: var(--kp-navy);
  font-family: Leaguespartan, "League Spartan", Lato, sans-serif; font-size: clamp(26px, 4vw, 32px); line-height: 1.2;
}
.kp-article .kp-cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--klik-gap); }
.kp-article .kp-cards li { display: flex; margin: 0; }
.kp-article .kp-card {
  display: flex; flex-direction: column; gap: 12px; width: 100%; padding: var(--klik-card-pad);
  border-radius: 14px; background: #fff; border: 1px solid var(--kp-line);
  box-shadow: var(--klik-shadow); color: var(--kp-text); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kp-article .kp-card:hover { border-color: var(--kp-blue); box-shadow: var(--klik-shadow-hover); transform: translateY(-2px); }
.kp-article .kp-card-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--kp-bg); border: 1px solid var(--kp-line); color: var(--kp-blue);
}
.kp-article .kp-card-title { flex: 1; color: var(--kp-navy); font-size: 17px; font-weight: 800; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; }
.kp-article .kp-card-more { display: inline-flex; align-items: center; gap: 6px; color: var(--kp-blue); font-size: 15px; font-weight: 700; }
.kp-article .kp-card-more .kp-ico { width: 18px; height: 18px; transition: transform .15s; }
.kp-article .kp-card:hover .kp-card-more .kp-ico { transform: translateX(3px); }

.kp-article .kp-back { margin: var(--klik-stack-lg) 0 0; }
.kp-article .kp-back a { display: inline-flex; align-items: center; gap: 8px; color: var(--kp-blue); font-size: 16px; font-weight: 700; text-decoration: none; }
.kp-article .kp-back a:hover { color: var(--klik-primary-hover); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .kp-article .kp-card, .kp-article .kp-card-more .kp-ico { transition: none; }
  .kp-article .kp-card:hover { transform: none; }
}
@media screen and (max-width: 767px) {
  .kp-hero { padding: 20px 0 34px; }
  .kp-hero .kp-crumbs ol { margin-bottom: 20px; }
  .kp-hero .kp-crumbs li[aria-current] { display: none; }
  .kp-article { padding: 28px 0 56px; }
  .kp-article .kp-text { font-size: 17px; line-height: 1.65; }
  .kp-article .kp-text .kp-label { font-size: 18px; }
  .kp-article .kp-text h2 { font-size: 20px; }
  .kp-article .kp-text ol > li { padding-left: 42px; }
  .kp-article .kp-text ol > li::before { width: 30px; height: 30px; font-size: 15px; }
  .kp-article .kp-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kp-article .kp-card { flex-direction: row; align-items: center; padding: 16px; }
  .kp-article .kp-card-more { display: none; }
  .kp-article .kp-card-title { font-size: 16px; }
  .kp-article .kp-cta { flex-direction: column; gap: 14px; padding: 22px 20px; margin-top: 36px; }
  .kp-article .kp-related { margin-top: 44px; }
}
@media screen and (max-width: 479px) {
  .kp-hero .kp-wrap, .kp-article .kp-wrap { padding: 0 16px; }
  .kp-hero .kp-crumbs li + li::before { margin: 0 7px; }
  .kp-article .kp-cta .kp-button { width: 100%; justify-content: center; }
}
