/* =============================================
   The Academy shelf
   =============================================
   Shared by academy-home.html and the dashboard card, because the covers are the
   same art doing the same job in both places and two copies of these rules would
   drift within a week. Nothing here depends on either page.
   ============================================= */

/* The shelf: all seven covers across the top at a size worth looking at. Written books are
   links; the rest are dimmed and inert. It wraps rather than scrolling, so a narrow screen
   gets rows of two or three instead of a swipe nobody discovers. */
.ac-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 4px 0 8px;
}

.ac-shelf-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md, 12px);
  transition: transform 140ms ease;
}

.ac-shelf-art {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md, 12px);
  display: block;
}

.ac-shelf-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.ac-shelf-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8f97b5);
}

.ac-shelf-title {
  font-size: 15px;
  font-weight: var(--font-heading-weight);
  color: var(--ink2);
  text-wrap: balance;
}

a.ac-shelf-item:hover .ac-shelf-art,
a.ac-shelf-item:focus-visible .ac-shelf-art { border-color: var(--color-accent-300, #7aa2ff); }

a.ac-shelf-item:hover { transform: translateY(-2px); }

/* Not written yet: visible, so the shape of the series reads, but plainly not a door. */
.ac-shelf-item.is-unwritten { opacity: 0.4; }
.ac-shelf-item.is-unwritten .ac-shelf-art { filter: grayscale(0.75); }

/* On a phone the shelf is navigation rather than a gallery: two up keeps the page
   scrollable instead of seven full-width covers between the reader and the books. */
@media (max-width: 560px) {
  .ac-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .ac-shelf-title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-shelf-item { transition: none; }
  a.ac-shelf-item:hover { transform: none; }
}
