/* Book shelves — lifted from the books mockup (.sec / .shelf / .row-shelf / .book-card). */
[data-book-shelves] .sec { padding: 64px 0; }
[data-book-shelves] .shelf { margin-bottom: 56px; }
[data-book-shelves] .shelf:last-child { margin-bottom: 0; }
[data-book-shelves] .shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
[data-book-shelves] .shelf-head-copy { display: flex; flex-direction: column; gap: 0; min-width: 0; }
[data-book-shelves] .shelf-head h3 { font-family: var(--serif-fa); font-weight: 600; font-size: 21px; margin: 0; letter-spacing: -0.3px; color: var(--ink); }
[dir="ltr"] [data-book-shelves] .shelf-head h3 { font-family: var(--serif); }
[data-book-shelves] .shelf-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.row-shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 154px;
  gap: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  margin: 0;
  scrollbar-width: none;
}
.row-shelf::-webkit-scrollbar { display: none; }

/* Rail arrows */
.row-wrap { position: relative; padding: 0 64px; }
.row-arrow {
  position: absolute; top: 0; bottom: 70px;
  display: flex; align-items: center; justify-content: center;
  z-index: 4; width: 56px;
  transition: opacity 0.2s;
}
.row-arrow.prev { left: 0; }
.row-arrow.next { right: 0; }
[dir="rtl"] .row-arrow.prev { left: auto; right: 0; }
[dir="rtl"] .row-arrow.next { right: auto; left: 0; }
.row-arrow button {
  width: 44px; height: 44px; border-radius: 999px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(20, 16, 30, 0.18), 0 2px 4px rgba(20, 16, 30, 0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.15s, color 0.15s;
  font: inherit;
}
.row-arrow button:hover { background: var(--ink); color: #fff; transform: scale(1.06); }
.row-arrow.hide { opacity: 0; pointer-events: none; }
[dir="rtl"] .row-arrow svg { transform: scaleX(-1); }
@media (max-width: 720px) {
  .row-wrap { padding: 0; }
  .row-arrow { display: none; }
}

.book-card { display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; cursor: pointer; text-decoration: none; }
.book-card .cover-wrap {
  position: relative; aspect-ratio: 5 / 8; border-radius: 6px; overflow: hidden;
  background: var(--paper-2);
  box-shadow: 0 8px 16px rgba(30, 20, 40, 0.12), 0 2px 4px rgba(30, 20, 40, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-card:hover .cover-wrap { transform: translateY(-4px); box-shadow: 0 16px 28px rgba(30, 20, 40, 0.20); }
.book-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card .ttl { font-family: var(--serif-fa); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); margin: 0; }
.book-card:hover .ttl { color: var(--accent); }
.book-card .auth { font-size: 12px; color: var(--ink-3); margin: 0; }

/* Fallback cover when a book has no image. */
.cover-wrap--fallback { display: flex; align-items: center; justify-content: center; }
.cover-wrap--fallback .cover-initial { font-family: var(--serif-fa); font-size: 40px; font-weight: 500; color: #fff; opacity: 0.92; }
.cover-wrap--fallback[data-cover="0"] { background: linear-gradient(150deg, #b97b2e, #8a5418); }
.cover-wrap--fallback[data-cover="1"] { background: linear-gradient(150deg, #ba3885, #7c2057); }
.cover-wrap--fallback[data-cover="2"] { background: linear-gradient(150deg, #3f7c8a, #234c58); }
.cover-wrap--fallback[data-cover="3"] { background: linear-gradient(150deg, #6a5acd, #3f2f9c); }
.cover-wrap--fallback[data-cover="4"] { background: linear-gradient(150deg, #2e8b57, #1c5c39); }
.cover-wrap--fallback[data-cover="5"] { background: linear-gradient(150deg, #c0563e, #8a3320); }
