/* Osho Reader Styles */
:root {
  --reader-bg: #f9f9f9;
  --reader-text: #333;
  --reader-accent: #e55039;
  /* Osho Orange-ish */
  --reader-font: 'Inter', system-ui, sans-serif;
  --reader-serif: 'Merriweather', 'Georgia', serif;
  --reader-max-width: 800px;
}

/* Dark mode removed by user request (Force Light) */

body.reader-mode {
  font-family: var(--reader-font);
  background-color: var(--reader-bg);
  color: var(--reader-text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.reader-container {
  max-width: 1200px;
  /* Increased for sidebar layout */
  margin: 0 auto;
  padding: 1rem;
}

@media (max-width: 640px) {
  .reader-container {
    padding: 0.5rem;
  }
}

/* Sidebar Layout */
.reader-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  /* Main content + 300px Sidebar */
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .reader-layout {
    grid-template-columns: 1fr;
    /* Stack on smaller screens */
  }

  .reader-sidebar {
    order: 2;
    /* Put sidebar below content on mobile */
    margin-top: 2rem;
  }
}

/* Main Column */
.reader-main-column {
  min-width: 0;
  /* Prevent grid blowout */
  max-width: 800px;
  /* Keep reading width optimal */
  margin: 0 auto;
  /* Center if sidebar is hidden or on its own */
}

.reader-layout .reader-main-column {
  margin: 0;
  /* Reset margin in grid */
}

/* Sidebar Column */
.reader-sidebar {
  position: relative;
  /* Changed from sticky to allow scrolling with page */
  /* top: 6rem; removed */
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.5rem;
  /* max-height and overflow removed for free-flowing layout */
}

/* Header */
.reader-header {
  border-bottom: 1px solid rgba(125, 125, 125, 0.2);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reader-header a {
  text-decoration: none;
  font-weight: 600;
  color: var(--reader-accent);
}

.reader-header h1 {
  font-family: var(--reader-serif);
  font-size: 2.5rem;
  margin: 0.5rem 0;
  line-height: 1.2;
}

.reader-meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 2rem;
}

/* Content */
.reader-content {
  font-family: var(--reader-serif);
  font-size: 1.2rem;
  line-height: 1.8;
}

.reader-content p {
  margin-bottom: 1.5rem;
}

/* Navigation */
.reader-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(125, 125, 125, 0.2);
}

.reader-nav a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--reader-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.reader-nav a:hover {
  opacity: 0.9;
}

.reader-nav .nav-disabled {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tags */
.reader-tags {
  margin-top: 3rem;
  font-size: 0.9rem;
}

.reader-tags h3 {
  font-size: 1rem;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-chip {
  background: rgba(125, 125, 125, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  color: var(--reader-text);
  font-size: 0.85rem;
  transition: background 0.2s;
}

.tag-chip:hover {
  background: var(--reader-accent);
  color: #fff;
}

/* QnA Section */
.reader-qna {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(125, 125, 125, 0.05);
  border-radius: 8px;
}

.ask-osho-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  background: #333;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 8px;
  border: 2px solid #333;
}

.ask-osho-btn:hover {
  background: transparent;
  color: #333;
}

@media (prefers-color-scheme: dark) {
  .ask-osho-btn {
    background: #e0e0e0;
    color: #1a1a1a;
    border-color: #e0e0e0;
  }

  .ask-osho-btn:hover {
    background: transparent;
    color: #e0e0e0;
  }
}

/* Updated Header Styles */
.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--reader-text);
  gap: 0.8rem;
}

.logo-img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.header-title {
  font-family: var(--reader-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.reader-header .btn-ask {
  background: var(--reader-accent);
  color: #fff !important;
  /* Force white text */
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.reader-header .btn-ask:hover {
  opacity: 0.9;
}

.nav-link {
  text-decoration: none;
  color: #666;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--reader-accent);
}

/* Related Discourses Sidebar/Section */
.related-discourses {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.related-item a {
  display: block;
  padding: 0.8rem;
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 6px;
  text-decoration: none;
  color: #555;
  font-size: 0.9rem;
}

.related-item a:hover {
  background: #fff;
  border-color: var(--reader-accent);
  color: var(--reader-accent);
}

/* QnA Formatting */
.qna-item {
  background: #fff;
  border-left: 4px solid var(--reader-accent);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.qna-question {
  font-weight: 700;
  color: #222;
  margin-bottom: 1rem;
  font-family: var(--reader-serif);
  font-size: 1.1rem;
}

.qna-answer {
  color: #444;
  white-space: pre-wrap;
  /* Preserve formatting */
}