/**
 * Egyptian Gold Theme - Mechanical Bible
 * Consistent styling across all pages
 * Copyright (c) 2026 Tammy L Casey. All rights reserved.
 */

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Base */
body {
    font-family: 'Segoe UI', Georgia, serif;
    background: linear-gradient(135deg, #0a0808 0%, #1a1410 50%, #0a0808 100%);
    color: #c0a060;
    line-height: 1.4;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 10px 15px; }

/* Hero Header */
.hero {
    text-align: center;
    padding: 20px 20px 15px;
    background: linear-gradient(180deg, rgba(212,175,55,0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(212,175,55,0.3);
    margin-bottom: 15px;
}

h1 {
    font-size: 2em;
    color: #d4af37;
    text-shadow: 0 0 30px rgba(212,175,55,0.5);
    margin-bottom: 5px;
    letter-spacing: 3px;
}

.subtitle {
    color: #a08040;
    font-size: 1em;
    font-style: italic;
    margin-bottom: 8px;
}

.stats {
    color: #806030;
    font-size: 0.85em;
    letter-spacing: 1px;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
    flex-wrap: wrap;
    padding: 0 20px;
}

nav a {
    color: #d4af37;
    text-decoration: none;
    padding: 10px 18px;
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 4px;
    background: rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    font-size: 14px;
}

nav a:hover {
    background: rgba(212,175,55,0.2);
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.3);
}

nav a.active {
    background: rgba(212,175,55,0.25);
    border-color: #d4af37;
}

/* Section headers */
.section-header {
    color: #d4af37;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(212,175,55,0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header::before {
    content: '';
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37);
}

/* Chapter Navigation */
.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 12px 0;
}

.chapter-nav a {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212,175,55,0.4);
    text-decoration: none;
    color: #a08040;
    border-radius: 4px;
    font-size: 14px;
    background: rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.chapter-nav a:hover,
.chapter-nav a.active {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212,175,55,0.15);
    box-shadow: 0 0 10px rgba(212,175,55,0.2);
}

/* Verse Display — tight spreadsheet density */
.verse {
    margin: 0;
    padding: 8px 10px;
    background: rgba(20,15,10,0.9);
    border-bottom: 1px solid rgba(212,175,55,0.15);
}

.verse-ref {
    color: #d4af37;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.verse-gematria {
    display: inline;
    font-size: 12px;
    color: #806030;
    margin-left: 8px;
    font-family: 'Consolas', monospace;
}

/* Original text */
.original-text {
    font-size: 1.3em;
    line-height: 1.7;
    margin: 3px 0;
    padding: 3px 0;
}

.hebrew {
    direction: rtl;
    text-align: right;
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
}

.greek {
    direction: ltr;
    text-align: left;
    font-family: 'SBL Greek', 'Gentium', 'Times New Roman', serif;
}

/* Clickable words - always show transliteration */
.word {
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 2px;
    transition: background 0.15s;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: top;
    margin: 1px;
    color: #c0a060;
}

.word::after {
    content: attr(data-translit);
    display: block;
    font-size: 0.65em;
    color: #806030;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
    direction: ltr;
    line-height: 1.2;
}

.word:hover {
    background: rgba(212,175,55,0.2);
    color: #d4af37;
}

/* Translation */
.translation {
    font-size: 16px;
    line-height: 1.5;
    margin: 4px 0 0;
    padding: 0;
    color: #a08040;
    display: flex;
    flex-direction: column;
}
/* Display order: Oracle first, RMT second, Mechanical third, Toggle fourth */
.translation .oracle { order: 1; }
.translation .rmt { order: 2; }
.translation .mechanical { order: 3; }
.translation .toggle-translation { order: 4; }

/* RMT (Revised Mechanical) */
.translation .rmt {
    display: block;
    color: #c8a850;
    font-size: 16px;
    line-height: 1.5;
}
.translation .rmt::before {
    content: 'RMT: ';
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
}

