/* Reading Page Specific Styles */

/* Reading Header */
.reading-header {
  background: linear-gradient(135deg, var(--char) 0%, var(--stone) 100%);
  border-bottom: var(--border);
  padding: 6em 0 3em;
  text-align: center;
}

.reading-title-section h1 {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700;
  font-size: clamp(2.5em, 5vw, 3.5em);
  margin: 0 0 0.5em;
  color: var(--ink-2);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.book-subtitle {
  font-size: 1.1em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1em;
  font-weight: 600;
}

.book-tagline {
  font-size: 1.3em;
  color: var(--ink);
  margin: 0 0 2em;
  font-style: italic;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Reading Controls */
.reading-controls {
  display: flex;
  justify-content: center;
  gap: 0.75em;
  margin-top: 2em;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink);
  padding: 0.5em 0.75em;
  border-radius: 0.375em;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* Reading Content */
.reading-content {
  background: var(--char);
  min-height: 60vh;
  padding: 3em 0;
}

.book-content {
  max-width: 70ch; /* Slightly wider for easier reading */
  margin: 0 auto;
  font-size: 1.2em; /* Larger base font size */
  line-height: 1.8; /* More generous line spacing */
  color: var(--ink);
  transition: font-size 0.3s ease;
  text-align: left; /* Ensure left alignment for better readability */
  font-family: 'Georgia', 'Times New Roman', serif; /* More legible serif font */
}

/* Chapter Styling */
.chapter {
  margin-bottom: 4em;
  padding-bottom: 3em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter:last-of-type {
  border-bottom: none;
  margin-bottom: 2em;
}

.chapter-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2em;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 1.5em;
  text-align: center;
  position: relative;
}

.chapter-title::after {
  content: '';
  position: absolute;
  bottom: -0.5em;
  left: 50%;
  transform: translateX(-50%);
  width: 3em;
  height: 2px;
  background: var(--gold);
}

.chapter-content {
  text-align: left; /* Changed from justify for better readability */
  hyphens: auto;
  font-family: 'Georgia', 'Times New Roman', serif; /* More legible serif font */
}

.chapter-content p {
  margin: 0 0 1.8em; /* Increased paragraph spacing */
  text-indent: 1.2em; /* Slightly reduced indent for better flow */
}

.chapter-content p:first-child {
  text-indent: 0;
  font-size: 1.1em;
  font-weight: 500;
}

/* Sample End Section */
.sample-end {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1em;
  padding: 2.5em;
  margin-top: 3em;
  text-align: center;
}

.sample-end-content h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.8em;
  color: var(--ink-2);
  margin: 0 0 1em;
}

.sample-end-content p {
  font-size: 1.1em;
  margin: 0 0 2em;
  color: var(--ink);
}

.sample-cta {
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
}

/* Dark Mode Styles */
.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

.dark-mode .reading-content {
  background: #1a1a1a;
}

.dark-mode .book-content {
  color: #e0e0e0;
  font-family: 'Georgia', 'Times New Roman', serif; /* More legible serif font */
}

.dark-mode .chapter-title {
  color: #f0f0f0;
}

.dark-mode .sample-end {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .reading-header {
    padding: 5em 0 2em;
  }
  
  .reading-content {
    padding: 2em 0;
  }
  
  .book-content {
    font-size: 1.1em; /* Keep larger font on mobile */
    max-width: 100%;
    padding: 0 1em;
    line-height: 1.9; /* Even more generous spacing on mobile */
  }
  
  .chapter {
    margin-bottom: 3em;
    padding-bottom: 2em;
  }
  
  .chapter-title {
    font-size: 1.8em;
  }
  
  .chapter-content p {
    margin: 0 0 2em; /* More spacing between paragraphs on mobile */
  }
}

@media (max-width: 480px) {
  .reading-controls {
    flex-wrap: wrap;
    gap: 0.5em;
  }
  
  .control-btn {
    padding: 0.4em 0.6em;
    font-size: 0.85em;
  }
  
  .book-content {
    padding: 0 0.5em;
  }
  
  .chapter-content p {
    text-indent: 1em;
  }
}

/* Print Styles */
@media print {
  .reading-controls,
  .site-header,
  .site-footer {
    display: none;
  }
  
  .reading-content {
    background: white;
    color: black;
  }
  
  .book-content {
    color: black;
    font-size: 12pt;
    line-height: 1.6;
  }
  
  .chapter-title {
    color: black;
    page-break-after: avoid;
  }
  
  .chapter {
    page-break-inside: avoid;
    margin-bottom: 2em;
  }
}
