/* Palpedia TCG — pals index page.
   Atlas recipe: catalog command bar and card grid come from the shared stacks;
   this file carries the Pal panels (portrait header + atlas chips)
   and the per-panel grid overrides. */

body.tcg-hub-page .tcg-pals-state {
  padding: 3rem 0;
  color: var(--muted, #9fb5b7);
  text-align: center;
}

body.tcg-hub-page .tcg-pals-state--error a {
  color: var(--cyan, #62e7ed);
}

/* ---------- Pal panels ---------- */

body.tcg-hub-page .tcg-pals-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  align-items: start;
  padding-bottom: .5rem;
}

body.tcg-hub-page .tcg-pal-entry summary {
  display: flex;
  align-items: center;
  gap: .95rem;
  padding: .85rem 1rem;
  cursor: pointer;
  list-style: none;
  transition: background 180ms var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

body.tcg-hub-page .tcg-pal-entry summary::-webkit-details-marker {
  display: none;
}

body.tcg-hub-page .tcg-pal-entry summary:hover,
body.tcg-hub-page .tcg-pal-entry summary:focus-visible {
  background: rgba(98, 231, 237, .045);
}

body.tcg-hub-page .tcg-pal-entry__portrait {
  flex: 0 0 auto;
  width: 76px;
  padding: .22rem;
  border: 1px solid color-mix(in srgb, var(--cyan, #62e7ed) 26%, transparent);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  background: rgba(6, 16, 22, .6);
}

body.tcg-hub-page .tcg-pal-entry__portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4.7% / 3.4%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}

body.tcg-hub-page .tcg-pal-entry__heading {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

body.tcg-hub-page .tcg-pal-entry__name {
  color: var(--text, #edf7f5);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

body.tcg-hub-page .tcg-pal-entry__count {
  color: var(--cyan, #62e7ed);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.tcg-hub-page .tcg-pal-entry__toggle {
  flex: 0 0 auto;
  margin-left: auto;
  width: .6rem;
  height: .6rem;
  border-right: 2px solid var(--cyan, #62e7ed);
  border-bottom: 2px solid var(--cyan, #62e7ed);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

body.tcg-hub-page .tcg-pal-entry[open] .tcg-pal-entry__toggle {
  transform: rotate(225deg);
}

body.tcg-hub-page .tcg-pal-entry__body {
  padding: 0 1rem 1.05rem;
  border-top: 1px solid var(--line, rgba(166, 217, 224, .12));
}

/* ---------- Atlas chips (cross-links) ---------- */

body.tcg-hub-page .tcg-pal-entry__links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .85rem 0 .95rem;
}

body.tcg-hub-page .tcg-pal-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .34rem .78rem;
  color: var(--cyan, #62e7ed);
  border: 1px solid color-mix(in srgb, var(--cyan, #62e7ed) 35%, transparent);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: rgba(98, 231, 237, .04);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)), background 160ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)), border-color 160ms var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

body.tcg-hub-page .tcg-pal-chip:hover,
body.tcg-hub-page .tcg-pal-chip:focus-visible {
  color: var(--cyan-soft, #a6fbf6);
  background: rgba(98, 231, 237, .1);
  border-color: color-mix(in srgb, var(--cyan, #62e7ed) 60%, transparent);
}

/* ---------- Per-panel atlas grid ---------- */

body.tcg-hub-page .tcg-pal-entry__grid {
  margin: 0;
  padding: .55rem;
  grid-template-columns: repeat(auto-fill, minmax(100px, 128px));
  justify-content: start;
  gap: .8rem;
}

@media (max-width: 560px) {
  body.tcg-hub-page .tcg-pal-entry__links {
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    padding: .9rem 0 1rem;
  }

  body.tcg-hub-page .tcg-pal-chip {
    justify-content: center;
    padding: .5rem .9rem;
    font-size: .72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tcg-hub-page .tcg-pal-entry summary,
  body.tcg-hub-page .tcg-pal-entry__toggle,
  body.tcg-hub-page .tcg-pal-chip {
    transition: none;
  }
}
