/* ═══════════════════════════════════════════════════════
   Lexicon Dictionary Browser — Sidebar Cards + Lexicon Tab
   ═══════════════════════════════════════════════════════ */

/* ─── Sidebar Header ─── */

.lexicon-sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 5;
}

.lexicon-search-bar {
    margin-bottom: 0.5rem;
}

.lexicon-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.lexicon-search-input:focus {
    border-color: var(--primary);
}

.lexicon-lang-toggle {
    display: flex;
    gap: 0.25rem;
}

.lexicon-lang-btn {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.lexicon-lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.lexicon-lang-btn:hover:not(.active) {
    background: var(--highlight);
}

/* ─── Word Cards ─── */

.lexicon-card-list {
    padding: 0.5rem;
}

.lexicon-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.lexicon-card:hover {
    background: var(--highlight);
    border-color: var(--primary);
}
.lexicon-card.expanded {
    border-color: var(--primary);
    background: var(--highlight);
}

.lexicon-card-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lexicon-card-num {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
}

.lexicon-card-lemma {
    font-size: 1.25rem;
    font-family: 'Times New Roman', Georgia, serif;
    font-weight: 400;
}

.lexicon-card-translit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.lexicon-card-tag-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: auto;
}

.lexicon-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lexicon-note-indicator {
    font-size: 0.75rem;
}

.lexicon-card-def {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* ─── Expanded Card ─── */

.lexicon-expanded {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 8px;
}

.lexicon-expanded-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.lexicon-expanded-num {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.lexicon-expanded-lemma {
    font-size: 1.5rem;
    font-family: 'Times New Roman', Georgia, serif;
    font-weight: 400;
}

.lexicon-expanded-translit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.lexicon-expanded-source {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: var(--highlight);
    border-radius: 4px;
    color: var(--text-secondary);
}

.lexicon-expanded-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.5rem;
}

/* Lexicon tag button uses .verse-action-btn from styles.css */

.lexicon-expanded-def {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    word-break: break-word;
}

/* Lexicon entry HTML classes (from build script) */
.lexicon-expanded-def .lex-entry { }
.lexicon-expanded-def .lex-hebrew,
.lexicon-tab-def .lex-hebrew {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.1em;
    direction: rtl;
    unicode-bidi: embed;
}
.lexicon-expanded-def .lex-hebrew-word,
.lexicon-tab-def .lex-hebrew-word {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.1em;
    color: var(--primary);
}
.lexicon-expanded-def .lex-greek,
.lexicon-tab-def .lex-greek {
    font-family: 'Crimson Text', serif;
    font-style: italic;
}
.lexicon-expanded-def .lex-gloss,
.lexicon-tab-def .lex-gloss {
    font-style: italic;
    color: var(--primary);
}
.lexicon-expanded-def .lex-ref,
.lexicon-tab-def .lex-ref {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline dotted;
}
.lexicon-expanded-def .lex-ref:hover,
.lexicon-tab-def .lex-ref:hover {
    text-decoration: underline solid;
}
.lexicon-expanded-def .lex-sense,
.lexicon-tab-def .lex-sense {
    margin: 0.5rem 0;
    padding-left: 1rem;
}
.lexicon-expanded-def .lex-etym,
.lexicon-tab-def .lex-etym {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.lexicon-expanded-def .lex-sub1,
.lexicon-tab-def .lex-sub1 {
    padding-left: 1rem;
}
.lexicon-expanded-def .lex-sub2,
.lexicon-tab-def .lex-sub2 {
    padding-left: 2rem;
}
.lexicon-expanded-def .lex-bdb p,
.lexicon-tab-def .lex-bdb p {
    margin: 0.3rem 0;
}

/* Cross-references */
.lexicon-cross-refs {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--highlight);
    border-radius: 6px;
}

.lexicon-xref {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin: 0.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--primary);
    transition: all 0.2s;
}
.lexicon-xref:hover {
    background: var(--primary);
    color: white;
}

/* Cross-refs that open WordStudyModal — consistent with Deeper Study button */
.lexicon-xref-study {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-color: var(--primary-light);
    font-weight: 600;
}
.lexicon-xref-study:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: transparent;
    color: white;
}

/* ─── Notes Section ─── */

.lexicon-notes-section {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.lexicon-notes-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.lexicon-notes-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--background);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.lexicon-notes-textarea:focus {
    border-color: var(--primary);
}

.lexicon-notes-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.lexicon-notes-saved {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ─── Lexicon Tab in Strong's Display ─── */

.lexicon-tab-content {
    font-size: 0.85rem;
    line-height: 1.6;
}

.lexicon-tab-source {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    background: var(--highlight);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lexicon-tab-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
/* Lexicon tab tag button uses .verse-action-btn from styles.css */
.lexicon-tab-actions .lexicon-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lexicon-tab-def {
    font-size: 0.85rem;
    line-height: 1.6;
}

.lexicon-tab-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
}

.lexicon-tab-hint {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ─── Loading + Empty States ─── */

.lexicon-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.lexicon-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ─── Scroll sentinel for infinite loading ─── */

.lexicon-scroll-sentinel {
    height: 1px;
    width: 100%;
}

/* Strong's prefix education card — token-themed (was inline parchment) */
.sv-prefix-card {
    background: var(--gold-bg);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.sv-prefix-title { font-weight: 600; color: var(--gold-text); margin-bottom: 0.5rem; }
.sv-prefix-text { color: var(--gold-text); }
.sv-prefix-strong { color: var(--gold-text); font-weight: 600; }
.sv-prefix-chip {
    background: var(--gold);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}
.sv-prefix-note {
    background: var(--surface);
    border-left: 3px solid var(--gold);
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gold-text);
}
.sv-prefix-letter { color: var(--danger); font-weight: bold; }
.sv-prefix-form {
    background: var(--surface);
    border: 1px solid var(--gold);
}

/* ─── The word header (approved mock frame 3, 2026-09-01): the word is
   said ONCE — gold eyebrow, hero word + transliteration, prefix
   equation only when real, dictionary form as one quiet line only when
   it differs, forms expander as a quiet link. ─── */
.sv-word-eyebrow {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-text);
    margin-bottom: 0.35rem;
}
.sv-word-hero {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
    min-width: 0;
}
.sv-word-heb {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text-primary);
    min-width: 0;
    overflow-wrap: anywhere;
}
.sv-word-translit {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}
.sv-word-pron {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}
.sv-breakdown {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}
.sv-bk-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: 9px;
    padding: 0.18rem 0.55rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.sv-bk-chip b {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 400;
}
.sv-bk-lemma {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.35);
}
.sv-bk-plus { color: var(--text-secondary); font-weight: 600; }
.sv-bk-result { font-size: 0.85rem; color: var(--text-secondary); }
.sv-dict-quiet {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.55rem;
}
.sv-dict-quiet b {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-primary);
}
.sv-forms { margin-top: 0.6rem; }
.sv-forms-link {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
}
.sv-forms-link::-webkit-details-marker { display: none; }
.sv-forms-link::after { content: ' \25B8'; }
.sv-forms[open] .sv-forms-link::after { content: ' \25BE'; }
.sv-word-hr {
    height: 1px;
    background: var(--border);
    margin: 0.9rem 0;
}

/* ─── Word panel tabs — same bones, era clothes: quiet labels, purple
   underline on the active one, counts as muted numerals. ─── */
.sv-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.sv-tabs .tab-btn {
    flex: 1;
    padding: 0.45rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--text-secondary);
    cursor: pointer;
}
.sv-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: none;
}
.sv-tab-n {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
}
