/* ===================================================================
   bookspice · shelf.html (Kindle-style bookshelf view)
   Design: paper-aged wood shelves with cover spines lined up like
   real books on a shelf. Brand-aligned (cream + spice + sage).
   =================================================================== */

.shelf-header {
  background:
    linear-gradient(180deg, rgba(201, 149, 60, 0.05) 0%, transparent 100%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 32px 24px 22px;
}
.shelf-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.shelf-header-text { flex: 1; min-width: 280px; }
.shelf-eyebrow {
  font-family: var(--sans);
  color: var(--spice);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.shelf-header h1 {
  font-family: var(--serif);
  font-size: 38px;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.1;
}
.shelf-eyebrow-mini {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.5px;
  text-transform: none;
  margin-left: 8px;
}
.shelf-sub {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0;
}
.shelf-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* summary chips bar */
.shelf-summary {
  max-width: 1280px;
  margin: 18px auto 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.summary-chip {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 16px 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  box-shadow: var(--shadow-sm);
}
.summary-chip strong {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

/* ============= SHELVES CONTAINER ============= */
.shelves {
  max-width: 1280px;
  margin: 32px auto 60px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 44px;     /* generous breathing room between shelves */
}

/* one shelf unit */
.shelf {
  position: relative;
}
/* shelf head (label + count + jump link) */
.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.shelf-head-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.shelf-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.shelf-title .shelf-emoji {
  font-size: 24px;
  filter: drop-shadow(0 1px 1px rgba(94,48,35,.18));
}
.shelf-count {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}
.shelf-count strong {
  color: var(--spice);
  font-family: var(--serif);
  font-size: 16px;
  margin-right: 2px;
}
.shelf-head-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.shelf-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.shelf-nav-btn:hover { background: var(--bg-2); color: var(--ink-2); border-color: var(--line-2); }
.shelf-nav-btn:disabled { opacity: .35; cursor: not-allowed; }

/* horizontal scroll track */
.shelf-track {
  display: flex;
  gap: 0;            /* covers touch each other = real shelf feel */
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  padding: 6px 4px 18px;
  margin: 0 -4px;    /* cancel padding visual edge clipping */
}
.shelf-track::-webkit-scrollbar { height: 8px; }
.shelf-track::-webkit-scrollbar-track { background: transparent; }
.shelf-track::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
}

/* each book on the shelf — like a real book standing upright */
.shelf-book {
  position: relative;
  flex: 0 0 auto;
  width: 110px;
  margin-left: -8px;       /* overlap spines like real books */
  transition: transform .25s ease, z-index 0s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  z-index: 1;
}
.shelf-book:first-child { margin-left: 0; }

.shelf-book .cover-wrap {
  position: relative;
  width: 110px;
  height: 158px;
  border-radius: 3px 6px 6px 3px;     /* spine (left) thinner, cover (right) thicker */
  overflow: hidden;
  box-shadow:
    -3px 0 0 var(--bg-3),             /* spine edge highlight */
    -4px 0 0 var(--line-2),           /* spine groove */
    4px 4px 12px rgba(94, 48, 35, 0.22),   /* drop shadow on shelf */
    0 1px 3px rgba(94, 48, 35, 0.18);
  background: var(--bg-2);
}
.shelf-book .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.shelf-book .cover-wrap .book-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: linear-gradient(135deg, var(--spice), var(--spice-2));
  color: #fff;
}

/* hover lift + bring to front */
.shelf-book:hover {
  transform: translateY(-10px);
  z-index: 5;
}
.shelf-book:hover .cover-wrap {
  box-shadow:
    -3px 0 0 var(--bg-3),
    -4px 0 0 var(--spice),
    8px 10px 24px rgba(94, 48, 35, 0.35),
    0 2px 4px rgba(94, 48, 35, 0.25);
}
.shelf-book:hover .cover-wrap img {
  transform: scale(1.03);
}

/* status badge on cover (top-left corner like a sticker) */
.shelf-status-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  letter-spacing: .3px;
  z-index: 2;
  pointer-events: none;
}
.shelf-status-pill.read { background: rgba(201, 100, 66, 0.85); }       /* spice */
.shelf-status-pill.reading { background: rgba(122, 140, 110, 0.9); }    /* sage */
.shelf-status-pill.tbr { background: rgba(138, 111, 86, 0.85); }        /* brown */

/* rating peppers on cover (bottom-right) */
.shelf-cover-rating {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 9px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  letter-spacing: -1px;
}

/* thin wood-grain line under each shelf */
.shelf::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: -2px;
  border-radius: 0 0 4px 4px;
  background:
    linear-gradient(180deg, var(--line-2) 0%, var(--line) 30%, transparent 100%),
    var(--bg-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 8px rgba(94, 48, 35, 0.08);
}

/* title caption under cover (small, optional — collapsed by default) */
.shelf-book-caption {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  max-width: 110px;
  line-height: 1.25;
  font-weight: 500;
  /* don't show full title on hover unless we want — show only on hover as tooltip-like */
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .2s;
}
.shelf-book:hover .shelf-book-caption {
  opacity: 1;
  max-height: 60px;
}

/* empty shelf state — "0 books" */
.shelf-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 36px 16px;
  background:
    repeating-linear-gradient(45deg,
      rgba(216, 200, 173, 0.18) 0,
      rgba(216, 200, 173, 0.18) 8px,
      transparent 8px,
      transparent 16px),
    var(--bg-3);
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  color: var(--ink-3);
  text-align: center;
  font-size: 14px;
}
.shelf-empty .empty-emoji { font-size: 32px; opacity: .5; }
.shelf-empty .empty-cta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--spice);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* ============= READING SHELF — books with progress bar ============= */
.shelf-book.reading .cover-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.shelf-book.reading .cover-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sage-2), var(--sage));
  z-index: 2;
  border-radius: 0 2px 0 0;
  box-shadow: 0 0 6px rgba(168, 184, 154, 0.6);
  transition: width .4s ease;
  pointer-events: none;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 760px) {
  .shelf-header { padding: 22px 16px 16px; }
  .shelf-header h1 { font-size: 28px; }
  .shelf-summary { padding: 0; gap: 6px; }
  .summary-chip { padding: 6px 12px 6px 10px; font-size: 12px; }
  .summary-chip strong { font-size: 15px; }
  .shelves { padding: 0 14px; gap: 32px; }
  .shelf-book { width: 84px; }
  .shelf-book .cover-wrap { width: 84px; height: 120px; }
  .shelf-book .cover-wrap .book-cover-fallback { font-size: 32px; }
  .shelf-title { font-size: 18px; }
}