/* Mechanical (word-for-word) */
.translation .mechanical {
    display: block;
    color: #8a7040;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}
.translation .mechanical::before {
    content: 'MECH: ';
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
}

/* Oracle (mathematical equivalence from Flask) */
.translation .oracle {
    display: block;
    color: #7090a0;
    font-size: 15px;
    line-height: 1.5;
}
.translation .oracle::before {
    content: 'ORACLE: ';
    color: #5088aa;
    font-size: 12px;
    font-weight: bold;
}

/* Toggle layer (user-selected: JPS, KJV, WEB, ASV, etc.) */
.translation .toggle-translation {
    display: block;
    color: #907850;
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;
}
.translation .toggle-translation::before {
    content: attr(data-label);
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
    font-style: normal;
}

/* Clickable translation words */
.tword {
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.2s ease, background 0.2s ease;
}
.tword:hover {
    color: #d4af37;
    background: rgba(212,175,55,0.12);
}

/* Translation selector in toolbar */
.translation-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.translation-selector label {
    color: #806030;
    font-size: 11px;
}
.translation-selector select {
    background: rgba(0,0,0,0.6);
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}
.translation-selector select:focus {
    border-color: #d4af37;
    outline: none;
}

/* RMT Translation Layer (natural English) */
.translation .rmt {
    display: block;
    color: #c8a850;
    font-size: 1em;
    line-height: 1.8;
}

/* Mechanical Translation Layer (word-for-word with prefix notation) */
.translation .mechanical {
    display: none;
    color: #8a7040;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(212,175,55,0.15);
}

/* Show mechanical layer when toggled */
.translation.show-mechanical .mechanical {
    display: block;
}
.translation.show-mechanical .rmt::before {
    content: 'RMT: ';
    color: #d4af37;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
}
.translation.show-mechanical .mechanical::before {
    content: 'MECH: ';
    color: #806030;
    font-size: 0.85em;
    font-weight: bold;
}

/* Info boxes */
.intro, .guide-box, .info-box {
    background: rgba(20,15,10,0.9);
    border: 1px solid rgba(212,175,55,0.3);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.intro h2, .guide-box h2, .info-box h2 {
    color: #d4af37;
    margin-bottom: 8px;
}

.intro p, .guide-box p, .info-box p {
    margin-bottom: 8px;
    color: #a08040;
}

.intro strong, .guide-box strong, .info-box strong {
    color: #d4af37;
}

/* Stats boxes */
.stats-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.stat {
    background: rgba(0,0,0,0.4);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(212,175,55,0.3);
}

.stat-number {
    font-size: 2em;
    color: #d4af37;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(212,175,55,0.4);
}

.stat-label {
    color: #806030;
    font-size: 0.85em;
    margin-top: 3px;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 30px 20px;
    background: rgba(0,0,0,0.4);
    border: 2px dashed rgba(212,175,55,0.5);
    border-radius: 8px;
    margin: 20px 0;
}

.coming-soon h2 {
    color: #d4af37;
    font-size: 1.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(212,175,55,0.4);
}

.coming-soon p {
    color: #a08040;
    font-size: 1em;
    max-width: 600px;
    margin: 0 auto 12px;
}

/* Feature list */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.feature {
    background: rgba(20,15,10,0.9);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #d4af37;
    border-top: 1px solid rgba(212,175,55,0.2);
    border-right: 1px solid rgba(212,175,55,0.2);
    border-bottom: 1px solid rgba(212,175,55,0.2);
}

.feature h3 {
    color: #d4af37;
    margin-bottom: 6px;
}

.feature p {
    color: #a08040;
}

/* Book grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.book-card {
    padding: 10px 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.3);
    text-decoration: none;
    color: #c0a060;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.book-card:hover {
    border-color: #d4af37;
    background: rgba(212,175,55,0.1);
    box-shadow: 0 0 20px rgba(212,175,55,0.2);
    transform: translateY(-2px);
}

.book-name {
    font-weight: 600;
    font-size: 14px;
    color: #d4af37;
}

.book-stats {
    font-size: 11px;
    color: #806030;
    margin-top: 5px;
}

/* History/Special boxes */
.history {
    background: rgba(30,20,10,0.9);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid rgba(139,69,19,0.5);
}

.history h3 {
    color: #d4af37;
    margin-bottom: 8px;
}

.history p {
    color: #a08040;
    margin-bottom: 8px;
}

/* Red Letter highlight */
.red-letter { color: #cc3333 !important; }

/* TSK highlight */
.tsk-ref { color: #5588cc !important; }

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #605030;
    font-size: 12px;
    border-top: 1px solid rgba(212,175,55,0.2);
    margin-top: 20px;
}

footer a {
    color: #a08040;
    text-decoration: none;
}

footer a:hover {
    color: #d4af37;
}

/* Letter breakdown for word modal */
.letter-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    justify-content: center;
}

.letter-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(212,175,55,0.3);
    padding: 6px 10px;
    border-radius: 3px;
    text-align: center;
    min-width: 50px;
}

.letter-char {
    font-size: 22px;
    color: #d4af37;
}

.letter-name {
    font-size: 9px;
    color: #806030;
    margin-top: 2px;
}

.letter-value {
    font-size: 12px;
    color: #d4af37;
    font-weight: bold;
}

/* Footnotes — compact */
.footnotes {
    margin-top: 2px;
    padding: 0;
    font-size: 11px;
}

.footnotes h4 {
    color: #806030;
    margin-bottom: 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline;
}

.footnote {
    margin: 0;
    padding-left: 12px;
    border-left: 1px solid rgba(212,175,55,0.3);
    color: #806030;
    font-size: 11px;
}

.footnote-marker {
    color: #d4af37;
    font-weight: bold;
}

.footnote-alt {
    color: #605030;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.8em; }
    .hero { padding: 30px 15px; }
    .container { padding: 20px 15px; }
    .book-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-list { grid-template-columns: 1fr; }
    nav { gap: 8px; }
    nav a { padding: 8px 12px; font-size: 13px; }
    .verse { padding: 6px 8px; }
    .original-text { font-size: 1.1em; }
}

/* Study Tools grid (landing page) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.tool-card {
    padding: 15px;
    background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(20,15,10,0.9) 100%);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 6px;
    text-decoration: none;
    color: #c0a060;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212,175,55,0.3);
}

.tool-name {
    font-weight: 600;
    font-size: 14px;
    color: #d4af37;
    margin-bottom: 5px;
}

.tool-stats {
    font-size: 11px;
    color: #806030;
}

/* Credit section */
.credit-section {
    background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(20,15,10,0.9) 100%);
    border: 1px solid rgba(212,175,55,0.3);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
}

