/* ============================================================
   books.css — Griglia libri, card, stati vuoti
   ============================================================ */

/* ── Griglia libri ─────────────────────────────────────────── */
.book-grid {
  flex: 1; /* occupa tutto lo spazio tra le frecce */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

/* ── Card libro ────────────────────────────────────────────── */
.book-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer; overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.book-card:hover { border-color: var(--forest); transform: translateY(-4px); }

/* Copertina con aspect-ratio 2:3 */
.book-cover-wrap { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--bg-input); }
.book-cover      { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.book-card:hover .book-cover { transform: scale(1.04); }

/* Immagine: nessun libro*/
.empty-img {
  width: 280px; height: auto;
  margin-bottom: 1rem;
  opacity: .85;
  filter: drop-shadow(0 4px 8px rgba(105,114,84,.15));
}

/* Info testuali */
.book-info   { padding: .9rem; }
.book-title  {
  font-size: .92rem; font-weight: 700; line-height: 1.3; margin-bottom: .25rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-clamp: 2;
}
.book-author { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-stars  { font-size: .85rem; color: var(--accent); letter-spacing: -1px; margin-top: .3rem; }

/* Badge sezione nei risultati ricerca globale */
.book-search-badge { font-size: .7rem; font-weight: 500; color: var(--text-muted); margin: 3px 0 0; }

/* ── Stato griglia vuota ───────────────────────────────────── */
.empty-state { grid-column: 1/-1; text-align: center; padding: 2.5rem 2rem; color: var(--text-muted); }
.empty-icon  { font-size: 4rem; margin-bottom: 1rem; }

/* ── Bottone "Sposta" nella scheda libro ───────────────────── */
.btn-move {
  font-family: var(--font-body); font-size: .83rem;
  padding: 7px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.btn-move:hover { border-color: var(--moss); color: var(--moss); }

/* ── Drag & drop card ──────────────────────────────────── */
.book-card[draggable] { cursor: grab; }
.book-card[draggable]:active { cursor: grabbing; }
.book-card.dragging {
  opacity: .4;
  transform: scale(.97);
}
.book-card.drag-over {
  border-color: var(--forest);
  box-shadow: 0 0 0 2px var(--forest);
  transform: translateY(-4px);
}

/* ── Animazione cambio scaffale ────────────────────────────── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.book-grid--slide-right { animation: slideInRight .25s ease both; }
.book-grid--slide-left  { animation: slideInLeft  .25s ease both; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
  }
  .book-info   { padding: .4rem; }
  .book-title  { font-size: .72rem; }
  .book-author { font-size: .65rem; }
  .book-stars  { font-size: .7rem; }

  /* Nascondi frecce laterali su mobile */
  .carousel-arrow--side { display: none; }

  /* Stato vuoto più compatto: evita scroll inutile quando non c'è nulla da mostrare */
  .empty-state { padding: 1.5rem 1rem; }
  .empty-img   { width: 160px; margin-bottom: .5rem; }
}