/* ==========================================================================
   BIBLE STUDY PAGES — Dedicated Styles
   
   Loaded on book study pages and Hagah posts. Covers:
   - Chapter navigation bar
   - Verse-by-verse section layouts
   - Dual-panel "Put Off / Put On" (Colossians 3, etc.)
   - Word study callouts (Hebrew/Greek)
   - Cross-reference panels
   - Passage highlight strips
   - Outline / structure views
   - Responsive and print considerations
   ========================================================================== */


/* ==========================================================================
   1. CHAPTER NAVIGATION
   Sticky horizontal bar for navigating between chapters within a book study.
   ========================================================================== */

.lff-chapter-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--lff-navy-900);
  border-bottom: 1px solid var(--lff-navy-700);
  padding: var(--lff-space-sm) var(--lff-gutter);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--lff-navy-600) transparent;
}

.lff-chapter-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--lff-space-xs);
  max-width: var(--lff-wide-width);
  margin-inline: auto;
}

.lff-chapter-nav__label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-400);
  white-space: nowrap;
  margin-right: var(--lff-space-sm);
}

.lff-chapter-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0.25em 0.5em;
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-medium);
  color: var(--lff-navy-200);
  text-decoration: none;
  border-radius: var(--lff-radius-sm);
  transition: all var(--lff-duration-fast) var(--lff-ease-out);
  white-space: nowrap;
}

.lff-chapter-nav__link:hover {
  color: var(--lff-parchment-100);
  background: var(--lff-navy-700);
}

.lff-chapter-nav__link.is-active {
  color: var(--lff-navy-900);
  background: var(--lff-gold-400);
  font-weight: var(--lff-weight-bold);
}

/* Scrollbar styling for chapter nav */
.lff-chapter-nav::-webkit-scrollbar {
  height: 4px;
}

.lff-chapter-nav::-webkit-scrollbar-track {
  background: transparent;
}

.lff-chapter-nav::-webkit-scrollbar-thumb {
  background: var(--lff-navy-600);
  border-radius: 2px;
}


/* ==========================================================================
   2. VERSE SECTIONS
   Individual verse or passage blocks within a chapter study.
   ========================================================================== */

.lff-verse-section {
  padding: var(--lff-space-xl) 0;
  border-bottom: 1px solid var(--lff-border);
  scroll-margin-top: 4rem; /* account for sticky chapter nav */
}

.lff-verse-section:last-child {
  border-bottom: none;
}

/* Verse number badge */
.lff-verse-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  color: var(--lff-gold-600);
  background: var(--lff-gold-100);
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: var(--lff-space-sm);
}

/* Verse range heading — e.g. "Verses 12–14" */
.lff-verse-range {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-wider);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-xs);
}

/* The verse text itself — larger, more spacious for reading */
.lff-verse-text {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-lg);
  line-height: var(--lff-leading-relaxed);
  color: var(--lff-navy-800);
  max-width: var(--lff-content-width);
}

.lff-verse-text em,
.lff-verse-text .lff-emphasis {
  font-style: italic;
  color: var(--lff-navy-600);
}

/* Commentary below the verse */
.lff-verse-commentary {
  margin-top: var(--lff-space-md);
  font-size: var(--lff-text-base);
  line-height: var(--lff-leading-normal);
  color: var(--lff-text-secondary);
  max-width: var(--lff-content-width);
}

/* Inline verse reference superscript */
.lff-verse-sup {
  font-family: var(--lff-font-display);
  font-size: 0.65em;
  font-weight: var(--lff-weight-bold);
  color: var(--lff-gold-500);
  vertical-align: super;
  line-height: 1;
  margin-right: 0.15em;
}


/* ==========================================================================
   3. PASSAGE HIGHLIGHT STRIP
   A full-width colored strip that presents a key passage prominently,
   often used at the top of a chapter study section.
   ========================================================================== */

