/* AwayWard Compendium: layout rules for the art gallery page only.
   Everything else (palette, type, nav, footer, buttons, cards) comes from
   css/style.css. No em dashes or en dashes anywhere. */

/* ---------- hero ---------- */
.comp-hero { padding: 84px 0 0; }
.comp-hero h1 {
  font-family: var(--font-fancy);
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
}
.comp-hero .lede { margin-bottom: 34px; }

/* The eleven painted zone tiles open the page, ahead of the icon grid. They
   sit on the hero shade so the strip reads as a horizon band. */
.vista-strip {
  position: relative;
  z-index: 2;
  margin-top: 46px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 0 24px 30px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}
.vista-strip::-webkit-scrollbar { height: 8px; }
.vista-strip::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 999px; }

.vista {
  position: relative;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.vista:hover { transform: translateY(-5px); border-color: var(--gold); }
.vista img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}
.vista .vname {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 10px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 16, 0.92) 62%);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* ---------- controls ---------- */
.comp-section { padding-top: 66px; }

.comp-controls {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.comp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
/* reuses .chip-btn from style.css wholesale: the look, the 44px touch-target
   padding and the site-wide focus ring all come from there. The only addition
   is the live count that rides inside each chip. */
.comp-tabs .chip-btn .n {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  margin-left: 7px;
  font-size: 0.82em;
}

.comp-search { display: flex; justify-content: center; }
.comp-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.comp-search-input {
  width: min(460px, 100%);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
}
.comp-search-input::placeholder { color: var(--muted); }
.comp-search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 199, 94, 0.16);
}

.comp-status {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
}

/* ---------- the icon grid ---------- */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.comp-item {
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 120% at 50% 0%, var(--panel-raised), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 10px 13px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.comp-item:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

/* fixed square box: the image slot never changes size, so paging in a batch
   causes no layout shift while the PNGs decode */
.comp-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 10px;
  background:
    radial-gradient(70% 70% at 50% 42%, rgba(240, 199, 94, 0.07), transparent 70%),
    rgba(5, 6, 16, 0.42);
}
.comp-thumb img {
  max-width: 78%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.comp-name {
  font-family: var(--font-display);
  font-size: 0.86rem;
  line-height: 1.22;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.comp-sub {
  margin-top: 5px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* per-category accents, borrowing the rarity colours already in style.css */
.comp-item.c-zones { border-color: rgba(95, 207, 128, 0.26); }
.comp-item.c-bosses { border-color: rgba(240, 199, 94, 0.34); }
.comp-item.c-worldbosses { border-color: rgba(255, 122, 217, 0.3); }
.comp-item.c-bossgear { border-color: rgba(180, 120, 230, 0.3); }
.comp-item.c-pets { border-color: rgba(90, 169, 240, 0.26); }
.comp-item.c-classes { border-color: rgba(255, 184, 108, 0.26); }

.comp-item.c-bosses .comp-name,
.comp-item.c-worldbosses .comp-name { color: var(--gold-light); }

/* ---------- paging ---------- */
.comp-more { text-align: center; padding-top: 30px; }
.comp-sentinel { height: 1px; }

.comp-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 1.02rem;
}

/* ---------- batches fade in ---------- */
.comp-item.fresh { animation: comp-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes comp-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 680px) {
  .comp-hero { padding-top: 60px; }
  .vista-strip { grid-auto-columns: minmax(124px, 1fr); margin-top: 34px; }
  /* ten chips stack into a wall on a phone. Only the side padding is trimmed,
     so every chip keeps its full height and stays above the 44px touch floor. */
  .comp-tabs { gap: 7px; }
  .comp-tabs .chip-btn { padding: 12px 12px; font-size: 0.86rem; }
  .comp-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
  .comp-item { padding: 10px 7px 11px; }
  .comp-name { font-size: 0.78rem; }
  .comp-sub { font-size: 0.6rem; letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  .comp-item.fresh { animation: none; }
  .vista-strip { scroll-behavior: auto; }
}
