/* =============================================================================
   book_styles.css  â€”  TABLE OF CONTENTS
   Ctrl+F any section name to jump to its divider comment.
   =============================================================================

   LAYERS
     @layer reset ............... Box-sizing, scroll-behaviour
     @layer base ................ CSS custom properties, body defaults
     @layer utilities ........... .no-transition helper
     @layer themes .............. .dark-mode root overrides

   @layer components
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Â§01  GLASS NAVIGATION BAR
   Â§02  NAV SEARCH BAR
   Â§03  THEME TOGGLE & DASHBOARD LINK
   Â§04  CHAPTER NAVIGATION PILLS
   Â§05  LIGHT MODE
   Â§06  DARK MODE â€” TEXT ELEMENTS
   Â§07  DARK MODE â€” NAVIGATION & DROPDOWNS
   Â§08  DARK MODE â€” CHAPTER PILLS & DROPDOWN MENUS
   Â§09  DARK MODE â€” VERSE, SPINNER, FOOTER, ERROR
   Â§10  SCROLL TO TOP BUTTON
   Â§11  VERSE CONTAINER & FAVORITED STATE
   Â§12  VERSE TEXT, PROSE-BIBLE, CHAPTER HEADING
   Â§13  NEXT CHAPTER BUTTON
   Â§14  VERSE HIGHLIGHTS (TARGET, TTS, SEARCH PULSE)
   Â§15  FONT TOOLBAR SETTINGS
   Â§16  VERSE OVERFLOW MENU
   Â§17  NOTES SECTION & NOTE INPUT
   Â§18  DEEP-LINK VERSE HIGHLIGHT
   Â§19  HIGHLIGHTED TEXT & MEMORY MODE BUTTONS
   Â§20  CROSS-REFERENCE TAGS
   Â§21  VIEW TRANSITIONS
   Â§22  CROSS-REFERENCE TOOLTIPS
   Â§23  DICTIONARY LINKED WORDS & DICT TOOLTIP
   Â§24  EASTER EGG INDICATORS
   Â§25  EASTER EGG MODAL
   Â§26  CROSS-REFERENCE AUTOCOMPLETE
   Â§27  INDEX / HOME PAGE â€” TYPOGRAPHY & BASE
   Â§28  INDEX / HOME PAGE â€” LAYOUT & CONTAINERS
   Â§29  INDEX / HOME PAGE â€” COLORS & BACKGROUNDS
   Â§30  INDEX / HOME PAGE â€” HERO SECTION
   Â§31  INDEX / HOME PAGE â€” DAILY BREAD SECTION
   Â§32  INDEX / HOME PAGE â€” BOOKS SECTIONS
   Â§33  INDEX / HOME PAGE â€” VIDEO SECTION
   Â§34  SITE FOOTER (sf-* SYSTEM)
   Â§35  DARK MODE OVERRIDES FOR INDEX ELEMENTS
   Â§36  READER â€” SEMANTIC DECOUPLING CLASSES
   Â§37  READER â€” MAIN LAYOUT
   Â§38  READER â€” TOOLBAR
   Â§39  READER â€” READING MODE TOGGLE
   Â§40  READER â€” MOBILE TYPOGRAPHY FAB + BOTTOM SHEET
   Â§41  READER â€” READING MODE PROSE LAYOUT
   Â§42  READER â€” TTS BAR
   Â§43  READER â€” CHAPTER WRAP & SKELETON LOADER
   Â§44  READER â€” DYNAMIC ELEMENTS (LOADING, SENTINEL, ERROR)
   Â§45  READER â€” BOOK HEADER & TITLE
   Â§46  READER â€” READING PROGRESS PILL
   Â§47  READER â€” SAVE INDICATOR
   Â§48  READER â€” VERSE TEMPLATE OVERRIDES
   Â§49  READER â€” MEMORIZE & MEMORY BUTTONS
   Â§50  READER â€” NOTE DISPLAY & NOTES SECTION
   Â§51  GLOBAL ANIMATIONS
   Â§52  READER â€” SENTINEL / LOADING SPINNER (SECOND DEFINITION)
   =============================================================================
*/