.credit-section h3 {
    color: #d4af37;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.credit-section p {
    color: #a08040;
    line-height: 1.6;
}

.credit-section a {
    color: #d4af37;
    text-decoration: none;
    border-bottom: 1px solid rgba(212,175,55,0.5);
}

.credit-section a:hover { border-bottom-color: #d4af37; }

.credit-quote {
    margin-top: 10px;
    font-style: italic;
    color: #806030;
}

/* Hieroglyph decoration */
.hieroglyph {
    font-size: 2em;
    color: #d4af37;
    opacity: 0.7;
}

/* ============================================
   UNIFIED SITE HEADER (LOGOS)
   Injected by site-header.js
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #0a0808 0%, rgba(10,8,8,0.95) 100%);
    border-bottom: 1px solid rgba(212,175,55,0.4);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.site-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 28px;
    font-weight: bold;
    color: #d4af37;
    text-decoration: none;
    letter-spacing: 8px;
    text-shadow: 0 0 30px rgba(212,175,55,0.6);
    font-family: 'Trajan Pro', 'Times New Roman', serif;
}

.site-logo:hover {
    text-shadow: 0 0 40px rgba(212,175,55,0.9);
}

.site-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.site-nav a {
    color: #c0a060;
    text-decoration: none;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.site-nav a:hover {
    color: #d4af37;
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.3);
}

.site-nav a.active {
    color: #d4af37;
    background: rgba(212,175,55,0.15);
    border-color: rgba(212,175,55,0.4);
}

.site-nav a.red-letter {
    color: #cc3333;
}

.site-nav a.red-letter:hover {
    color: #ff4444;
    background: rgba(204,51,51,0.1);
    border-color: rgba(204,51,51,0.3);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: #d4af37;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Body padding for fixed header */
body {
    padding-top: 65px;
}

/* ============================================
   UNIFIED SITE FOOTER
   Injected by site-footer.js
   ============================================ */

.site-footer {
    background: linear-gradient(0deg, #0a0808 0%, rgba(10,8,8,0.95) 100%);
    border-top: 1px solid rgba(212,175,55,0.3);
    padding: 15px 20px;
    text-align: center;
    margin-top: 20px;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #a08040;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #d4af37;
}

.footer-nav .divider {
    color: rgba(212,175,55,0.3);
}

.site-footer .copyright {
    color: #605030;
    font-size: 12px;
    margin-bottom: 8px;
}

.site-footer .tagline {
    color: #d4af37;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE - Site Header/Footer
   ============================================ */

@media (max-width: 900px) {
    .site-nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: #0a0808;
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid rgba(212,175,55,0.3);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .site-nav.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav a {
        padding: 12px 20px;
        width: 100%;
        text-align: center;
        border: 1px solid rgba(212,175,55,0.2);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .site-logo {
        font-size: 22px;
        letter-spacing: 5px;
    }
}

@media (max-width: 480px) {
    .site-header-inner {
        padding: 10px 15px;
    }

    .site-logo {
        font-size: 18px;
        letter-spacing: 4px;
    }

    body {
        padding-top: 55px;
    }

    .site-nav {
        top: 55px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 10px;
    }

    .footer-nav .divider {
        display: none;
    }
}


/* ============================================================
   VIEW TOOLBAR - Interlinear / Parallel / Grammar / Search
   ============================================================ */

.view-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    background: rgba(30, 20, 10, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    align-items: center;
}

.view-toolbar button {
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.view-toolbar button:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
    color: #fff;
}

.view-toolbar button.active {
    background: #d4af37;
    color: #1a0f00;
    border-color: #d4af37;
    font-weight: 600;
}

.view-toolbar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ============================================================
   INTERLINEAR VIEW
   ============================================================ */

.interlinear-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 10px;
    direction: rtl;
    justify-content: flex-start;
}

.interlinear-word {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 10px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.interlinear-word:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.il-hebrew {
    font-size: 22px;
    color: #d4af37;
    font-family: 'SBL Hebrew', 'Frank Ruehl CLM', 'Ezra SIL', serif;
    margin-bottom: 4px;
    direction: rtl;
}

.il-translit {
    font-size: 12px;
    color: #c0a060;
    font-style: italic;
    margin-bottom: 3px;
    direction: ltr;
}

.il-gloss {
    font-size: 11px;
    color: #a08850;
    max-width: 100px;
    word-wrap: break-word;
    direction: ltr;
}


/* ============================================================
   PARALLEL VIEW
   ============================================================ */

.parallel-verse {
    display: flex;
    gap: 20px;
    padding: 12px;
    margin: 8px 0;
    background: rgba(30, 20, 10, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
}

.parallel-hebrew {
    flex: 1;
    text-align: right;
    border-right: 2px solid rgba(212, 175, 55, 0.3);
    padding-right: 15px;
}

.parallel-english {
    flex: 1;
    text-align: left;
    padding-left: 15px;
}

.parallel-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a08040;
    margin-bottom: 8px;
    font-weight: 600;
}

.parallel-english-text {
    color: #c0a060;
    line-height: 1.7;
    font-size: 15px;
}

.parallel-active .verse-ref {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .parallel-verse {
        flex-direction: column;
    }

    .parallel-hebrew {
        border-right: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        padding-right: 0;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .parallel-english {
        padding-left: 0;
    }
}


/* ============================================================
   GRAMMAR VIEW - Color Legend
   ============================================================ */

.grammar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    margin: 0 0 10px 0;
    background: rgba(30, 20, 10, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
}

.grammar-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #a0906a;
}

.grammar-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}


/* ============================================================
   SEARCH MODAL
   ============================================================ */

.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 0, 0.92);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 8vh;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    background: #1a1000;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.search-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    gap: 8px;
}

.search-header input {
    flex: 1;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 3px;
    padding: 6px 10px;
    color: #d4af37;
    font-size: 14px;
    outline: none;
}

.search-header input::placeholder {
    color: rgba(212, 175, 55, 0.4);
}

.search-header input:focus {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
}

.search-close {
    background: none;
    border: none;
    color: #a08040;
    font-size: 28px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.search-close:hover {
    color: #d4af37;
}

.search-results {
    overflow-y: auto;
    padding: 6px 10px;
    flex: 1;
}

.search-result-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.3);
}

