/*--------------------------------------------------------------
# Reader - Ukážka zo Slzy temnoty
# Ethereal style - dýchajúca atmosféra (Bohyňa Mesiaca)
--------------------------------------------------------------*/

.reader-page {
  --primary: #c4b5d4;
  --primary-bright: #e8e0f0;
  --accent: #9b8db5;
  --font-main: 'Bellefair', serif;
  --font-heading: 'Merienda', serif;
  --reader-bg: #0f0818;
  --reader-bg-deep: #1a0a2e;
  /* Všetky texty bielou */
  --reader-text: #ffffff;
  --reader-text-dim: #ffffff;
  --reader-text-muted: #ffffff;
  --reader-line-length: 65ch;
  --reader-font-size: 1.1rem;
}

.reader-page {
  background: var(--reader-bg);
  color: var(--reader-text);
  font-family: var(--font-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ethereal background - jemnejšia vrstva, aby text nevypadal priesvitne */
.reader-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(45, 27, 78, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(155, 141, 181, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse 50% 60% at 20% 60%, rgba(75, 55, 100, 0.1) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Starfield / particle overlay - výrazne znížená, aby text ostal plný */
.reader-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 5% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 35%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 8%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 65%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 25%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 80%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 65% 45%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 12%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 95% 72%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(2px 2px at 10% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 50% 5%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.45) 0%, transparent 100%);
  background-size: 100% 100%;
  background-position: 0 0;
  animation: reader-breathe 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

@keyframes reader-breathe {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.25; }
}

.reader-page > * {
  position: relative;
  z-index: 1;
}

/* Menu nad obrázkom – priesvitné, žiadny obdĺžnik */
.reader-page #header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent !important;
  border-bottom: none;
  z-index: 100;
}

.reader-page #header.header-scrolled {
  background: transparent !important;
}

.reader-page .nav-menu a {
  color: #ffffff;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 2px 3px rgba(0, 0, 0, 0.9);
}

.reader-page .nav-menu a:hover,
.reader-page .nav-menu .menu-active a {
  color: #ffffff;
  opacity: 1;
}

/* Smooth scroll */
.reader-page {
  scroll-behavior: smooth;
}

/* Skrytý obsah - zobrazuje sa len horná sekcia (hero) */
.reader-body-hidden {
  display: none !important;
}

.reader-page #footer {
  display: none !important;
}

/* Progress bar */
.reader-progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(155, 141, 181, 0.2);
  z-index: 1001;
}

.reader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary-bright));
  width: 0%;
  transition: width 0.2s ease;
  box-shadow: 0 0 10px rgba(196, 181, 212, 0.5);
}

/* Hero section – obrázok cez celú obrazovku, žiadny spodný obdĺžnik */
.reader-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  background-image: url('../img/slza1.png');
  background-size: cover;
  background-position: center 38%;
}

.reader-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to bottom, rgba(15, 8, 24, 0.2) 0%, rgba(15, 8, 24, 0.5) 100%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(155, 141, 181, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.reader-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.05em;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 0.9);
  position: relative;
  z-index: 1;
}

.reader-hero-subtitle {
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: #ffffff;
  margin: 0 0 2.5rem 0;
  font-style: italic;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 1;
}

.reader-hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 280px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.reader-hero-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.35rem;
  font-family: var(--font-main);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.reader-hero-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(196, 181, 212, 0.2);
}

.reader-hero-btn.primary {
  background: rgba(196, 181, 212, 0.25);
  border-color: var(--primary);
}

.reader-hero-btn.primary:hover {
  background: rgba(196, 181, 212, 0.4);
  box-shadow: 0 0 30px rgba(196, 181, 212, 0.3);
}

/* Download dropdown */
.reader-hero-download-wrap {
  position: relative;
  width: 100%;
}