@layer reset, base, components, themes, utilities;


@layer reset {
  * {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }
}

@layer base {
  :root {
    --verse-font-family: "Merriweather", serif;
    --verse-font-size: 1.125rem;
    --verse-text-color: #1f2937;
    --verse-line-height: 1.6;
    --color-parchment: #F9F8F6;
    --color-indigo-900: #1D2D44;
    --color-indigo-800: #2A3F5C;
    --color-indigo-50: #eef2ff;
    --color-crimson: #7A1B22;
    --color-gold-500: #C5A059;
    --color-gold-400: #D4B475;
    --color-gold-600: #b08d48;
    --color-slate-950: #020617;
    --color-slate-900: #09090b;
    --color-slate-800: #18181b;
    --color-slate-700: #334155;
    --color-slate-600: #475569;
    --color-slate-500: #64748b;
    --color-slate-400: #94a3b8;
    --color-slate-300: #cbd5e1;
    --color-slate-200: #e2e8f0;
    --color-slate-100: #f1f5f9;
    --color-slate-50: #f8fafc;
    --color-violet-500: #8b5cf6;
    --color-violet-600: #7c3aed;
    --color-orange-600: #ea580c;
    --color-orange-400: #fb923c;
    --color-orange-200: #fed7aa;
    --color-orange-800: #9a3412;
    --color-amber-100: #fef3c7;
    --color-orange-100: #ffedd5;
  }

  body {
    font-family: "Inter", sans-serif;
    background-color: #fafafa;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 0;
    margin: 0;
  }
}

@layer utilities {
  .no-transition * {
    transition: none !important;
  }

  .hidden {
    display: none !important;
  }
}

@layer themes {
  .dark-mode {
    --verse-text-color: #f5f5f5;
  }

  .dark-mode body {
    background-color: #09090b !important;
    color: #e5e7eb !important;
  }
}

