/* ==========================================================================
   GURUKULA DESAM — DEDICATED DIGITAL LIBRARY SUBSITE (e-Book Architecture)
   - Completely standalone, clean, distraction-free reading portal
   - No body background leaks, pure focus on books & stories
   - 2 Large high-definition illustrations per story integrated into reading pages
   - Dedicated library header with book drawer, search, and reading settings
   ========================================================================== */

/* Standalone Subsite Body */
body.library-subsite {
  margin: 0;
  padding: 0;
  background: #0f141f !important;
  background-image: linear-gradient(180deg, #0b0f17 0%, #111726 100%) !important;
  color: #1e293b;
  font-family: 'Outfit', 'Mukta Malar', sans-serif;
  min-height: 100vh;
}

/* Dedicated Subsite Navigation Header */
.library-subsite-header {
  background: rgba(11, 17, 30, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.library-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.library-brand-badge {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(180, 83, 9, 0.2));
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  padding: 8px 14px;
  color: #ffd700;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-subsite-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.library-subsite-subtitle {
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Subsite Action Controls */
.library-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.library-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.library-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.library-btn-gold {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
  border: 1px solid #f59e0b !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}
.library-btn-gold:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Subsite Reading Wrap */
.library-reading-container {
  max-width: 980px;
  margin: 30px auto 80px;
  padding: 0 20px;
}

/* TOP CHAPTER SELECT BAR */
.story-chapter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(18, 25, 40, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 14px 22px;
  margin-bottom: 26px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.story-select-dropdown {
  background: #070b14;
  color: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.96rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  max-width: 480px;
}

/* THE AUTHENTIC OPEN BOOK SPREAD */
.authentic-book-spread {
  background: #fdfbf7 !important;
  color: #1a1a1a !important;
  border-radius: 18px !important;
  padding: 56px 64px !important;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0,0,0,0.4) !important;
  border: 1px solid #e2d9c8 !important;
  position: relative;
  min-height: 540px;
}

@media (max-width: 768px) {
  .authentic-book-spread {
    padding: 32px 22px !important;
  }
}

.book-inner-header {
  border-bottom: 1.5px solid #ded4c1;
  padding-bottom: 16px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.book-inner-header .book-title-sub {
  font-size: 0.92rem;
  color: #786c57;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.book-inner-header .book-page-counter {
  font-size: 0.96rem;
  color: #b45309;
  font-weight: 800;
}

.book-chapter-heading {
  font-size: 2.3rem !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
  color: #1c1917 !important;
  margin: 0 0 14px 0 !important;
  font-family: 'Mukta Malar', Georgia, serif !important;
}

.book-chapter-synopsis {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #6c5a3d;
  font-style: italic;
  margin: 0 0 32px 0;
  padding-bottom: 22px;
  border-bottom: 1px dashed #e2d9c8;
}

/* 2 BEAUTIFUL STORY ILLUSTRATIONS */
.story-illustration-frame {
  margin: 28px 0 34px 0;
  text-align: center;
}

.story-illustration-frame img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  border: 1px solid #dcd4c3;
  display: block;
}

.story-illustration-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: #786c57;
  font-weight: 600;
  font-style: italic;
  display: inline-block;
}

/* Story Typography */
.book-story-content p {
  font-family: 'Mukta Malar', Georgia, serif !important;
  font-size: 1.36rem !important;
  line-height: 2.3 !important;
  color: #26211c !important;
  margin-bottom: 26px !important;
  text-indent: 2rem !important;
  letter-spacing: 0.01em !important;
}

/* Page Dots */
.book-page-dots-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid #ded4c1;
}

.book-page-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.book-page-dot.active {
  width: 32px;
  border-radius: 6px;
  background: #b45309;
}

/* Page Turn Buttons */
.book-turn-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.book-turn-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.book-turn-btn:hover {
  background: #334155;
  transform: translateY(-1px);
}

.book-turn-btn-next {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
  border: 1px solid #f59e0b !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}
.book-turn-btn-next:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* SUBSITE 24-BOOK DRAWER */
.books-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.books-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.books-sliding-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 380px;
  max-width: 85vw;
  height: 100vh;
  background: #0d131f;
  border-right: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.books-drawer-overlay.open .books-sliding-drawer {
  transform: translateX(0);
}

.books-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.books-drawer-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
