/* ==========================================================================
   RCL Devotional & Bible Study - Historical Codex & Elegant Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Cinzel+Decorative:wght@700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Parchment Light Palette (Default) */
  --bg-parchment: #fcfaf7;
  --bg-vellum: #f6f2ea;
  --bg-card: #ffffff;
  --bg-card-subtle: #fbf9f5;
  --border-gold: #d8c8a8;
  --border-gold-subtle: #ebd04f;
  --border-line: #e6dfd3;
  --ink-primary: #1f1d1a;
  --ink-secondary: #4a453e;
  --ink-muted: #736b62;
  --rubric-red: #8f1d1d;
  --rubric-red-soft: rgba(143, 29, 29, 0.08);
  --gold-accent: #b08226;
  --gold-glow: rgba(176, 130, 38, 0.15);
  --green-ordinary: #2d6a4f;
  
  --font-serif: 'EB Garamond', Garamond, Georgia, serif;
  --font-display: 'Cinzel', 'Cormorant Garamond', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --reader-font-size: 1.18rem;
  --reader-line-height: 1.82;
}

/* Monastic / Scriptoria Dark Mode */
html.dark {
  --bg-parchment: #0f1015;
  --bg-vellum: #16171e;
  --bg-card: #191a24;
  --bg-card-subtle: #14151e;
  --border-gold: #8f7437;
  --border-line: #2b2c3a;
  --ink-primary: #ebe6dc;
  --ink-secondary: #c5beae;
  --ink-muted: #8d877b;
  --rubric-red: #e65c5c;
  --rubric-red-soft: rgba(230, 92, 92, 0.15);
  --gold-accent: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.22);
  --green-ordinary: #40916c;
}

body {
  background-color: var(--bg-parchment);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

/* Sacred Typography Utilities */
.font-book {
  font-family: var(--font-serif);
}

.font-cinzel {
  font-family: 'Cinzel', serif;
}

.font-cormorant {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.scripture-body {
  font-family: var(--font-serif);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

/* Verse Numbering */
.verse-num {
  font-family: 'Cinzel', var(--font-serif);
  font-size: 0.68em;
  font-weight: 700;
  color: var(--rubric-red);
  vertical-align: super;
  margin-right: 0.3em;
  padding-left: 0.2em;
  user-select: none;
}

/* Illuminated Drop Cap for Verse 1 */
.has-dropcap::first-letter {
  font-family: 'Cinzel', 'Cormorant Garamond', serif;
  float: left;
  font-size: 3.4em;
  line-height: 0.8;
  padding-top: 0.08em;
  padding-right: 0.14em;
  padding-bottom: 0.02em;
  color: var(--rubric-red);
  font-weight: 700;
  text-shadow: 1px 1px 0px rgba(0,0,0,0.05);
}

/* Psalter Poetic Formatting */
.psalm-verse {
  display: block;
  margin-bottom: 0.85em;
  padding-left: 1.4em;
  text-indent: -1.4em;
}

.psalm-indent {
  display: block;
  padding-left: 1.8em;
  margin-top: 0.2em;
  font-style: italic;
  color: var(--ink-secondary);
}

/* Classical Borders & Accents */
.border-antique {
  border-color: var(--border-line);
}

.border-gold-accent {
  border-color: var(--border-gold);
}

.rubric-text {
  color: var(--rubric-red);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Fleuron Ornaments */
.fleuron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  margin: 1.5rem 0;
  font-size: 1.1rem;
}

.fleuron::before,
.fleuron::after {
  content: "";
  flex: 1;
  max-width: 140px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-gold), transparent);
  margin: 0 1rem;
}

/* Liturgical Banner & Cards */
.manuscript-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 20px -2px rgba(45, 35, 20, 0.05);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html.dark .manuscript-card {
  box-shadow: 0 4px 25px -2px rgba(0, 0, 0, 0.4);
}

/* Classical Corner Rosettes */
.corner-ornament {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--gold-accent);
  pointer-events: none;
}
.corner-ornament.tl { top: 6px; left: 6px; border-top: 1.5px solid; border-left: 1.5px solid; }
.corner-ornament.tr { top: 6px; right: 6px; border-top: 1.5px solid; border-right: 1.5px solid; }
.corner-ornament.bl { bottom: 6px; left: 6px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.corner-ornament.br { bottom: 6px; right: 6px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

/* Slide-over Commentary Drawer */
.study-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background-color: var(--bg-vellum);
  border-left: 1px solid var(--border-gold);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.2);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.study-drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 16, 21, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Original Languages Vocabulary Box */
.vocab-pill {
  border-left: 3px solid var(--gold-accent);
  background-color: var(--bg-card-subtle);
  padding: 0.75rem 1rem;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* Discussion Question Cards */
.question-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

/* Liturgical Dropdown Menu in Top Bar */
.liturgical-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background-color: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.25);
  z-index: 50;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.liturgical-menu-dropdown.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Floating Quick Jump Bottom Bar */
.floating-jump-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 40;
  background-color: rgba(252, 250, 247, 0.94);
  border: 1px solid var(--border-gold);
  border-radius: 9999px;
  box-shadow: 0 6px 24px rgba(35, 25, 10, 0.15);
  backdrop-filter: blur(10px);
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

html.dark .floating-jump-bar {
  background-color: rgba(22, 23, 30, 0.92);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

/* Highlight animation when jumping to guide */
@keyframes goldPulse {
  0% { box-shadow: 0 0 0 0 rgba(176, 130, 38, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(176, 130, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(176, 130, 38, 0); }
}

.highlight-pulse {
  animation: goldPulse 1.6s ease-out 1;
}

/* Print Friendly Styles for Bible Study Handouts */
@media print {
  body {
    background-color: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
  }
  
  .no-print, header, nav, button, .study-drawer, .drawer-backdrop, #theme-toggle, #font-controls, .floating-jump-bar {
    display: none !important;
  }
  
  .manuscript-card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 2rem !important;
  }
  
  .scripture-body {
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }
  
  .corner-ornament {
    display: none !important;
  }
  
  .print-break {
    page-break-before: always;
  }
}
