/* Books I've Read: cover shelves. */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(88px, 24vw, 140px), 1fr)); gap: 12px; }
.shelf-key { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.shelf-key .cnt { position: static; display: inline-grid; vertical-align: middle; margin-left: 8px; }
.shelf-key .cnt:first-child { margin-left: 0; }

.gallery-item { position: relative; min-width: 0; border-radius: var(--radius); }
.gallery-item[hidden] { display: none; }
.gallery-item[role=button] { cursor: pointer; }
.gallery-image {
    display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
    background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color var(--fast), transform var(--fast) ease-out;
}
.gallery-item:hover .gallery-image { border-color: var(--line-strong); transform: translateY(-2px); }
.gallery-image.current { border: 2px solid var(--accent); }
.gallery-image.missing { display: flex; align-items: center; justify-content: center; padding: 8px; color: var(--muted); font-size: 12px; text-align: center; }

/* corner marks: ✓ top right = I own a physical copy, read/listened counts top left, +N series count bottom right */
.bookshelf::after, .cnt, .more {
    position: absolute; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
    border: 1px solid; border-radius: 999px; color: var(--text); font-size: 12px; line-height: 1;
}
.bookshelf::after { content: "✓"; top: 6px; right: 6px; background: var(--accent-soft); border-color: var(--btn-line); }
.cnt { top: 6px; left: 6px; }
.cnt.rd, .cnt.own { background: var(--accent-soft); border-color: var(--btn-line); }
.cnt.au { background: var(--danger-bg); border-color: var(--danger-line); }
.gallery-item .cnt.rd + .cnt.au { left: 34px; }
.more { right: 6px; bottom: 6px; background: var(--btn2); border-color: var(--line-strong); }

.updated { margin: 0; color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
    .gallery-image { transition: none; }
    .gallery-item:hover .gallery-image { transform: none; }
}
