/*
 * G.I. card collection pages.
 * Design authority: the current encyclopedia top page (pixiv-compact-v1).
 * Keep this layer light, square, information-dense, and independent of the
 * legacy theme/dark-mode presentation.
 */

.hh-page--home_hub.hh-page--gi-cards {
  min-width: 20rem;
  background: var(--px-bg);
  color: var(--px-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

.hh-page--gi-cards::after {
  display: none;
}

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

.hh-gi-article {
  padding-bottom: 4rem;
}

.hh-gi-hero h1 {
  max-width: 31ch;
}

.hh-gi-shortcuts ul {
  display: flex;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hh-page--home_hub .hh-gi-shortcuts {
  display: flex;
}

.hh-page--home_hub .hh-gi-shortcuts > span,
.hh-page--home_hub .hh-gi-shortcuts a {
  min-height: 0;
  padding: .3rem 0;
  border: 0;
  background: transparent;
}

.hh-page--home_hub .hh-gi-shortcuts > span {
  color: var(--px-muted);
}

.hh-page--home_hub .hh-gi-shortcuts a {
  color: var(--px-blue);
}

.hh-gi-shortcuts a[aria-current="page"] {
  color: var(--px-text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--px-cyan);
  text-decoration-thickness: 2px;
  text-underline-offset: .25rem;
}

.hh-gi-overview {
  display: grid;
  margin-bottom: 1rem;
  border: 1px solid var(--px-line);
  background: var(--px-panel);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hh-gi-overview section {
  min-width: 0;
  padding: .95rem 1rem 1rem;
  border-top: 3px solid var(--px-blue-dark);
}

.hh-gi-overview section:nth-child(2) {
  border-top-color: var(--px-cyan);
}

.hh-gi-overview section:nth-child(3) {
  border-top-color: var(--px-green);
}

.hh-gi-overview section + section {
  border-left: 1px solid var(--px-line);
}

.hh-gi-overview h2 {
  margin: 0 0 .38rem;
  color: var(--px-text);
  font-size: .82rem;
  line-height: 1.4;
}

.hh-gi-overview p {
  margin: 0;
  color: #59636b;
  font-size: .67rem;
  line-height: 1.75;
}

.hh-gi-overview p + p {
  margin-top: .5rem;
}

.hh-gi-controls,
.hh-gi-results {
  border: 1px solid var(--px-line);
  background: var(--px-panel);
}

.hh-gi-controls {
  padding: .95rem 1rem 1rem;
  border-top: 3px solid var(--px-blue-dark);
}

.hh-gi-controls header,
.hh-gi-results > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.hh-gi-controls header {
  margin-bottom: .7rem;
}

.hh-gi-controls header p,
.hh-gi-results > header p {
  margin: 0;
  color: var(--px-muted);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.hh-gi-controls h2,
.hh-gi-results h2 {
  margin: .05rem 0 0;
  color: var(--px-text);
  font-size: 1rem;
  line-height: 1.4;
}

.hh-gi-controls header button {
  padding: .3rem .15rem;
  border: 0;
  background: transparent;
  color: var(--px-blue);
  cursor: pointer;
  font: inherit;
  font-size: .65rem;
  transition: transform 140ms cubic-bezier(.23, 1, .32, 1);
}

.hh-gi-controls header button:active {
  transform: scale(.97);
}

.hh-gi-controls__fields {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(10rem, .65fr) minmax(12rem, .85fr);
  gap: .6rem;
}

.hh-gi-controls label {
  display: grid;
  gap: .24rem;
  color: #58636b;
  font-size: .6rem;
  font-weight: 700;
}

.hh-gi-controls input,
.hh-gi-controls select {
  width: 100%;
  min-height: 2.55rem;
  padding: .5rem .65rem;
  border: 1px solid var(--px-line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--px-text);
  font: inherit;
  font-size: .72rem;
}

.hh-gi-controls input:focus,
.hh-gi-controls select:focus {
  outline: 2px solid color-mix(in srgb, var(--px-cyan) 40%, transparent);
  outline-offset: 1px;
  border-color: var(--px-blue);
}

.hh-gi-controls [role="status"] {
  margin: .65rem 0 0;
  color: var(--px-muted);
  font-size: .62rem;
}

.hh-gi-results {
  margin-top: 1rem;
}

.hh-gi-results > header {
  min-height: 3.25rem;
  padding: .65rem .85rem;
  border-top: 3px solid var(--px-cyan);
  border-bottom: 1px solid var(--px-line);
}

.hh-gi-results > header > strong {
  color: var(--px-blue-dark);
  font-size: .68rem;
}

.hh-gi-grid {
  display: grid;
  margin: 0;
  padding: .8rem;
  list-style: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}

.hh-gi-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--px-line);
  background: #fff;
}

.hh-gi-card[hidden] {
  display: none;
}

.hh-gi-card__image {
  display: grid;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  padding: .48rem;
  border-bottom: 1px solid var(--px-line);
  background: #f5f6f7;
  place-items: center;
}

.hh-gi-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hh-gi-card__body {
  padding: .68rem .72rem .75rem;
}

.hh-gi-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .22rem;
  margin: 0 0 .32rem;
  color: var(--px-muted);
  font-size: .55rem;
}

.hh-gi-card__meta span {
  padding: .08rem .28rem;
  border: 1px solid #d8dde1;
  background: #f6f7f8;
}

.hh-gi-card__meta span:first-child {
  border-color: #b9cfdd;
  color: var(--px-blue);
  font-weight: 700;
}

.hh-gi-card h3 {
  margin: 0;
  font-size: .82rem;
  line-height: 1.4;
}

.hh-gi-card h3 a {
  color: var(--px-blue-dark);
}

.hh-gi-card__description {
  display: -webkit-box;
  margin: .35rem 0 0;
  overflow: hidden;
  color: #5d6870;
  font-size: .64rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.hh-gi-card__detail {
  display: inline-block;
  margin-top: .48rem;
  color: var(--px-blue);
  font-size: .61rem;
  font-weight: 700;
}

.hh-gi-empty {
  display: none;
  margin: 0;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--px-line);
  color: var(--px-muted);
  text-align: center;
}

[data-gi-empty] .hh-gi-empty {
  display: block;
}

.hh-gi-note {
  display: grid;
  margin-top: .8rem;
  padding: .72rem .85rem;
  border: 1px solid var(--px-line);
  border-left: 3px solid var(--px-blue-dark);
  background: var(--px-panel-soft);
  color: #5f6971;
  font-size: .63rem;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
}

.hh-gi-note strong {
  color: var(--px-blue-dark);
}

.hh-gi-note p {
  margin: 0;
}

@media (hover: hover) and (pointer: fine) {
  .hh-gi-card:hover {
    background: #f7fbfd;
  }

  .hh-gi-card h3 a:hover,
  .hh-gi-card__detail:hover,
  .hh-gi-controls header button:hover {
    text-decoration: underline;
  }
}

@media (max-width: 58rem) {
  .hh-gi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hh-gi-overview {
    grid-template-columns: 1fr;
  }

  .hh-gi-overview section + section {
    border-left: 0;
  }
}

@media (max-width: 43rem) {
  .hh-page--gi-cards .hh-layout-shell {
    width: calc(100% - 1rem);
  }

  .hh-gi-shortcuts ul {
    gap: .65rem;
  }

  .hh-gi-controls__fields {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 32rem) {
  .hh-gi-controls {
    padding: .8rem;
  }

  .hh-gi-grid {
    grid-template-columns: 1fr;
    padding: .55rem;
  }

  .hh-gi-card {
    display: grid;
    grid-template-columns: minmax(7.3rem, 40%) minmax(0, 1fr);
  }

  .hh-gi-card__image {
    height: 100%;
    border-right: 1px solid var(--px-line);
    border-bottom: 0;
  }

  .hh-gi-note {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hh-gi-controls header button {
    transition: none;
  }
}
