/* ══════════════════════════════════════════════════
   Books grid
══════════════════════════════════════════════════ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 12px;
}
.books-list { display: flex; flex-direction: column; gap: 8px; }

/* Card */
.book-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: transform .2s, box-shadow .2s; position: relative;
  animation: cardIn .3s ease both;
}
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-card:active { transform: scale(.97); }
@keyframes cardIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; } }

.card-cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: var(--bg2); }
.card-no-cover {
  width: 100%; aspect-ratio: 2/3;
  background: linear-gradient(160deg, var(--bg2), var(--bg3));
  display: flex; align-items: center; justify-content: center;
  padding: 10px 8px; text-align: center; overflow: hidden;
}
.card-no-cover svg { display: none; }
.card-no-cover .nc-title {
  font-size: .7rem; font-weight: 600; line-height: 1.25; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.card-leido-dot {
  position: absolute; top: 7px; right: 7px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .58rem;
}
.dot-leido   { background: var(--leido); color: #fff; }
.dot-noleido { background: rgba(255,255,255,.88); border: 1px solid var(--border); color: var(--muted); }

.card-body { padding: 9px 9px 11px; }
.card-title {
  font-family: 'Nunito', sans-serif;
  font-size: .9rem; font-weight: 500; line-height: 1.3; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-autor { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.card-tag {
  font-size: .62rem; padding: 2px 6px; border-radius: 10px;
  background: var(--bg2); color: var(--muted); border: 1px solid var(--border);
}

/* List row */
.book-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); display: flex; align-items: stretch;
  gap: 11px; padding: 0 12px 0 0; cursor: pointer; overflow: hidden;
  position: relative;
  transition: border-color .15s, box-shadow .15s; animation: cardIn .2s ease both;
}
.book-row:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.book-row:active { background: var(--bg2); }
.row-cover {
  width: 42px; height: 63px; border-radius: 0;
  object-fit: cover; background: var(--bg2); flex-shrink: 0; align-self: stretch;
}
.row-no-cover {
  width: 42px; height: 63px; border-radius: 0; align-self: stretch;
  background: linear-gradient(160deg, var(--bg2), var(--bg3));
  flex-shrink: 0; padding: 3px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.row-no-cover svg { display: none; }
.row-no-cover .nc-title {
  font-size: .46rem; font-weight: 600; line-height: 1.15; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow: hidden; text-align: center; word-break: break-word;
}
.row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.row-title {
  font-family: 'Nunito', sans-serif;
  font-size: .96rem; font-weight: 500; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.row-meta span + span::before { content: ' · '; }
.row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row-leido { font-size: .71rem; padding: 3px 8px; border-radius: 10px; }
.leido-badge   { background: var(--leido-bg); color: var(--leido); }
.noleido-badge { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); }

/* State */
.state-box { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--muted); }
.state-box h3 { font-family: 'Nunito', sans-serif; font-size: 1.4rem; color: var(--ink); margin-bottom: 8px; }
.spinner {
  width: 28px; height: 28px; margin: 0 auto 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink2);
  font-size: .82rem; cursor: pointer; transition: all .15s; touch-action: manipulation;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
