.tag-term-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.tag-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tag-section-title {
  font-family: 'Roboto Slab', serif;
  font-size: 24px;
  font-weight: 700;
  color: #1F2937;
  margin: 2rem 0 1rem;
}

.tag-title {
  font-family: 'Roboto Slab', serif;
  font-size: 34px;
  font-weight: 800;
  color: #1F2937;
  margin: 0 0 0.5rem;
}

.tag-description {
  max-width: 720px;
  margin: 0 auto;
  color: #4B5563;
  font-size: 16px;
  line-height: 1.6;
}

.tagged-books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.tagged-book-card {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: grid;
  grid-template-columns: 140px 1fr;
  height: 200px;
  gap: 0;
}

.tagged-book-cover {
  position: relative;
  display: block;
  background: #F3F4F6;
}

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

.tagged-book-rating {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #FFD700;
  color: #1F2937;
  font-weight: 700;
  font-size: 13px;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.tagged-book-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tagged-book-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.tagged-book-title a {
  color: #1F2937;
  text-decoration: none;
}

.tagged-book-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 13px;
  color: #4B5563;
}

.tagged-book-desc {
  margin: 0;
  color: #4B5563;
  font-size: 13px;
  line-height: 1.5;
  max-height: 60px;
  overflow-y: auto;
}

.tagged-book-desc::-webkit-scrollbar {
  width: 6px;
}
.tagged-book-desc::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.tagged-book-desc::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.tagged-book-desc::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.tagged-excerpt {
  margin: 0;
  color: #4B5563;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tagged-meta-line {
  margin: 0;
  font-size: 13px;
  color: #4B5563;
}

.tag-empty {
  text-align: center;
  color: #6B7280;
  font-size: 16px;
  margin: 2rem 0 0;
}

@media (max-width: 960px) {
  .tagged-books-grid {
    grid-template-columns: 1fr;
  }

  .tagged-book-card {
    grid-template-columns: 1fr;
  }

  .tagged-book-cover img {
    height: 220px;
  }
}

@media (max-width: 640px) {
  .tag-title {
    font-size: 26px;
  }

  .tagged-grid {
    grid-template-columns: 1fr;
  }

  .tagged-image img {
    height: 200px;
  }
}

/* Pagination Styles */
.tag-term-page .pager {
  margin: 3rem auto 1rem;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-term-page .pager__item {
  display: inline-block;
}

.tag-term-page .pager__item a,
.tag-term-page .pager__item--current {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.tag-term-page .pager__item a {
  background: #ffffff;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.tag-term-page .pager__item a:hover {
  background: #f3f4f6;
  color: #1f2937;
  border-color: #9ca3af;
}

.tag-term-page .pager__item--current {
  background: #7c3aed;
  color: #ffffff;
  border: 1px solid #7c3aed;
}

.tag-term-page .pager__item--first a,
.tag-term-page .pager__item--previous a,
.tag-term-page .pager__item--next a,
.tag-term-page .pager__item--last a {
  font-weight: 500;
  color: #7c3aed;
  border-color: #e5e7eb;
}

.tag-term-page .pager__item--first a:hover,
.tag-term-page .pager__item--previous a:hover,
.tag-term-page .pager__item--next a:hover,
.tag-term-page .pager__item--last a:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}
