/* Set checklist pages (/sets, /sets/<slug>), rendered by web/api/sets.mjs on top of public.css. */

/* Opening: copy on the left, a fact sheet on the right. */
.set-page .set-opening { grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); }
.set-index .set-opening { grid-template-columns: 1fr; }
.set-opening h1 { overflow-wrap: anywhere; }
.set-facts {
  display: grid; gap: 0; margin: 0; padding: 20px 24px; border: 3px solid var(--ink); border-radius: 18px;
  background: var(--cream); color: var(--ink); box-shadow: var(--pop-sm); rotate: 1.2deg;
}
.set-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 2px dashed var(--cream-line); }
.set-facts > div:last-child { border-bottom: 0; }
.set-facts dt { font-weight: 700; color: var(--cream-muted); }
.set-facts dd { margin: 0; font-weight: 800; text-align: right; }

/* Wide chapters: the heading sits above the content so long tables get the full sheet. */
.guide-chapter.set-wide { grid-template-columns: 1fr; gap: 20px; }
.collector-guide .guide-chapter.set-wide h2 { max-width: none; }

/* Tables: names and numbers read left to right; prices line up on the right. */
.set-page table { table-layout: auto; font-size: 15px; }
.set-page :is(.set-checklist, .set-rarities, .set-pages) :is(th, td) { text-align: left; padding: 10px 8px; }
.set-page .set-checklist :is(td:nth-child(4), td:nth-child(5), th:nth-child(4), th:nth-child(5)) { text-align: right; white-space: nowrap; }
.set-page .set-version { display: inline-block; margin-left: 4px; padding: 1px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sky); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.set-page .set-checklist td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-page .set-checklist tbody th { font-weight: 700; }
.set-page .set-rarities td, .set-page .set-rarities th:last-child { text-align: right; }
.set-page .set-pages :is(td, th) { white-space: nowrap; }
.set-page .set-sheets { color: var(--cream-muted); }
.set-page .set-sheets::before { content: '· '; }

/* Most valuable cards: little sleeves in a grid. */
.set-top-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: top; }
.guide-chapter-body .set-top-cards li { position: relative; display: grid; gap: 4px; margin: 0; padding: 10px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: var(--pop-sm); counter-increment: top; }
.set-top-cards li::before {
  content: counter(top); position: absolute; top: -12px; left: -12px; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--sun); color: var(--ink); font: 800 14px/1 var(--sans);
}
.set-top-cards img { display: block; width: 100%; height: auto; aspect-ratio: 150 / 209; object-fit: contain; border-radius: 6px; background: var(--cream); }
.set-top-cards .set-card-name { margin-top: 6px; color: var(--ink); font-weight: 800; line-height: 1.25; }
.set-top-cards .set-card-meta { color: var(--cream-muted); font-size: 13px; }
.set-top-cards .set-card-price { color: var(--ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Neighbouring sets at the end of a page. */
.set-neighbours { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.set-neighbours a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--cream); color: var(--ink); box-shadow: var(--pop-sm); font-weight: 700; text-decoration: none;
  transition: translate var(--tap) var(--ease), box-shadow var(--tap) var(--ease);
}
@media (hover: hover) { .set-neighbours a:hover { translate: 0 calc(-2px * var(--motion)); box-shadow: var(--pop); } }
.set-neighbours a:active { translate: 0 calc(3px * var(--motion)); box-shadow: none; }

/* Index: every set as a sticker link, grouped by era. */
.set-group h3 { margin: 32px 0 14px; scroll-margin-top: 24px; }
.set-group h3:first-child { margin-top: 0; }
.set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-chapter-body .set-list li { margin: 0; }
.set-list a {
  display: grid; gap: 2px; height: 100%; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; background: #fff;
  color: var(--ink); box-shadow: var(--pop-sm); text-decoration: none; transition: translate var(--tap) var(--ease), box-shadow var(--tap) var(--ease);
}
@media (hover: hover) { .set-list a:hover { translate: 0 calc(-2px * var(--motion)); box-shadow: var(--pop); } }
.set-list a:active { translate: 0 calc(3px * var(--motion)); box-shadow: none; }
.set-list-name { font-weight: 800; line-height: 1.25; }
.set-list-meta { color: var(--cream-muted); font-size: 13px; }

.set-short { display: none; }

@media (max-width: 760px) {
  .set-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .set-short { display: inline; }
  .set-page .set-opening { grid-template-columns: 1fr; }
  .set-facts { rotate: 0deg; }
  .set-page table { font-size: 14px; }
  .set-page .set-checklist :is(th:nth-child(3), td:nth-child(3)) { display: none; }
  .set-page .set-checklist :is(th, td) { padding: 8px 4px; }
  .set-page .set-checklist tbody th { white-space: normal; }
  .set-page .set-version { display: table; margin: 4px 0 0; }
  .set-page .set-pages td { white-space: normal; }
  .set-page .set-sheets { display: block; }
  .set-page .set-sheets::before { content: none; }
  .set-top-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
