/* ═══════════════════════════════════════════════════════════════
   Grace Memorial Bible Reader — stylesheet
   Based on devotional.css with reader-specific additions
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Noto+Sans:ital,wght@0,300;0,400;0,600;1,400&family=Noto+Serif:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --navy: #082846;
  --navy-mid: #0d3b66;
  --gold: #c8922a;
  --gold-light: #e8b45a;
  --cream: #f9f5ee;
  --white: #ffffff;
  --ink: #1a1a1a;
  --text-mid: #4a4a4a;
  --muted: #6b6b6b;
  --divider: #d4cfc4;
  --accent: #c8922a;
  --accent-soft: #e8b45a;
  --highlight: #f4efe4;
  --scroll-bg: #fcf9f2;

  --font-serif: 'EB Garamond', 'Georgia', serif;
  --font-reader: 'Noto Serif', 'Georgia', serif;
  --font-sans: 'Noto Sans', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  width: 100%;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  padding: 0 1rem;
}

.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  gap: 0.5rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  flex-shrink: 0;
}

.site-title a { color: var(--white); text-decoration: none; }
.site-title a:hover { color: var(--gold-light); }

.site-title .subtitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.05rem;
}

/* ── Nav ──────────────────────────────────────────────────── */

.site-nav {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav > a {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: all 0.15s;
  white-space: nowrap;
}

.site-nav > a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

/* Version selector in nav */
.nav-dropdown-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
}

.nav-dropdown-toggle-row .selector-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

.nav-dropdown-toggle-row select {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 0.2rem 0.3rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  max-width: 80px;
}

.nav-toggle {
  display: none;
  font-size: 1.3rem;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .site-nav.open { display: flex; }
  .nav-dropdown-toggle-row { width: 100%; justify-content: space-between; }
  .nav-dropdown-toggle-row select { max-width: none; flex: 1; }
  .site-nav > a { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

.main-content {
  max-width: 900px;
  width: 100%;
  padding: 1.5rem 1rem 3rem;
}

@media (max-width: 600px) {
  .main-content { padding: 1rem 0.5rem 2rem; }
}

/* ═══════════════════════════════════════════════════════════════
   READER CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.reader-controls {
  margin-bottom: 1.5rem;
}

.control-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.control-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.control-group select {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  min-width: 130px;
  cursor: pointer;
}

.control-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200,146,42,0.2);
}

.reader-progress {
  margin-top: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  .control-row { flex-direction: column; gap: 0.5rem; }
  .control-group select { min-width: auto; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL / READING AREA
   ═══════════════════════════════════════════════════════════════ */

.scroll {
  max-width: 800px;
  width: 100%;
  padding: 2rem 2.5rem;
  background: var(--scroll-bg);
  border-radius: 4px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
}

@media (max-width: 600px) {
  .scroll { padding: 1.2rem 1rem; }
}

/* ── Welcome ──────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 1.5rem 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gold);
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.hero p {
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-top: 0.6rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 0.88rem; }
}

/* ── Quick Nav ────────────────────────────────────────────── */

.quick-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

@media (max-width: 600px) {
  .quick-nav { grid-template-columns: 1fr; }
}

.qs-group h4 {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.3rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--divider);
}

.qs-link {
  display: block;
  font-size: 0.88rem;
  color: var(--navy);
  text-decoration: none;
  padding: 0.2rem 0.3rem;
  border-radius: 2px;
  transition: background 0.1s;
}

.qs-link:hover { background: var(--highlight); }

/* ── Chapter header ────────────────────────────────────────── */

.reader-chapter-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--divider);
}

.reader-chapter-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .reader-chapter-header h1 { font-size: 1.2rem; }
}

/* ── Verse rendering ────────────────────────────────────────── */

.reader-text {
  font-family: var(--font-reader);
  line-height: 1.9;
  max-width: 680px;
  margin: 0 auto;
}

.verse {
  display: inline;
}

.verse-num {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--gold);
  margin-right: 0.15em;
  vertical-align: baseline;
  position: relative;
  top: -0.1em;
}

/* ── Chapter navigation ─────────────────────────────────────── */

.reader-footer {
  margin-top: 2rem;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
  gap: 0.5rem;
}

.nav-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--gold);
  background: none;
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-btn:hover { background: var(--highlight); border-color: var(--accent-soft); }

.nav-btn.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 400px) {
  .reader-nav { flex-direction: column; }
  .nav-btn { width: 100%; text-align: center; }
}

/* ── Colophon ────────────────────────────────────────────────── */

.colophon {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--divider);
  font-family: var(--font-sans);
}

.colophon .trans-name { font-weight: 600; color: var(--text-mid); }

/* VERSION SELECTOR */

.version-strip {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.version-btn {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: 3px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.12s;
}

.version-btn.active { background: var(--gold); color: var(--white); border-color: var(--gold); }
.version-btn:not(.active):hover { color: var(--ink); border-color: var(--accent-soft); }

/* ── Site Footer ─────────────────────────────────────────────── */

.site-footer {
  width: 100%;
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  text-align: center;
  padding: 1.2rem 1rem;
  margin-top: auto;
  font-family: var(--font-sans);
}

.site-footer a { color: var(--gold-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