@layer components {

  /* ========================================
     Â§01  GLASS NAVIGATION BAR
     ======================================== */

  .glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition:
      background 0.3s ease,
      border-color 0.3s ease;
  }

  .dark-mode .glass-nav {
    background: rgba(9, 9, 11, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  /* ========================================
     Â§02  NAV SEARCH BAR
     ======================================== */

  /* --- Nav Search Bar --- */
  .nav-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
  }

  .nav-search-input {
    width: 0;
    padding: 0;
    border: none;
    opacity: 0;
    font-family: "Inter", sans-serif;
    font-size: 0.825rem;
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition:
      width 0.3s ease,
      padding 0.3s ease,
      opacity 0.3s ease;
  }

  .nav-search-input::placeholder {
    color: #9ca3af;
  }

  .nav-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition:
      background-color 0.2s ease,
      color 0.2s ease,
      border-radius 0.3s ease;
    flex-shrink: 0;
  }

  .nav-search-btn:hover {
    background: #f3f4f6;
    color: #374151;
  }

  /* Expand on medium screens and up */
  @media (min-width: 768px) {
    .nav-search-input {
      width: 160px;
      padding: 7px 12px;
      border: 1px solid #d1d5db;
      border-right: none;
      opacity: 1;
    }

    .nav-search-input:focus {
      width: 220px;
      border-color: #9ca3af;
      box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.15);
    }

    .nav-search-btn {
      border-radius: 0 8px 8px 0;
    }
  }

  /* Dark mode */
  html.dark-mode .nav-search-input {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
  }

  html.dark-mode .nav-search-input::placeholder {
    color: #6b7280;
  }

  html.dark-mode .nav-search-input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
  }

  html.dark-mode .nav-search-btn {
    background: #2a2a2a;
    border-color: #404040;
    color: #9ca3af;
  }

  html.dark-mode .nav-search-btn:hover {
    background: #333333;
    color: #e0e0e0;
  }

  /* Custom scrollbar for the dropdown */
  .dropdown-scroll::-webkit-scrollbar {
    width: 6px;
  }

  .dropdown-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .dropdown-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
  }

  /* ========================================
     Â§03  THEME TOGGLE & DASHBOARD LINK
     ======================================== */

  /* Theme toggle button */
  #theme-toggle {
    display: flex;
    align-items: center;
    width: calc(100% - 16px);
    margin: 0 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background-color: transparent;
    color: #374151;
    transition:
      background-color 0.3s ease,
      color 0.3s ease;
  }

  #theme-toggle:hover {
    background-color: #f3f4f6;
    color: #111827;
  }

  #theme-toggle::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%239ca3af" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
  }

  /* Dashboard link icon */
  html.dark-mode #dashboard-link {
    background-color: #2a2a2a;
    --tw-ring-color: #404040;
    color: #e0e0e0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  }

  html.dark-mode #dashboard-link:hover {
    background-color: #333333;
  }

  /* ========================================
    CHAPTER NAVIGATION PILLS
    ======================================== */

  .chapter-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    background-color: #f3f4f6;
    text-decoration: none;
    transition:
      background-color 0.15s ease,
      color 0.15s ease,
      transform 0.15s ease,
      box-shadow 0.15s ease;
    cursor: pointer;
    user-select: none;
  }

  .chapter-pill:hover {
    background-color: #e5e7eb;
    color: #1f2937;
    transform: scale(1.08);
  }

  .chapter-pill-active {
    background-color: #1f2937;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  .chapter-pill-active:hover {
    background-color: #374151;
    color: #ffffff;
  }

  /* ========================================
    LIGHT MODE
    ======================================== */

  body.light-mode {
    background-color: #ffffff;
    color: #333333;
  }

  /* ========================================
    DARK MODE
    ======================================== */

  html.dark-mode {
    background-color: #09090b;
    color: #e5e7eb;
  }

  /* ========================================
     Â§34  SITE FOOTER (sf-* SYSTEM)
     ======================================== */

  /* --- site-footer Web Component â€” canonical sf-* system --- */
  /* Replaces the former site-footer-*, footer-top/link, and aux-footer variants */
  .sf-footer {
    background-color: #020617;
    /* slate-950 */
    color: var(--color-slate-400);
    padding: 4rem 0;
    border-top: 1px solid var(--color-slate-800);
  }

  .sf-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
  }

  @media (min-width: 640px) {
    .sf-container {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
  }

  @media (min-width: 1024px) {
    .sf-container {
      padding-left: 2rem;
      padding-right: 2rem;
    }
  }

  .sf-top {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  @media (min-width: 768px) {
    .sf-top {
      flex-direction: row;
    }
  }

  .sf-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  @media (min-width: 768px) {
    .sf-logo {
      margin-bottom: 0;
    }
  }

  .sf-logo-mark {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(197, 160, 89, 0.1);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gold-500);
    flex-shrink: 0;
  }

  .sf-logo-mark svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .sf-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-slate-200);
    letter-spacing: -0.025em;
  }

  .sf-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
    font-size: 0.875rem;
  }

  @media (min-width: 640px) {
    .sf-nav {
      display: flex;
      gap: 3rem;
    }
  }

  .sf-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-slate-400);
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .sf-nav-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
  }

  .sf-nav-link:hover {
    color: var(--color-gold-400);
  }

  .sf-nav-link.active {
    color: var(--color-gold-500);
    font-weight: 600;
  }

  .sf-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-slate-600);
    text-align: center;
  }

  @media (min-width: 768px) {
    .sf-bottom {
      flex-direction: row;
      text-align: left;
    }
  }

  .sf-legal {
    display: flex;
    gap: 1.5rem;
  }

  .sf-legal a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .sf-legal a:hover {
    color: var(--color-slate-400);
  }

  /* ========================================
     Â§51  GLOBAL ANIMATIONS
     ======================================== */

  /* --- Global Animations --- */
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }

  @keyframes pulse {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.5;
    }
  }

  @keyframes bounce {

    0%,
    100% {
      transform: translateY(-15%);
      animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
      transform: translateY(0);
      animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
  }

  /* Utility classes for animations (Tailwind compatibility) */
  .animate-spin {
    animation: spin 1s linear infinite;
  }

  .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  .animate-bounce {
    animation: bounce 1s infinite;
  }
}

