/* ============================================
   Bookshelf Theme - Book Card & Shelf Styles
   ============================================ */

/* --- Shelf Section --- */
.shelf-section {
  margin-bottom: 2rem;
}

.shelf-section .section-title {
  font-size: 1.35rem;
  color: var(--text-dark);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--shelf-wood);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shelf-section .section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.35rem;
  background-color: var(--accent-gold);
  border-radius: 2px;
}

/* --- Book Card --- */
.book-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(62, 39, 35, 0.15);
}

/* Book Cover */
.book-card .book-cover-wrap {
  position: relative;
  padding-top: 140%;
  background-color: var(--bg-warm);
  overflow: hidden;
}

.book-card .book-cover-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.book-card:hover .book-cover-wrap img {
  transform: scale(1.05);
}

/* Spine effect on hover */
.book-card .book-cover-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,0,0,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.book-card:hover .book-cover-wrap::after {
  opacity: 1;
}

/* Book Info */
.book-card .book-info {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card .book-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card .book-title a {
  color: inherit;
  transition: color var(--transition-speed);
}

.book-card .book-title a:hover {
  color: var(--shelf-wood);
}

.book-card .book-author {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.book-card .book-intro {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.book-card .book-actions {
  padding: 0 0.75rem 0.75rem;
}

.book-card .book-actions .btn {
  width: 100%;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
}

/* --- Shelf Row (Wooden Shelf Effect) --- */
.shelf-row {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.shelf-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 14px;
  background: linear-gradient(180deg, var(--shelf-wood-light), var(--shelf-wood), var(--shelf-wood-dark));
  border-radius: 0 0 3px 3px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.shelf-row::before {
  content: '';
  position: absolute;
  bottom: 14px;
  left: -5%;
  width: 110%;
  height: 4px;
  background: var(--shelf-shadow);
  border-radius: 0 0 2px 2px;
}

/* --- Book Grid --- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .listing-grid .book-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: stretch;
  }

  .listing-grid .book-card .book-cover-wrap {
    grid-row: 1 / span 2;
    padding-top: 0;
    height: 144px;
  }

  .listing-grid .book-card .book-info {
    padding: 0.8rem 0.8rem 0.45rem;
  }

  .listing-grid .book-card .book-intro {
    -webkit-line-clamp: 3;
  }

  .listing-grid .book-card .book-actions {
    padding: 0 0.8rem 0.8rem;
  }
}

@media (max-width: 991.98px) {
  .book-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 767.98px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .listing-grid .book-card .book-cover-wrap {
    padding-top: 118%;
  }

  .listing-grid .book-card .book-info {
    padding: 0.6rem;
  }

  .listing-grid .book-card .book-title {
    font-size: 0.88rem;
  }

  .listing-grid .book-card .book-author {
    font-size: 0.76rem;
    margin-bottom: 0.2rem;
  }

  .listing-grid .book-card .book-intro {
    display: none;
  }

  .listing-grid .book-card .book-actions {
    padding: 0 0.6rem 0.6rem;
  }

  .listing-grid .book-card .book-actions .btn {
    font-size: 0.76rem;
    padding: 0.28rem 0.4rem;
  }
}

/* --- Detail Page - Cover Section --- */
.detail-cover-section {
  background: linear-gradient(135deg, var(--shelf-wood-dark), var(--shelf-wood));
  border-radius: var(--border-radius);
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
}

.detail-cover-section .detail-cover-img {
  width: 100%;
  max-width: 220px;
  border-radius: 4px;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.detail-cover-section .detail-book-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.detail-cover-section .detail-book-author {
  font-size: 1rem;
  color: var(--accent-gold-light);
  margin-bottom: 0.75rem;
}

.detail-cover-section .detail-book-meta {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1rem;
}

.detail-cover-section .detail-book-intro {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

/* --- Chapter List --- */
.chapter-list-section {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chapter-list-section .section-heading {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-list li {
  border-bottom: 1px solid rgba(215, 196, 167, 0.5);
}

.chapter-list li:last-child {
  border-bottom: none;
}

.chapter-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.5rem;
  font-size: 0.9rem;
  color: var(--text-body);
  transition: all var(--transition-speed);
  border-radius: 4px;
}

.chapter-list li a:hover {
  background-color: var(--bg-warm);
  color: var(--shelf-wood);
  padding-left: 0.85rem;
}

.chapter-list li a .chapter-index {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: right;
}

/* --- Recommended Books --- */
.recommended-section {
  margin-bottom: 1.5rem;
}

.recommended-section .section-heading {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--shelf-wood);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommended-section .section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.15rem;
  background-color: var(--accent-gold);
  border-radius: 2px;
}

.recommended-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.recommended-grid .book-card .book-cover-wrap {
  padding-top: 118%;
}

@media (max-width: 991.98px) {
  .recommended-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767.98px) {
  .recommended-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Search Results --- */
.search-result-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  transition: box-shadow var(--transition-speed);
}

.search-result-card:hover {
  box-shadow: 0 4px 12px rgba(62, 39, 35, 0.12);
}

.search-result-card .result-cover {
  width: 80px;
  min-width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
}

.search-result-card .result-info {
  flex: 1;
}

.search-result-card .result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.search-result-card .result-title a {
  color: inherit;
}

.search-result-card .result-title a:hover {
  color: var(--shelf-wood);
}

.search-result-card .result-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.search-result-card .result-intro {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: 1.1rem;
}

/* --- Load More Button --- */
.load-more-wrap {
  text-align: center;
  padding: 1rem 0;
}

/* --- Static Page Content --- */
.static-page-content {
  max-width: 760px;
  margin: 0 auto;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.static-page-content h2 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--card-border);
}

.static-page-content h2:first-child {
  margin-top: 0;
}

.static-page-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 0.75rem;
}

/* --- Contact Form --- */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form .form-label {
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 600;
}

.contact-form .form-control {
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.9rem;
}

.contact-form .form-control:focus {
  border-color: var(--shelf-wood);
  box-shadow: 0 0 0 0.15rem rgba(139, 94, 60, 0.2);
}