.lff-passage-strip {
  background: var(--lff-surface-warm);
  border-left: 4px solid var(--lff-book-accent, var(--lff-gold-400));
  padding: var(--lff-space-lg) var(--lff-space-xl);
  margin: var(--lff-space-lg) 0;
  border-radius: 0 var(--lff-radius-md) var(--lff-radius-md) 0;
}

.lff-passage-strip--dark {
  background: var(--lff-navy-900);
  border-left-color: var(--lff-gold-400);
  color: var(--lff-text-on-dark);
}

.lff-passage-strip__ref {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-book-accent, var(--lff-gold-500));
  margin-bottom: var(--lff-space-xs);
}

.lff-passage-strip__text {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-xl);
  font-style: italic;
  line-height: var(--lff-leading-relaxed);
  color: var(--lff-navy-700);
}

.lff-passage-strip--dark .lff-passage-strip__text {
  color: var(--lff-parchment-200);
}


/* ==========================================================================
   4. DUAL-PANEL LAYOUT — "PUT OFF / PUT ON"
   Side-by-side (or stacked on mobile) contrast panels.
   Used in Colossians 3:1–17 and similar passages that present
   opposing concepts: old self / new self, death / life, etc.
   ========================================================================== */

.lff-dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: var(--lff-space-xl) 0;
  border-radius: var(--lff-radius-lg);
  overflow: hidden;
  box-shadow: var(--lff-shadow-lg);
}

@media (max-width: 640px) {
  .lff-dual-panel {
    grid-template-columns: 1fr;
  }
}

/* Left panel — "Put Off" / Old Self / Darkness */
.lff-dual-panel__off {
  background: var(--lff-put-off-bg);
  color: #d4c4c9;
  padding: var(--lff-space-xl);
}

.lff-dual-panel__off .lff-dual-panel__label {
  color: var(--lff-put-off-accent);
}

/* Right panel — "Put On" / New Self / Light */
.lff-dual-panel__on {
  background: var(--lff-put-on-bg);
  color: var(--lff-navy-800);
  padding: var(--lff-space-xl);
}

.lff-dual-panel__on .lff-dual-panel__label {
  color: var(--lff-put-on-accent);
}

/* Panel label */
.lff-dual-panel__label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  margin-bottom: var(--lff-space-md);
}

/* Panel title */
.lff-dual-panel__title {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-2xl);
  font-weight: var(--lff-weight-semibold);
  margin-bottom: var(--lff-space-md);
  line-height: var(--lff-leading-tight);
}

.lff-dual-panel__off .lff-dual-panel__title {
  color: #e8d8dd;
}

.lff-dual-panel__on .lff-dual-panel__title {
  color: var(--lff-navy-900);
}

/* Items list within each panel */
.lff-dual-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--lff-space-sm);
}

.lff-dual-panel__item {
  display: flex;
  align-items: baseline;
  gap: var(--lff-space-sm);
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-base);
  line-height: var(--lff-leading-snug);
  padding: var(--lff-space-sm) 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.lff-dual-panel__item:last-child {
  border-bottom: none;
}

/* Icon/bullet for each item */
.lff-dual-panel__icon {
  flex-shrink: 0;
  font-size: 0.85em;
}

.lff-dual-panel__off .lff-dual-panel__icon {
  color: var(--lff-put-off-accent);
}

.lff-dual-panel__on .lff-dual-panel__icon {
  color: var(--lff-put-on-accent);
}

/* Verse reference within a panel item */
.lff-dual-panel__verse-ref {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-medium);
  color: rgba(128, 128, 128, 0.6);
  margin-left: auto;
  white-space: nowrap;
}


/* ==========================================================================
   5. WORD STUDY CALLOUT
   Inline or block-level callout for Hebrew/Greek word exploration.
   ========================================================================== */

.lff-word-study {
  background: var(--lff-navy-50);
  border: 1px solid var(--lff-navy-100);
  border-radius: var(--lff-radius-lg);
  padding: var(--lff-space-lg);
  margin: var(--lff-space-lg) 0;
}

