/* ===== Fullscreen Reader View ===== */

.reader-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reader-overlay.visible {
  opacity: 1;
}

/* Top bar */
.reader-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.reader-topbar.hidden-controls {
  opacity: 0;
  pointer-events: none;
}

.reader-btn-back {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.reader-btn-back:hover {
  background: rgba(255,255,255,0.3);
}

.reader-topbar-info {
  text-align: right;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
}
.reader-topbar-title {
  font-weight: 600;
  font-size: 14px;
  color: white;
}
.reader-topbar-progress {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* Content area (Paginated via CSS Columns) */
.reader-content {
  flex: 1;
  display: block;
  column-width: 100vw;
  column-gap: 0;
  height: 100vh;
  box-sizing: border-box;
  padding: 80px 0 48px 0;
  position: relative;
  user-select: text;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-behavior: smooth; /* For JS scrollBy */
}

.reader-content p {
  margin: 0 0 24px 0;
  padding: 0 24px;
  font-family: var(--font-reading);
  font-size: 19px;
  line-height: 1.6;
  text-align: left;
  color: inherit;
  /* Prevent paragraphs from breaking awkwardly if possible */
  orphans: 2;
  widows: 2;
}

/* Highlight the active sentence lightly if desired, or just general spans */
.reader-content span[data-sent] {
  transition: background-color 0.3s;
}

/* Tap zones for pagination */
.reader-tap-left,
.reader-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  z-index: 5;
  cursor: pointer;
}
.reader-tap-left { left: 0; }
.reader-tap-right { right: 0; }

.reader-tap-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25%;
  right: 25%;
  z-index: 5;
  cursor: pointer;
}

/* Navigation arrows */
.reader-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: background 0.2s, opacity 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.reader-nav:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}
.reader-nav.hidden-controls {
  opacity: 0;
  pointer-events: none;
}
.reader-nav-prev { left: 16px; }
.reader-nav-next { right: 16px; }

/* Bottom progress bar */
.reader-progress-bar-container {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  z-index: 10;
}
.reader-progress-bar-fill {
  height: 100%;
  background: rgba(255,255,255,0.5);
  transition: width 0.3s ease;
}

/* Desktop adjustments */
@media (min-width: 768px) {
  .reader-content p {
    font-size: 22px;
    line-height: 1.7;
    padding: 0 calc(50vw - 340px); /* max-width 680px centered */
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .reader-content {
    padding: 72px 0 32px 0;
  }
  .reader-nav {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .reader-nav-prev { left: 8px; }
  .reader-nav-next { right: 8px; }
}
