/* Natiivilla details-elementillä toimiva kategoriapuu, myös ilman JavaScriptiä. */
.site-header { position: relative; }
.category-browser { position: static; }
.category-panel {
  position: absolute;
  inset: 100% 0 auto;
  width: auto;
  max-height: min(70vh, 650px);
  overflow: auto;
  padding: 1.5rem clamp(1rem, 4vw, 5rem) 2.5rem;
  border: 0;
  border-radius: 0 0 24px 24px;
}
.category-close {
  display: block;
  min-height: 44px;
  margin: 0 0 1rem auto;
  padding: .5rem .9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.category-close[hidden] { display: none; }
.category-groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2rem; align-items: start; }
.category-group { min-width: 0; }
.category-group h2 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 600; }
.category-group h2 a { text-decoration: none; }
.category-group h2 a:hover { text-decoration: underline; }
.category-group-children { margin: 0; padding: 0; list-style: none; }
.category-group-children > li { position: relative; }
.category-group-children > li > a { display: flex; min-height: 44px; align-items: center; padding: .5rem 3rem .5rem 0; font-size: .87rem; text-decoration: none; overflow-wrap: anywhere; }
.category-group-children > li > a:hover { text-decoration: underline; }
.category-subgroups > summary { position: absolute; top: 0; right: 0; width: 44px; min-height: 44px; justify-content: center; cursor: pointer; list-style: none; }
.category-subgroups > summary::-webkit-details-marker { display: none; }
.category-subgroups > summary::after { content: '+'; font-size: 1.2rem; }
.category-subgroups[open] > summary::after { content: '−'; }
.category-subgroups > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.category-subgroups > .category-tree { margin-bottom: .5rem; padding-left: 1rem; border-left: 1px solid #e7dddd; }
@media (min-width: 48.001rem) and (max-width: 64rem) {
  .category-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
  .primary-navigation { flex-wrap: wrap; align-items: stretch; }
  .category-browser { width: 100%; }
  .category-panel { position: static; width: 100%; max-height: min(65vh, 38rem); padding: 1rem; }
  .category-groups { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