.lff-word-study--dark {
  background: var(--lff-navy-800);
  border-color: var(--lff-navy-700);
  color: var(--lff-text-on-dark);
}

.lff-word-study__lang-label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-xs);
}

/* The original-language word displayed large */
.lff-word-study__term {
  font-size: var(--lff-text-3xl);
  line-height: var(--lff-leading-tight);
  margin-bottom: var(--lff-space-xs);
  color: var(--lff-navy-900);
}

.lff-word-study--dark .lff-word-study__term {
  color: var(--lff-parchment-100);
}

/* Transliteration */
.lff-word-study__translit {
  font-family: var(--lff-font-body);
  font-style: italic;
  font-size: var(--lff-text-lg);
  color: var(--lff-navy-400);
  margin-bottom: var(--lff-space-sm);
}

/* Pronunciation guide */
.lff-word-study__pronun {
  font-family: var(--lff-font-mono);
  font-size: var(--lff-text-sm);
  color: var(--lff-navy-300);
  margin-bottom: var(--lff-space-md);
}

/* Definition / meaning */
.lff-word-study__def {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-base);
  line-height: var(--lff-leading-normal);
  color: var(--lff-navy-700);
  padding-top: var(--lff-space-sm);
  border-top: 1px solid var(--lff-navy-100);
}

.lff-word-study--dark .lff-word-study__def {
  color: var(--lff-navy-200);
  border-top-color: var(--lff-navy-700);
}

/* Strongs number / lexicon reference */
.lff-word-study__strongs {
  font-family: var(--lff-font-mono);
  font-size: var(--lff-text-xs);
  color: var(--lff-navy-300);
  background: var(--lff-navy-100);
  padding: 0.15em 0.5em;
  border-radius: var(--lff-radius-sm);
  display: inline-block;
  margin-top: var(--lff-space-sm);
}

.lff-word-study--dark .lff-word-study__strongs {
  background: var(--lff-navy-700);
  color: var(--lff-navy-300);
}

/* Usage examples grid */
.lff-word-study__usage {
  margin-top: var(--lff-space-md);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--lff-space-xs) var(--lff-space-md);
  font-size: var(--lff-text-sm);
}

.lff-word-study__usage-ref {
  font-family: var(--lff-font-display);
  font-weight: var(--lff-weight-medium);
  color: var(--lff-gold-500);
  white-space: nowrap;
}

.lff-word-study__usage-text {
  font-family: var(--lff-font-body);
  color: var(--lff-navy-600);
  font-style: italic;
}


/* ==========================================================================
   6. CROSS-REFERENCE PANEL
   Expandable or always-visible sidebar/block showing related passages.
   ========================================================================== */

.lff-xref-panel {
  background: var(--lff-surface-warm);
  border: 1px solid var(--lff-parchment-300);
  border-radius: var(--lff-radius-lg);
  padding: var(--lff-space-lg);
  margin: var(--lff-space-lg) 0;
}

.lff-xref-panel__title {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-wider);
  color: var(--lff-navy-600);
  margin-bottom: var(--lff-space-md);
}

.lff-xref-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--lff-space-sm);
}

.lff-xref-panel__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--lff-space-sm);
  align-items: baseline;
  padding-bottom: var(--lff-space-sm);
  border-bottom: 1px solid var(--lff-parchment-300);
}

.lff-xref-panel__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.lff-xref-panel__ref {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-semibold);
  color: var(--lff-navy-500);
  white-space: nowrap;
}

.lff-xref-panel__ref a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--lff-navy-300);
}

.lff-xref-panel__ref a:hover {
  color: var(--lff-gold-500);
  border-bottom-color: var(--lff-gold-400);
}

.lff-xref-panel__snippet {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-sm);
  font-style: italic;
  color: var(--lff-navy-600);
  line-height: var(--lff-leading-snug);
}