.search-result-item .search-hebrew {
    font-size: 20px;
    color: #d4af37;
    font-family: 'SBL Hebrew', 'Frank Ruehl CLM', serif;
    direction: rtl;
}

.search-result-item .search-translit {
    font-size: 13px;
    color: #c0a060;
    font-style: italic;
}

.search-result-item .search-definition {
    font-size: 13px;
    color: #a08850;
    margin-top: 4px;
}

.search-result-item .search-strongs {
    font-size: 11px;
    color: #807040;
    margin-top: 3px;
}

.search-result-item .search-verse-link {
    font-size: 12px;
    color: #d4af37;
    text-decoration: underline;
    margin-top: 4px;
    display: inline-block;
}

.search-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #806830;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.search-empty {
    text-align: center;
    color: #806830;
    padding: 15px 10px;
    font-size: 13px;
}

.search-highlight {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
    padding: 1px 3px;
    border-radius: 2px;
}

.search-count {
    font-size: 11px;
    color: #806830;
    padding: 4px 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    text-align: center;
}

@media (max-width: 600px) {
    .search-modal-content {
        width: 96%;
        max-height: 90vh;
    }

    .search-modal {
        padding-top: 3vh;
    }

    .view-toolbar {
        gap: 5px;
        padding: 8px 10px;
    }

    .view-toolbar button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .interlinear-word {
        min-width: 50px;
        padding: 6px 8px;
    }

    .il-hebrew {
        font-size: 18px;
    }

    .grammar-legend {
        gap: 6px;
        padding: 8px 10px;
    }

    .grammar-legend-item {
        font-size: 10px;
    }
}


