/* Header & Reading Controls */
.reader-nav {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  z-index: 900;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reader-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toc-toggle-btn {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.toc-toggle-btn:hover { background: var(--bg-accent-soft); }

.nav-title-truncate {
  font-family: var(--font-serif-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-btn:hover {
  background: var(--color-terracotta-light);
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}

/* Sidebar Drawer for Table of Contents */
.toc-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
}

.toc-drawer.open { transform: translateX(0); }

.toc-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 990;
  display: none;
}

.toc-backdrop.open { display: block; }

.toc-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-list {
  padding: 1rem 0;
  overflow-y: auto;
  list-style: none;
  flex: 1;
}

.toc-link {
  display: flex;
  padding: 0.85rem 1.5rem;
  color: var(--text-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  border-left: 3px solid transparent;
}

.toc-link:hover, .toc-link.active {
  background: var(--bg-accent-soft);
  color: var(--color-terracotta);
  border-left-color: var(--color-terracotta);
}

/* Cover Section with 16:9 Aspect Ratio */
.cover-hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  position: relative;
}

.cover-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.cover-image-preview {
  max-width: 580px;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-warm);
  margin: 1.5rem 0;
  border: 1px solid var(--border-gold);
}

/* Bottom Chapter Navigation Bar */
.bottom-nav {
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  z-index: 850;
  backdrop-filter: blur(8px);
}

.bottom-nav-inner {
  max-width: var(--max-width-content);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-indicator {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .nav-title-truncate { display: none; }
  .reader-nav { padding: 0.5rem 0.75rem; }
  .reader-actions { gap: 0.25rem; }
  .toc-drawer { width: 85vw; }
}
