/* Tietopankki: search + browse, layered on the seo-article shell.
 * Reuses the article tokens (--ink, --rule, --bronze, --font-serif/sans).
 * Light, flat, quiet: an advisory-filing index, not a card wall.
 * No descriptions on screen (they live in the search index only), so the
 * default view stays calm and the search collapses the length. */

.tp { margin-top: 0.25rem; }

/* Sticky filter bar: search field + live count. */
.tp-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  padding: 0.85rem 0 0.9rem;
  margin: 0 0 0.25rem;
  transition: border-color 140ms ease;
  border-bottom: 1px solid transparent;
}
.tp-bar.tp-stuck { border-bottom-color: var(--rule); }

/* Underline-only input (DESIGN: no box, no fill, no glow). */
.tp-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid var(--ink);
  padding: 0.55rem 0.1rem;
}
.tp-search svg { flex: none; color: var(--ink-subtle); transition: color 140ms ease; }
.tp-search:focus-within { border-bottom-width: 2px; padding-bottom: calc(0.55rem - 1px); }
.tp-search:focus-within svg { color: var(--ink); }
.tp-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  letter-spacing: -0.003em;
  color: var(--ink);
  padding: 0;
}
.tp-search input::placeholder { color: var(--ink-subtle); }
.tp-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.tp-count {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-subtle);
  margin: 0.7rem 0 0;
  font-variant-numeric: tabular-nums;
}
.tp-count span { color: var(--ink); font-weight: 500; }

.tp-empty {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 1.5rem 0;
}
.tp-empty button {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--bronze);
  text-underline-offset: 0.18em;
}
.tp-empty button:hover { color: var(--bronze); }

/* Category group. */
.tp-cat { margin: 2.5rem 0 0; scroll-margin-top: 5rem; }
.tp-cat[hidden] { display: none; }

/* Override the seo-article serif h2 with the tracked sentence-case label. */
.tp-cat-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--ink-muted);
  margin: 0;
  padding: 0;
  font-variation-settings: normal;
  text-wrap: wrap;
}
.tp-cat-label::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--ink);
  margin-top: 0.65rem;
}

/* Ruled index rows: serif title only, hairline between rows. */
.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-list li { margin: 0; border-top: 1px solid var(--rule); }
.tp-list li:first-child { border-top: 0; }
.tp-list li[hidden] { display: none; }
.tp-list a {
  display: block;
  padding: 0.7rem 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: -0.008em;
  font-variation-settings: 'opsz' 24;
  color: var(--ink);
  text-decoration: none;
  transition: color 140ms ease;
}
.tp-list a:hover { color: var(--bronze); }
.tp-list a:focus-visible {
  color: var(--bronze);
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
}

@media (max-width: 40rem) {
  .tp-search input { font-size: 1rem; }
  .tp-list a { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-bar, .tp-search svg, .tp-list a { transition: none; }
}
