/* ==========================================================================
   📜 UGC NET PAPER ONE — PAGE STYLES (pages.css)
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════
   📖 HOMEPAGE: 3D Physical Book Cover
   ══════════════════════════════════════════════════════════════════ */
.book-cover-container {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Allow scroll if book is taller than screen on small devices */
  min-height: 100vh;
  min-height: 100svh; /* mobile browser toolbar-aware */
  width: 100%;
  padding: 3rem 1.5rem;
  background-color: #1a0f08;
  background-image:
    radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.85) 100%),
    linear-gradient(90deg, transparent 96%, rgba(0,0,0,0.3) 96%),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, #2c1a0e 0%, #1e1109 100%);
  background-size: 100% 100%, 150px 100%, 100% 20px, 100% 100%;
  position: relative;
  /* NO overflow:hidden — it was cutting off top and bottom of the book! */
}


.book-cover-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: radial-gradient(ellipse at top, rgba(245, 240, 225, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.book-wrapper-3d {
  position: relative;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  z-index: 2;
}

.book-wrapper-3d:hover {
  transform: rotateY(-3deg) rotateX(2deg) translateY(-5px);
}

.book-cover {
  width: min(460px, 92vw);
  min-height: 600px;
  background: radial-gradient(circle at 70% 30%, #4a0d0d 0%, #290505 100%);
  color: #f5f0e1;
  padding: 3rem 2.5rem 3rem 3.5rem;
  position: relative;
  border-radius: 4px 12px 12px 4px;
  box-shadow:
    -10px 10px 0 rgba(0, 0, 0, 0.4),
    -20px 25px 50px rgba(0,0,0,0.7),
    inset -2px 0 10px rgba(0,0,0,0.4),
    inset 2px 0 10px rgba(255,255,255,0.1);
  text-align: center;
  border: 1px solid #1a0202;
  z-index: 5;
}

/* Page stack underneath */
.book-pages-stack {
  position: absolute;
  top: 8px; bottom: 8px;
  left: 30px; right: -12px;
  background-color: #e8dcc8;
  background-image:
    repeating-linear-gradient(rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 1px, transparent 1px, transparent 3px),
    linear-gradient(90deg, #d4c5ab 0%, #f4eae1 5%, #c0b298 95%, #9a8c72 100%);
  border-radius: 0 8px 8px 0;
  box-shadow: -5px 5px 15px rgba(0,0,0,0.5), 5px 5px 10px rgba(0,0,0,0.3);
  z-index: 2;
  pointer-events: none;
}

/* Spine */
.book-cover::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 28px;
  background: linear-gradient(90deg, #1b0202 0%, #3a0808 60%, #150101 80%, #5c1111 90%, #220303 100%);
  border-radius: 4px 0 0 4px;
  box-shadow: inset -5px 0 10px rgba(0,0,0,0.5);
  border-right: 2px solid rgba(0,0,0,0.4);
}

/* Corner ornaments */
.corner-ornament {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 2px solid #b8860b;
  pointer-events: none;
  z-index: 10;
}

.corner-top-left    { top: 15px; left: 42px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.corner-top-right   { top: 15px; right: 15px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.corner-bottom-left { bottom: 15px; left: 42px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.corner-bottom-right{ bottom: 15px; right: 15px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.corner-ornament::after {
  content: "✦";
  position: absolute;
  color: #d4af37;
  font-size: 0.75rem;
}
.corner-top-left::after    { top: -2px; left: -2px; }
.corner-top-right::after   { top: -2px; right: -2px; }
.corner-bottom-left::after { bottom: -2px; left: -2px; }
.corner-bottom-right::after{ bottom: -2px; right: -2px; }

.book-cover-border {
  position: absolute;
  top: 25px; bottom: 25px;
  left: 52px; right: 20px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  pointer-events: none;
}

.book-cover-border::after {
  content: "";
  position: absolute;
  top: 4px; bottom: 4px;
  left: 4px; right: 4px;
  border: 1px dashed rgba(212, 175, 55, 0.2);
}

.cover-header { margin-top: 0.5rem; margin-bottom: 1.5rem; }

.cover-badge {
  font-family: var(--font-serif-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #d4af37;
  display: block;
  margin-bottom: 0.7rem;
}

.cover-title {
  font-family: var(--font-serif-display);
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  line-height: 1.1;
  color: #faf7f0;
  text-shadow:
    0px 2px 0px #b8860b,
    0px 4px 10px rgba(0,0,0,0.8),
    0px 0px 15px rgba(212,175,55,0.3);
  margin-bottom: 0.5rem;
  font-weight: normal;
}

.cover-subtitle {
  font-family: var(--font-serif-display);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  font-style: italic;
  color: #cbbba6;
  margin-top: 0.7rem;
  letter-spacing: 1px;
}

.cover-crest {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0;
}

.cover-btn {
  display: inline-block;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #d4af37 0%, #aa8010 100%);
  color: #2b0000;
  font-family: var(--font-serif-display);
  font-weight: 800;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 0.9rem 2.2rem;
  border: 1px solid #d4af37;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  border-right: 3px solid #7c5d0a;
  border-bottom: 3px solid #664c05;
  /* good touch target */
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.cover-btn:hover {
  background: linear-gradient(135deg, #faf7f0 0%, #d4af37 100%);
  color: #1a0202;
  box-shadow: 0 8px 25px rgba(212,175,55,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
  transform: translateY(-3px) scale(1.03);
  border-bottom-color: transparent;
}

.cover-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.cover-author {
  font-family: var(--font-serif-display);
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #d4af37;
  margin-top: 1.2rem;
}

.cover-publisher {
  font-size: 0.78rem;
  color: #cbbba6;
  margin-top: 0.4rem;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════
   📖 SYLLABUS / TABLE OF CONTENTS PAGE
   ══════════════════════════════════════════════════════════════════ */
.toc-list-large {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5rem;
}

.toc-item-large {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.9rem;
  font-size: 1.1rem;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  transition: background-color var(--transition-speed) ease;
}

.toc-item-large:hover {
  background-color: rgba(184, 134, 11, 0.05);
}

.toc-item-large a {
  font-family: var(--font-serif-display);
  font-weight: bold;
  color: var(--ink);
  border-bottom: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.toc-item-large a:hover { color: var(--accent-crimson); background-color: transparent; }

.toc-item-large .chapter-num {
  font-family: var(--font-serif-display);
  font-weight: 700;
  color: var(--accent-crimson);
  font-size: 1.1rem;
  width: 44px;
  display: inline-block;
  flex-shrink: 0;
}

.toc-dots {
  flex-grow: 1;
  border-bottom: 1px dotted var(--ink-light);
  margin: 0 0.75rem;
  position: relative;
  bottom: 4px;
  min-width: 20px;
}

.toc-page-num {
  font-family: var(--font-serif-display);
  font-weight: bold;
  color: var(--accent-gold);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.toc-sub-list {
  list-style: none;
  padding-left: 3.5rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.toc-sub-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--ink-light);
}

.toc-sub-item a {
  color: inherit;
  border-bottom: none;
}

.toc-sub-item a:hover {
  color: var(--accent-crimson);
}

.toc-sub-item .toc-dots {
  border-bottom: 1px dotted rgba(184, 134, 11, 0.3);
}

/* ══════════════════════════════════════════════════════════════════
   📊 SYLLABUS OVERVIEW GRID
   ══════════════════════════════════════════════════════════════════ */
.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.syllabus-card {
  background-color: var(--parchment-dark);
  border: var(--border-gold);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-speed) ease;
}

.syllabus-card:hover {
  box-shadow: var(--shadow-deep);
  transform: translateY(-2px);
}

.syllabus-card h3 {
  margin-top: 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(184, 134, 11, 0.3);
  padding-bottom: 0.4rem;
  color: var(--accent-crimson);
  font-style: normal;
}

.syllabus-card ul {
  list-style-type: square;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.syllabus-card li { margin-bottom: 0.3rem; }

/* ══════════════════════════════════════════════════════════════════
   📱 RESPONSIVE PAGE RULES
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Book cover: flat card on mobile */
  .book-wrapper-3d { transform: none !important; }
  .book-pages-stack { display: none; }

  .book-cover {
    width: 100%;
    min-height: auto;
    border-radius: 8px;
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  }

  .book-cover::before { display: none; /* no spine on mobile */ }

  .corner-ornament { display: none; }
  .book-cover-border { display: none; }

  .cover-title { letter-spacing: 0; }

  .cover-crest svg { width: 90px; height: 90px; }

  /* TOC items: stack on mobile */
  .toc-item-large {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    font-size: 1rem;
  }

  .toc-dots { display: none; }

  .toc-page-num { font-size: 0.8rem; color: var(--ink-light); }

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