/* ============================================================
   Great Controversy Reader — light parchment theme
   Matches homepage: warm paper bg, white cards, navy accent
   ============================================================ */

/* Page shell */
.gcr-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--moh-paper);
  color: var(--moh-text);
}

/* Reading progress bar */
.gcr-progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #e2e6ec;
  z-index: 200;
}
.gcr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--moh-gold-soft), var(--moh-gold-soft));
  transition: width 0.3s ease;
}

/* Layout */
.gcr-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  padding-top: 3px;
}

/* ---- Sidebar ---- */
.gcr-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--moh-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: hidden;
}
.gcr-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.gcr-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.gcr-book-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--moh-gold-soft);
  margin: 0;
}
.gcr-sidebar-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  padding: 0.2rem 0.4rem;
}
.gcr-sidebar-close:hover { color: var(--moh-white); }

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

.gcr-toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.6rem 1.1rem;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.gcr-toc-link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--moh-white);
}
.gcr-toc-link.is-active {
  background: rgba(201, 162, 39, 0.18);
  border-left-color: var(--moh-gold-soft);
  color: var(--moh-gold-soft);
  font-weight: 600;
}
.gcr-toc-num {
  flex-shrink: 0;
  width: 1.6rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  text-align: right;
}
.gcr-toc-link.is-active .gcr-toc-num { color: var(--moh-gold-soft); }

/* ---- Main ---- */
.gcr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--moh-paper);
}

/* Toolbar */
.gcr-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid #e2e6ec;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 3px;
  z-index: 100;
}
.gcr-menu-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid #c5cad3;
  border-radius: var(--moh-radius);
  color: var(--moh-ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.gcr-menu-btn:hover { background: var(--moh-tint); }

.gcr-chapter-count {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  color: var(--moh-muted);
  letter-spacing: 0.04em;
}
.gcr-font-controls { display: flex; gap: 0.4rem; }
.gcr-font-btn {
  background: transparent;
  border: 1px solid #c5cad3;
  border-radius: var(--moh-radius);
  color: var(--moh-ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  line-height: 1.4;
}
.gcr-font-btn:hover { background: var(--moh-tint); }

/* Article */
.gcr-article {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
  width: 100%;
}
.gcr-article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e6ec;
}
.gcr-chapter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moh-gold-soft);
  margin: 0 0 0.5rem;
}
.gcr-chapter-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--moh-ink);
  line-height: 1.15;
  margin: 0;
}

/* Body text */
.gcr-body {
  font-size: var(--gcr-font-size, 1.0625rem);
  line-height: 1.85;
  color: var(--moh-text);
  transition: font-size 0.2s ease;
}
.gcr-body p { margin: 0 0 1.4em; }
.gcr-body p:last-child { margin-bottom: 0; }

/* Drop cap */
.gcr-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.8em;
  font-weight: 700;
  color: var(--moh-ink);
  float: left;
  line-height: 0.78;
  margin: 0.06em 0.08em 0 0;
}

/* Chapter nav */
.gcr-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e6ec;
  gap: 1rem;
}
.gcr-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--moh-white);
  border: 1px solid #d5d9e0;
  border-radius: var(--moh-radius);
  color: var(--moh-ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.1rem;
  max-width: 46%;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--moh-shadow);
}
.gcr-nav-btn:hover {
  background: var(--moh-tint);
  border-color: var(--moh-gold-soft);
  color: var(--moh-ink);
}
.gcr-nav-next { margin-left: auto; text-align: right; }
.gcr-nav-prev { margin-right: auto; text-align: left; }

/* ---- Mobile ---- */
@media (max-width: 860px) {
  .gcr-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: min(320px, 88vw);
  }
  .gcr-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.25);
  }
  .gcr-sidebar-close { display: block; }
  .gcr-menu-btn { display: inline-flex; }
  .gcr-toolbar { padding: 0.75rem 1rem; }
  .gcr-article { padding: 1.5rem 1.1rem 3rem; }
  .gcr-nav-btn { font-size: 0.82rem; padding: 0.7rem 0.8rem; }

  .gcr-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(27, 42, 65, 0.45);
    z-index: 299;
  }
  .gcr-overlay.is-visible { display: block; }
}

@media (min-width: 861px) {
  .gcr-menu-btn { display: none !important; }
}

/* Sidebar scrollbar */
.gcr-toc::-webkit-scrollbar { width: 5px; }
.gcr-toc::-webkit-scrollbar-track { background: transparent; }
.gcr-toc::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
