/* HUNTER×HUNTER encyclopedia index — aligned with the compact home UI. */

.hh-page--encyclopedia-index {
  min-width: 20rem;
  background: var(--px-bg);
  color: var(--px-text);
}

.hh-page--encyclopedia-index::after {
  display: none;
}

.hh-page--encyclopedia-index .hh-site-header {
  position: sticky;
  z-index: 60;
  top: 0;
}

.hh-page--encyclopedia-index .hh-header-inner {
  width: min(1060px, calc(100% - 2rem));
}

.hh-index-primary-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
}

.hh-index-primary-nav a {
  min-height: 2.35rem;
  padding: .48rem .72rem;
  border-radius: .2rem;
  color: #dce8f1;
  font-size: .72rem;
  font-weight: 600;
}

.hh-index-primary-nav a:hover,
.hh-index-primary-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

.hh-page--encyclopedia-index .hh-index-mobile-nav {
  display: none;
}

.hh-page--encyclopedia-index .hh-layout-shell {
  width: min(1060px, calc(100% - 2rem));
}

.hh-index-main,
.hh-index-page {
  min-width: 0;
}

.hh-index-page {
  padding-bottom: 4rem;
}

.hh-index-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--px-line);
  border-radius: .25rem;
  background: var(--px-panel);
}

.hh-index-hero p:first-child,
.hh-encyclopedia-controls > header p {
  margin: 0 0 .1rem;
  color: var(--px-blue);
  font-size: .62rem;
  font-weight: 700;
}

.hh-index-hero h1 {
  margin: 0;
  color: var(--px-text);
  font-family: inherit;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  letter-spacing: -.025em;
  line-height: 1.3;
}

.hh-index-hero h1 + p {
  max-width: 72ch;
  margin: .3rem 0 0;
  color: #5f6971;
  font-size: .76rem;
}

.hh-index-hero > strong {
  padding: .42rem .7rem;
  border: 1px solid #bcd2df;
  border-radius: 999px;
  background: var(--px-blue-soft);
  color: var(--px-blue-dark);
  font-size: .67rem;
  white-space: nowrap;
}

.hh-index-categories {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .55rem;
}

.hh-index-categories a {
  display: flex;
  min-width: 0;
  min-height: 3.05rem;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  padding: .65rem .7rem;
  border: 1px solid var(--px-line);
  border-top: 3px solid var(--px-cyan);
  border-radius: .2rem;
  background: var(--px-panel);
  color: var(--px-text);
}

.hh-index-categories a:nth-child(4n + 2) { border-top-color: var(--px-green); }
.hh-index-categories a:nth-child(4n + 3) { border-top-color: var(--px-orange); }
.hh-index-categories a:nth-child(4n) { border-top-color: var(--px-red); }

.hh-index-categories a:hover,
.hh-index-categories a:focus-visible {
  border-color: var(--px-blue);
  background: #fbfdff;
}