/* ============================================================
   SUPERSCRIPT NOTE REFERENCES
   ============================================================ */

.note-ref {
    color: #d4af37;
    cursor: pointer;
    font-size: 0.7em;
    vertical-align: super;
    padding: 0 2px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.note-ref:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(212,175,55,0.6);
}


/* ============================================================
   COLLAPSIBLE VERSE NOTES (footnotes + cross-refs wrapper)
   ============================================================ */

.verse-notes {
    margin-top: 2px;
    padding: 4px 8px;
    font-size: 11px;
}

.verse-notes[hidden] {
    display: none;
}

@keyframes noteReveal {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.verse-notes h4 {
    color: #d4af37;
    margin-bottom: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footnotes inside verse-notes */
.footnotes {
    margin-bottom: 15px;
}

.footnote {
    margin: 10px 0;
    padding-left: 20px;
    border-left: 2px solid rgba(212,175,55,0.4);
    color: #a08040;
}

.footnote-marker {
    color: #d4af37;
    font-weight: bold;
}

.footnote-alt {
    color: #806030;
    font-style: italic;
}

/* Cross-references */
.cross-refs {
    margin-top: 1px;
}

.cross-refs h4 {
    font-size: 10px;
    color: #806030;
    display: inline;
}

.cross-refs ul {
    list-style: none;
    padding: 0;
    display: inline;
}

.cross-refs li {
    display: inline;
    padding: 0;
    color: #806030;
    font-size: 11px;
}

.cross-refs li::after {
    content: ' | ';
    color: rgba(212,175,55,0.2);
}

.ref-verse {
    color: #d4af37;
    font-weight: 600;
}

.ref-topic {
    color: #806030;
    margin-left: 5px;
}

.theme-tag {
    display: inline-block;
    background: rgba(212,175,55,0.15);
    color: #d4af37;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 8px;
    vertical-align: middle;
}
