/* /bookshelf/ cover grids. Inherits the --rs- tokens from .rs (set in
   reading-stats.css, re-stepped for dark in dark.css), so the accent and
   surfaces stay in one place. */

.bookshelf { padding-bottom: 2rem; }

/* Compact currently-reading strip on /library/ (above Reading a Rainbow). */
.bs-preview {
  margin: 0 0 2.5rem;
}

.bs-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.85rem;
}

.bs-preview-head .bs-title {
  margin: 0;
  font-size: 1.65rem;
}

/* Dark orange, same as .main-content a: this CTA sits on the meadow chrome,
   not on gray .serif prose, so the site green would disappear into the ink. */
.bs-preview-more {
  font-family: var(--rs-sans);
  font-size: 0.9rem;
  color: #9e3410 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(158, 52, 16, 0.45);
  white-space: nowrap;
}

.bs-preview-more:hover {
  color: #7d280b !important;
  text-decoration-color: #7d280b;
}

.bs-preview-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 1199px) {
  .bs-preview-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bs-preview-row .bs-book:nth-child(n+7) { display: none; }
}

@media (max-width: 991px) {
  .bs-preview-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bs-preview-row .bs-book:nth-child(n+5) { display: none; }
}

@media (max-width: 575px) {
  .bs-preview-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 0.75rem; }
  .bs-preview-row .bs-book:nth-child(n+4) { display: none; }
  .bs-preview-head .bs-title { font-size: 1.4rem; }
}

.bs-shelf { margin: 0 0 2.75rem; }

.bs-title {
  font-family: var(--summary, 'Frank Ruhl Libre'), serif;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--rs-ink);
  margin: 0 0 0.3rem;
}

.bs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 1.5rem 1.15rem;
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
}

.bs-book a {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
}

/* Fixed aspect box so a shelf of mismatched cover scans still lines up. */
.bs-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--rs-track);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.bs-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bs-book a:hover .bs-cover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24), 0 0 0 1px var(--rs-s1);
}

/* Fallback when Goodreads has no cover scan. */
.bs-nocover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  color: var(--rs-ink-2);
}

.bs-stars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.4rem 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #ffd479;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 68%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Marks the books that have a long review on this site. */
.bs-flag {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  font-family: var(--rs-sans);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--rs-s1);
  color: #fff;
}

.bs-meta {
  display: block;
  margin-top: 0.45rem;
  line-height: 1.3;
}

.bs-meta strong {
  display: block;
  font-family: var(--rs-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rs-ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bs-meta em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--rs-muted);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bs-foot { margin-top: 0.5rem; }

@media (max-width: 575px) {
  .bs-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 1.15rem 0.8rem; }
  .bs-title { font-size: 1.55rem; }
}
