/* Library page - aligned with main site style */
:root {
  --primary: #000000;
  --secondary: #FFD700;
  --accent: #FFD9009D;
  --dark-yellow: #E9CF3A;
  --text: #FFFFFF;
  --radius: 14px;
  --max-width: 1440px;
  --transition: all 0.3s ease;
  --font: 'MyCustomFont', sans-serif;
  --Topic-size: 1.3rem;
}

.library-page {
  background: var(--primary);
  color: var(--text);
  min-height: 100vh;
  font-family: var(--font);
}

.site-header {
  display: none;
}

.library-hero {
  padding: 140px 0 60px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 215, 0, 0.12), transparent 42%),
    radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.08), transparent 45%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.eyebrow {
  color: var(--secondary);
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.library-hero h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  margin: 0 0 12px;
  color: var(--secondary);
}

.library-hero .lead {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px;
  gap: 16px;
  align-items: end;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.search-field input {
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: var(--transition);
}

.search-field input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
}

.stat {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.stat p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
}

.stat strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 2rem;
  color: var(--secondary);
}

#booksCount svg {
  fill: var(--secondary);
  width: 26px;
  height: 22px;
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.hero-card ul {
  margin: 10px 0 0;
  padding-right: 18px;
  color: rgba(255, 255, 255, 0.7);
}

.library-grid-section {
  padding: 40px 0 90px;
}

.slider-section {
  padding: 30px 0 10px;
  text-align: center;
}

.slider-section .title {
  margin-bottom: 20px;
  color: var(--secondary);
}

.categorySwiper {
  width: 92%;
  max-width: 1400px;
  height: 300px;
  padding: 20px;
  margin: 0 auto 30px;
}

.category-slide {
  border: none;
  width: 200px;
  height: 280px;
  border-radius: 22px;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  color: #fff;
  font-family: inherit;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  border: 3px solid rgb(25, 25, 25);
}

.category-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.75));
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 22px;
}

.category-slide:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 45px rgba(0, 0, 0, 0.55);
}

.category-slide:hover::after {
  opacity: 1;
}

.category-slide-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.category-slide-content p {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.category-slide-content span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.categorySwiper .swiper-button-next,
.categorySwiper .swiper-button-prev {
  color: var(--secondary);
}

.categorySwiper .swiper-button-next::after,
.categorySwiper .swiper-button-prev::after {
  background: var(--primary);
  color: var(--secondary);
  padding: 16px;
  border-radius: 14px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #FFD700;
  text-align: center;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}

.book-card {
  background: rgba(0, 0, 0, 1);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.4);
}

.book-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.06);
}

.card-media img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-body {
  padding: 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-body > :not(.book-actions) {
  padding-right: 16px;
}
.book-actions {
  padding: 0 6px 6px;
}

.book-date {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.card-body h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--secondary);
}

.card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.book-author {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.book-subject {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}
.book-subject a {
  color: var(--secondary) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

@media (max-width: 600px) {
  .library-page .hero-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .library-page .hero-card {
    margin-top: 8px;
  }
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .book-card {
    padding: 0.75rem;
  }
  .card-media img {
    aspect-ratio: 3 / 4;
  }
}

.book-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.book-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.book-card a {
  text-decoration: none;
  color: inherit;
}
.book-actions .btn-ghost,
.book-actions .btn-primary {
  white-space: nowrap;
  font-size: 0.9rem;
}
.book-actions .btn-primary {
  color: #000 !important;
}

.btn-primary {
  background: var(--secondary);
  color: #000;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
}

.btn-primary:hover {
  background: transparent;
  color: var(--secondary);
  border-color: var(--secondary);
}

.btn-ghost {
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.btn-ghost:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.empty-library {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.02);
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.8);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  margin-right: 12px;
  text-decoration: none;
}

.book-hero {
  padding: 140px 0 60px;
}

.book-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.book-hero-cover img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.book-hero-content h1 {
  margin-top: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--secondary);
}

.book-hero-desc {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  white-space: pre-line;
}

.book-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.reader-section {
  padding-bottom: 80px;
}

.reader-section .container {
  max-width: 100%;
  padding: 0 16px;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}

.reader-header a {
  color: var(--secondary);
  text-decoration: none;
}

.book-reader {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
  min-height: 70vh;
}

.book-reader iframe,
.book-reader object,
.book-reader embed {
  width: 100%;
  height: 80vh;
  border: none;
  display: block;
}

@media (max-width: 900px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .categorySwiper {
    width: 100%;
    padding: 12px;
  }

  .category-slide {
    width: auto;
    height: 240px;
  }

  .library-hero {
    padding: 120px 0 40px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .book-reader iframe,
  .book-reader object,
  .book-reader embed {
    height: 70vh;
  }
}
