/* Binders: cover tiles, 3x3 / 4x3 pocket pages, foil shimmer, quantity badge, in-stock highlight. */
.binder-tiles { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.binder-tile a { display: flex; flex-direction: column; gap: .25rem; color: inherit; text-decoration: none; }
.binder-cover { display: block; aspect-ratio: 63 / 88; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.binder-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.binder-empty { display: grid; place-items: center; height: 100%; color: var(--muted, #888); }
.binder-tile a:hover .binder-cover, .binder-tile a:focus-visible .binder-cover { outline: 2px solid var(--accent); }

.binder-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.binder-value { display: flex; flex-direction: column; text-align: right; }
.binder-value strong { font-size: 1.5rem; }
.binder-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0 .5rem; }
.binder-filters input[type=search] { flex: 1 1 12rem; }
.binder-toggles a[aria-current] { font-weight: 700; text-decoration: none; }
.binder-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .5rem 0; }
.binder-pager [aria-disabled] { opacity: .4; pointer-events: none; }

.binder-page { list-style: none; margin: 0 auto; padding: .75rem; display: grid; gap: .6rem; max-width: min(100%, 1050px);
  grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.binder-page.size-12 { grid-template-columns: repeat(4, 1fr); max-width: min(100%, 1350px); }
.pocket { position: relative; min-width: 0; }
.pocket.empty { aspect-ratio: 63 / 88; border: 1px dashed var(--border); border-radius: 4.5% / 3.2%; }
.pocket figure { margin: 0; }
.pocket-img { position: relative; display: block; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%; overflow: hidden; background: var(--border); }
.pocket-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pocket figcaption { display: flex; flex-direction: column; font-size: .85rem; padding-top: .25rem; overflow-wrap: anywhere; }
.qty-badge { position: absolute; top: .35rem; right: .35rem; background: rgba(0,0,0,.75); color: #fff; font-weight: 700;
  font-size: .85rem; padding: .1rem .45rem; border-radius: 999px; }
.pocket.in-stock .pocket-img { box-shadow: 0 0 0 3px var(--ok); }
tr.in-stock td { background: color-mix(in srgb, var(--ok) 12%, transparent); }

/* Foil shimmer: a moving rainbow sheen over the card image. Stays still for reduced-motion users. */
.pocket.foil .pocket-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35;
  background: linear-gradient(115deg, transparent 20%, #ff8ad8 35%, #8affd5 45%, #8ab4ff 55%, #fff38a 65%, transparent 80%);
  background-size: 250% 250%; animation: binder-shimmer 4s linear infinite; }
@keyframes binder-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .pocket.foil .pocket-img::after { animation: none; background-position: 40% 0; } }

.binder-list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.binder-list th, .binder-list td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.binder-list img.mini { border-radius: 3px; display: block; }
.binder-none { padding: 2rem 0; }

@media (max-width: 560px) {
  .binder-page, .binder-page.size-12 { grid-template-columns: repeat(3, 1fr); padding: .4rem; gap: .35rem; }
  .binder-page.size-12 { grid-template-columns: repeat(3, 1fr); }
  .pocket figcaption { font-size: .72rem; }
  .binder-value { text-align: left; }
  .binder-list { display: block; overflow-x: auto; }
}

/* Gallery: every card in a grid that fills the screen (as many columns as fit) and scrolls. */
.binder-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem .75rem;
  grid-template-columns: repeat(auto-fill, minmax(clamp(170px, 19vw, 300px), 1fr)); }
.binder-gallery .pocket figcaption { font-size: .82rem; }
.binder-value .up, .pocket .up { color: var(--ok); }
.binder-value .down, .pocket .down { color: var(--danger, #c0392b); }
a.tag { text-decoration: none; align-self: flex-start; }
a.tag:hover, a.tag:focus-visible { text-decoration: underline; }
@media (max-width: 560px) {
  .binder-gallery { grid-template-columns: repeat(2, 1fr); gap: .75rem .5rem; }
  .binder-gallery .pocket figcaption { font-size: .72rem; }
}
/* Let the gallery use the whole window instead of the usual 960px column. */
main:has(.binder-gallery), main:has(.binder-page) { max-width: 100%; padding-inline: clamp(.75rem, 2vw, 2rem); }

/* Wish list as a gallery: whole card image, tick to mark bought, store links under the card. */
.wish-head { margin: 1.25rem 0 .6rem; font-size: 1.2rem; }
.pocket.wish .bought-tick { position: absolute; top: .4rem; left: .4rem; margin: 0; padding: .3rem; border-radius: 8px;
  background: rgba(0,0,0,.6); color: #fff; }
.pocket.wish .bought-tick:has(input:checked) { background: var(--accent); }
.wish-stock { list-style: none; margin: .25rem 0 0; padding: .3rem .45rem; border-left: 3px solid var(--ok); font-size: .82rem; }
.wish-stock li + li { margin-top: .15rem; }
.wish-actions { margin-top: .2rem; }
