/* Base Styles */
p {
  font-size: var(--font-size, 1.4rem);
  position: relative;
  padding-left: 1.5rem;
}

/* Paragraph Markers with multiple colors */
p::before {
  content: '¶';
  position: absolute;
  left: 0;
  opacity: 0.5; /* Increased opacity from 0.25 to 0.5 */
  font-size: 1em; /* Increased size from 0.8em to 1em */
  padding-top: 0.1em;
  font-weight: bold; /* Added bold for more visibility */
}

/* Color cycle for paragraph markers */
p:nth-of-type(5n + 1)::before {
  color: #5c9eff;
} /* Light blue */
p:nth-of-type(5n + 2)::before {
  color: #6ac46a;
} /* Light green */
p:nth-of-type(5n + 3)::before {
  color: #e6844f;
} /* Light orange */
p:nth-of-type(5n + 4)::before {
  color: #8e6ac4;
} /* Light purple */
p:nth-of-type(5n + 5)::before {
  color: #e65f8b;
} /* Light pink */

/* Dark mode adjustments */
[data-bs-theme='dark'] p:nth-of-type(5n + 1)::before {
  color: #7eafff;
} /* Brighter blue for dark mode */
[data-bs-theme='dark'] p:nth-of-type(5n + 2)::before {
  color: #7eda7e;
} /* Brighter green for dark mode */
[data-bs-theme='dark'] p:nth-of-type(5n + 3)::before {
  color: #ff9d6a;
} /* Brighter orange for dark mode */
[data-bs-theme='dark'] p:nth-of-type(5n + 4)::before {
  color: #a67eda;
} /* Brighter purple for dark mode */
[data-bs-theme='dark'] p:nth-of-type(5n + 5)::before {
  color: #ff7aa0;
} /* Brighter pink for dark mode */

body {
  padding-top: 70px; /* Account for fixed navbar */
  padding-bottom: 20px;
}

hr {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.story-section {
  margin-bottom: 1.5rem;
}

/* Global hover styles for buttons and links */
a:hover,
.btn:hover {
  color: #ff8c00 !important; /* Orange color on hover */
  transition: color 0.2s ease;
}

/* Navbar Styles */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-bs-theme='light'] .navbar {
  background-color: #f8f9fa;
}

[data-bs-theme='dark'] .navbar {
  background-color: #212529;
}

.navbar-brand img {
  height: 30px;
  margin-right: 10px;
}

/* Theme Toggle Button */
#theme-toggle-button {
  margin-left: 20px;
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
}

[data-bs-theme='dark'] #theme-toggle-button {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Font Size Controls */
.font-size-control {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.font-size-control .btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
  width: 50px; /* Reduced width for A- and A+ buttons */
  display: flex;
  justify-content: center;
}

[data-bs-theme='dark'] .font-size-control .btn {
  background-color: rgba(255, 255, 255, 0.05);
}

.font-size-control .btn:hover {
  background-color: rgba(
    255,
    140,
    0,
    0.1
  ); /* Light orange background on hover */
}

.font-size-control span {
  margin: 0 0.5rem;
  font-weight: normal;
  display: inline-block;
  width: 60px;
  text-align: center;
}

.font-size-control .font-small {
  font-size: 0.8em;
  vertical-align: super;
}

.font-size-control .font-large {
  font-size: 1.2em;
}

/* Audio Player Styles */
#audio-player-container {
  background: var(--bs-body-bg);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 1040;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme='dark'] #audio-player-container {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
}

.audio-player-hidden {
  transform: translateY(100%);
}

.audio-player-visible {
  transform: translateY(0);
}

#audio-play-pause {
  transition: transform 0.2s ease;
}

#audio-play-pause:hover {
  transform: scale(1.05);
}

.reading-highlight {
  background-color: rgba(255, 140, 0, 0.1); /* Subtle orange tint */
  border-radius: 8px;
  padding: 10px 15px 10px 2rem;
  margin-left: -0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-bs-theme='dark'] .reading-highlight {
  background-color: rgba(255, 140, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#nav-listen-btn {
  border-radius: 20px;
  padding-left: 1rem;
  padding-right: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

#nav-listen-btn:hover {
  background-color: var(--bs-primary);
  color: white !important;
  transform: translateY(-1px);
}

/* Ensure main content has enough padding-bottom when player is visible */
body:has(.audio-player-visible) {
  padding-bottom: 100px;
}