/* Inline cross-reference row (the chip-style version from style.css, extended) */
.lff-xref-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lff-space-xs);
  margin: var(--lff-space-md) 0;
}


/* ==========================================================================
   7. BOOK OUTLINE / STRUCTURE VIEW
   Hierarchical outline of a book's structure, often on the overview page.
   ========================================================================== */

.lff-book-outline {
  font-family: var(--lff-font-display);
  max-width: var(--lff-content-width);
}

.lff-book-outline__section {
  padding: var(--lff-space-md) 0;
  border-bottom: 1px solid var(--lff-border);
}

.lff-book-outline__section:last-child {
  border-bottom: none;
}

.lff-book-outline__range {
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-wider);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-xs);
}

.lff-book-outline__title {
  font-size: var(--lff-text-xl);
  font-weight: var(--lff-weight-semibold);
  color: var(--lff-navy-800);
  margin-bottom: var(--lff-space-xs);
}

.lff-book-outline__title a {
  color: inherit;
  text-decoration: none;
}

.lff-book-outline__title a:hover {
  color: var(--lff-gold-500);
}

.lff-book-outline__summary {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-sm);
  color: var(--lff-text-muted);
  line-height: var(--lff-leading-normal);
}

/* Sub-sections (nested) */
.lff-book-outline__subsections {
  margin-top: var(--lff-space-sm);
  padding-left: var(--lff-space-lg);
  border-left: 2px solid var(--lff-navy-50);
}

.lff-book-outline__sub {
  padding: var(--lff-space-xs) 0;
}

.lff-book-outline__sub-range {
  font-size: var(--lff-text-xs);
  color: var(--lff-navy-300);
  letter-spacing: var(--lff-tracking-wide);
}

.lff-book-outline__sub-title {
  font-size: var(--lff-text-base);
  font-weight: var(--lff-weight-medium);
  color: var(--lff-navy-600);
}


/* ==========================================================================
   8. THEME / KEYWORD TAGS
   Small tags for themes, keywords, or topics within a study section.
   ========================================================================== */

.lff-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-medium);
  letter-spacing: var(--lff-tracking-wide);
  padding: 0.2em 0.65em;
  border-radius: 999px;
  text-decoration: none;
  transition: all var(--lff-duration-fast) var(--lff-ease-out);
}

.lff-tag--theme {
  color: var(--lff-navy-600);
  background: var(--lff-navy-50);
  border: 1px solid var(--lff-navy-100);
}

.lff-tag--theme:hover {
  background: var(--lff-navy-100);
  color: var(--lff-navy-800);
}

.lff-tag--keyword {
  color: var(--lff-gold-600);
  background: var(--lff-gold-100);
  border: 1px solid var(--lff-gold-200);
}

.lff-tag--keyword:hover {
  background: var(--lff-gold-200);
  color: var(--lff-gold-600);
}


/* ==========================================================================
   9. APPLICATION / REFLECTION BOX
   A callout for personal application, reflection questions, or prayer.
   ========================================================================== */

.lff-reflection {
  background: var(--lff-surface-warm);
  border-radius: var(--lff-radius-lg);
  padding: var(--lff-space-lg);
  margin: var(--lff-space-xl) 0;
  position: relative;
}

.lff-reflection::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--lff-gold-400) 0%,
    var(--lff-gold-200) 100%
  );
  border-radius: var(--lff-radius-lg) 0 0 var(--lff-radius-lg);
}

.lff-reflection__label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-sm);
}

.lff-reflection__question {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-lg);
  font-style: italic;
  line-height: var(--lff-leading-relaxed);
  color: var(--lff-navy-700);
  margin-bottom: var(--lff-space-sm);
}

.lff-reflection__question:last-child {
  margin-bottom: 0;
}


/* ==========================================================================
   10. BOOK-SPECIFIC ACCENT OVERRIDES
   Each book study page sets --lff-book-accent via inline style or class.
   These rules propagate the accent throughout child components.
   ========================================================================== */