.hh-index-categories span {
  min-width: 0;
  overflow: hidden;
  font-size: .69rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-index-categories strong {
  color: var(--px-blue-dark);
  font-size: .74rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-controls {
  margin-top: .7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--px-line);
  border-radius: .25rem;
  background: var(--px-panel);
}

.hh-encyclopedia-controls > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.hh-encyclopedia-controls > header h2 {
  margin: 0;
  color: var(--px-text);
  font-family: inherit;
  font-size: 1rem;
}

.hh-encyclopedia-controls > header a {
  color: var(--px-blue);
  font-size: .65rem;
  white-space: nowrap;
}

.hh-index-primary-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(12rem, .9fr);
  gap: .65rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-controls label {
  display: grid;
  gap: .3rem;
  min-width: 0;
  color: #66717a;
  font-size: .66rem;
  font-weight: 600;
}

.hh-page--encyclopedia-index .hh-encyclopedia-controls input,
.hh-page--encyclopedia-index .hh-encyclopedia-controls select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  padding: .58rem .72rem;
  border: 1px solid var(--px-line-strong);
  border-radius: .2rem;
  background: #fff;
  color: var(--px-text);
  font: inherit;
  font-size: .78rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-controls input:focus,
.hh-page--encyclopedia-index .hh-encyclopedia-controls select:focus {
  border-color: var(--px-blue);
}

.hh-index-advanced {
  margin-top: .6rem;
  border-top: 1px solid var(--px-line);
}

.hh-index-advanced > summary {
  width: fit-content;
  padding: .55rem 0 .2rem;
  color: var(--px-blue);
  cursor: pointer;
  font-size: .66rem;
  font-weight: 600;
}

.hh-index-advanced > label {
  width: min(22rem, 100%);
  margin-top: .35rem;
}

.hh-page--encyclopedia-index [data-encyclopedia-status] {
  margin: .65rem 0 0;
  color: var(--px-muted);
  font-size: .68rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-groups {
  display: grid;
  gap: .7rem;
  margin-top: .7rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--px-line);
  border-radius: .25rem;
  background: var(--px-panel);
}

.hh-page--encyclopedia-index .hh-encyclopedia-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--px-line);
  background: var(--px-panel-soft);
}

.hh-page--encyclopedia-index .hh-encyclopedia-group > header p {
  margin: 0;
  color: var(--px-muted);
  font-size: .56rem;
  font-weight: 700;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group > header h2 {
  margin: .05rem 0 0;
  color: var(--px-text);
  font-family: inherit;
  font-size: .95rem;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group > header > span {
  color: var(--px-blue-dark);
  font-size: .68rem;
  font-weight: 700;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li {
  min-width: 0;
  border-right: 1px solid var(--px-line);
  border-bottom: 1px solid var(--px-line);
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li:nth-child(3n) {
  border-right: 0;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li a {
  display: grid;
  min-height: 100%;
  gap: .16rem;
  padding: .62rem .72rem;
  background: #fff;
  color: var(--px-blue);
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li a:hover,
.hh-page--encyclopedia-index .hh-encyclopedia-group li a:focus-visible {
  background: var(--px-blue-soft);
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li strong {
  font-size: .72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hh-page--encyclopedia-index .hh-encyclopedia-group li span {
  color: var(--px-muted);
  font-size: .58rem;
}

.hh-index-noscript {
  padding: 1rem;
  border: 1px solid var(--px-line);
  background: #fff;
}

@media (max-width: 56rem) {
  .hh-index-categories {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hh-page--encyclopedia-index .hh-encyclopedia-group ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hh-page--encyclopedia-index .hh-encyclopedia-group li:nth-child(3n) {
    border-right: 1px solid var(--px-line);
  }

  .hh-page--encyclopedia-index .hh-encyclopedia-group li:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 43rem) {
  .hh-index-primary-nav {
    display: none;
  }

  .hh-page--encyclopedia-index .hh-index-mobile-nav {
    display: block;
  }

  .hh-index-hero {
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  .hh-index-hero > strong {
    width: fit-content;
  }

  .hh-index-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hh-index-primary-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 31rem) {
  .hh-page--encyclopedia-index .hh-layout-shell,
  .hh-page--encyclopedia-index .hh-header-inner {
    width: min(100% - 1rem, 1060px);
  }

  .hh-index-hero,
  .hh-page--encyclopedia-index .hh-encyclopedia-controls {
    padding: .85rem;
  }

  .hh-index-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hh-page--encyclopedia-index .hh-encyclopedia-group ul {
    grid-template-columns: 1fr;
  }

  .hh-page--encyclopedia-index .hh-encyclopedia-group li,
  .hh-page--encyclopedia-index .hh-encyclopedia-group li:nth-child(2n),
  .hh-page--encyclopedia-index .hh-encyclopedia-group li:nth-child(3n) {
    border-right: 0;
  }
}