.reader-hero-download-btn {
  width: 100%;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.reader-hero-download-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(26, 10, 46, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.35rem;
  padding: 0.5rem 0;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.reader-hero-download-menu.show {
  display: flex;
}

.reader-hero-download-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.reader-hero-download-item:hover {
  background: rgba(196, 181, 212, 0.2);
  color: #ffffff;
}

/* Reader header */
.reader-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 8, 24, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.reader-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.03em;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reader-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.35rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.reader-download-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(196, 181, 212, 0.2);
}

.reader-font-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.reader-font-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-radius: 0.3rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.reader-font-btn:hover {
  border-color: var(--primary);
  background: rgba(196, 181, 212, 0.15);
  color: #ffffff;
}

/* Table of contents */
.reader-nav {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.reader-nav-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem 0;
}

.reader-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reader-nav-list a {
  display: block;
  padding: 0.45rem 0;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.reader-nav-list a:hover,
.reader-nav-list a.active {
  color: #ffffff;
}

.reader-nav-list a.active {
  padding-left: 0.6rem;
  border-left: 2px solid var(--primary);
}

/* Main content layout */
.reader-body {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 3rem;
}

@media (min-width: 992px) {
  .reader-body {
    grid-template-columns: 200px 1fr;
  }
}

/* Chapter sections */
.reader-chapter {
  scroll-margin-top: 100px;
  margin-bottom: 4rem;
}

.reader-chapter:last-child {
  margin-bottom: 2rem;
}

/* Rozloženie kapitoly: obrázok vľavo, text vpravo (inšpirované knižným rozložením) */
.reader-chapter-spread {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (min-width: 900px) {
  .reader-chapter-spread {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    min-height: 70vh;
  }
}

.reader-chapter-spread .reader-chapter-figure {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reader-chapter-spread .reader-chapter-figure img {
  width: 100%;
  height: auto;
  min-height: 400px;
  object-fit: cover;
  display: block;
}

.reader-chapter-spread .reader-chapter-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.35rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.reader-chapter-spread .reader-chapter-back:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
}

.reader-chapter-spread .reader-chapter-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.reader-chapter-spread .reader-chapter-content {
  max-width: none;
  flex: 1;
}

.reader-chapter-spread .reader-chapter-continue-wrap {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.reader-chapter-spread .reader-chapter-continue {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: opacity 0.2s ease;
}

.reader-chapter-spread .reader-chapter-continue:hover {
  color: #ffffff;
  opacity: 0.9;
}

.reader-chapter-header {
  margin-bottom: 1.5rem;
}

.reader-chapter-num {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: #ffffff;
  letter-spacing: 0.18em;
  margin: 0 0 0.35rem 0;
}

.reader-chapter-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 300;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}

/* Chapter image */
.reader-chapter-img {
  width: 100%;
  max-width: 700px;
  height: 280px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin: 1.5rem 0 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Chapter content */
.reader-chapter-content {
  max-width: var(--reader-line-length);
  line-height: 1.8;
  font-size: var(--reader-font-size);
  color: #ffffff;
}

.reader-chapter-content .chapter-intro {
  font-style: italic;
  font-size: 1.05em;
  color: #ffffff;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
}

.reader-chapter-content p {
  margin: 0 0 1rem 0;
  text-align: justify;
}

.reader-chapter-divider {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0.7;
  margin: 2rem 0;
}

/* Placeholder for chapter image */
.reader-chapter-placeholder {
  width: 100%;
  max-width: 700px;
  height: 280px;
  background: linear-gradient(135deg, rgba(155, 141, 181, 0.15) 0%, rgba(45, 27, 78, 0.3) 100%);
  border-radius: 0.5rem;
  margin: 1.5rem 0 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  border: 1px dashed rgba(196, 181, 212, 0.25);
}

/* Progress label */
.reader-progress-label {
  position: fixed;
  top: 12px;
  right: 1.5rem;
  font-size: 0.8rem;
  color: #ffffff;
  z-index: 1002;
}

/* Footer */
.reader-page #footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.9rem;
}

.reader-page #footer a {
  color: #ffffff;
}

.reader-page #footer a:hover {
  color: #ffffff;
}

@media (max-width: 767px) {
  .reader-nav {
    position: static;
    margin-bottom: 2rem;
  }

  .reader-progress-label {
    display: none;
  }
}