/* When a book accent is set, recolor key elements */
[style*="--lff-book-accent"] .lff-chapter-nav__link.is-active {
  background: var(--lff-book-accent);
}

[style*="--lff-book-accent"] .lff-verse-range,
[style*="--lff-book-accent"] .lff-passage-strip__ref,
[style*="--lff-book-accent"] .lff-word-study__lang-label,
[style*="--lff-book-accent"] .lff-reflection__label {
  color: var(--lff-book-accent);
}

[style*="--lff-book-accent"] .lff-passage-strip {
  border-left-color: var(--lff-book-accent);
}

[style*="--lff-book-accent"] .lff-verse-num {
  color: var(--lff-book-accent-dark, var(--lff-gold-600));
  background: var(--lff-book-accent-soft, var(--lff-gold-100));
}

[style*="--lff-book-accent"] .lff-tag--keyword {
  color: var(--lff-book-accent-dark, var(--lff-gold-600));
  background: var(--lff-book-accent-soft, var(--lff-gold-100));
  border-color: var(--lff-book-accent, var(--lff-gold-200));
}


/* ==========================================================================
   11. SCROLL ANIMATIONS — Bible Study Specific
   Staggered fade-in for verse sections, word studies, etc.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .lff-verse-section.lff-fade-in {
    transition-delay: 0ms;
  }

  .lff-verse-section.lff-fade-in:nth-child(2) { transition-delay: 80ms; }
  .lff-verse-section.lff-fade-in:nth-child(3) { transition-delay: 160ms; }
  .lff-verse-section.lff-fade-in:nth-child(4) { transition-delay: 240ms; }
  .lff-verse-section.lff-fade-in:nth-child(5) { transition-delay: 320ms; }

  .lff-dual-panel.lff-fade-in {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 600ms var(--lff-ease-out),
                transform 600ms var(--lff-ease-out);
  }

  .lff-dual-panel.lff-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .lff-word-study.lff-fade-in {
    opacity: 0;
    transform: translateY(1rem) scale(0.98);
    transition: opacity 500ms var(--lff-ease-out),
                transform 500ms var(--lff-ease-out);
  }

  .lff-word-study.lff-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ==========================================================================
   12. TWO-COLUMN STUDY LAYOUT
   Content + sidebar for larger screens (verse text on left, notes/xrefs on right).
   ========================================================================== */

.lff-study-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--lff-space-xl);
  max-width: var(--lff-wide-width);
  margin-inline: auto;
  padding-inline: var(--lff-gutter);
}

@media (min-width: 768px) {
  .lff-study-layout {
    grid-template-columns: 1fr 20rem;
  }
}

@media (min-width: 1024px) {
  .lff-study-layout {
    grid-template-columns: 1fr 24rem;
  }
}

.lff-study-layout__main {
  min-width: 0; /* prevent overflow */
}

.lff-study-layout__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--lff-space-lg);
}

/* Sticky sidebar on large screens */
@media (min-width: 768px) {
  .lff-study-layout__sidebar {
    position: sticky;
    top: 5rem; /* below chapter nav */
    align-self: start;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--lff-navy-100) transparent;
  }
}


/* ==========================================================================
   13. PRINT OVERRIDES FOR BIBLE STUDY
   ========================================================================== */

@media print {
  .lff-chapter-nav {
    display: none;
  }

  .lff-dual-panel {
    grid-template-columns: 1fr 1fr;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .lff-dual-panel__off {
    background: #f5f0f0;
    color: #333;
  }

  .lff-dual-panel__on {
    background: #f0f5f0;
    color: #333;
  }

  .lff-word-study {
    break-inside: avoid;
    border: 1px solid #ccc;
    background: #f9f9f9;
  }

  .lff-study-layout {
    grid-template-columns: 1fr;
  }

  .lff-study-layout__sidebar {
    position: static;
  }
}
