/* =====================================================================
   CMI LifeTech — Chapel 3: Lexicon (聖言學堂 · Reliquary Treasury & Seals)
   ===================================================================== */

.lexicon-header-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

/* ── 1. Reliquary Architrave Summary ─────────────────────── */
.lexicon-summary-card {
    background: var(--card-bg-elevated);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 24px;
    text-align: center;
    box-shadow: var(--shadow-holy), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
}
.lexicon-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: radial-gradient(circle, var(--holy-gold-bright) 0%, transparent 80%);
}
.lexicon-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lexicon-stat-number {
    font-family: var(--font-gothic-deco);
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--holy-gold-bright);
    line-height: 1;
    text-shadow: 0 0 16px var(--holy-gold-glow);
}
.lexicon-stat-label {
    font-family: var(--font-holy);
    font-size: 0.86rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    margin-top: 8px;
    text-transform: uppercase;
}

/* ── 2. Filter Bar & Lapidary Search ─────────────────────── */
.lexicon-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    width: 100%;
    margin-bottom: 26px;
}

.lexicon-search-input {
    flex: 1;
    min-width: 240px;
    background: var(--input-bg);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full);
    padding: 12px 22px 12px 46px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-processional);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e2ba4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 18px center;
}
.lexicon-search-input:focus {
    border-color: var(--holy-gold-bright);
    box-shadow: 0 0 20px var(--holy-gold-glow);
}

.lexicon-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.lex-chip {
    background: var(--card-bg);
    border: 1px solid var(--border-engraved);
    border-radius: var(--radius-full);
    padding: 10px 16px;
    min-height: 44px;
    font-family: var(--font-holy);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-processional);
}
.lex-chip:hover {
    border-color: var(--border-gold);
    color: var(--holy-gold-bright);
}
.lex-chip.active {
    background: linear-gradient(135deg, rgba(226, 186, 77, 0.25) 0%, rgba(232, 155, 81, 0.35) 100%);
    border-color: var(--holy-gold-bright);
    color: var(--holy-gold-bright);
    font-weight: 700;
    box-shadow: 0 0 14px var(--holy-gold-glow);
}
body:not(.dark-theme) .lex-chip.active {
    color: var(--holy-dark);
}

/* ── 3. Reliquary View Toggle ────────────────────────────── */
.lexicon-view-toggle {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full);
    padding: 4px;
}
.lex-toggle-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: var(--radius-full);
    font-family: var(--font-holy);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-processional);
    display: flex;
    align-items: center;
    gap: 8px;
}
.lex-toggle-btn.active {
    background: var(--holy-gold-bright);
    color: #100a1c;
    box-shadow: 0 2px 12px var(--holy-gold-glow);
}

/* ── 4. Reliquary Word Cards Grid ────────────────────────── */
.lexicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
    margin-top: 18px;
    min-height: 280px;
}

.lexicon-word-card {
    background: var(--card-bg-elevated);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-holy);
    position: relative;
    transition: var(--transition-processional);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    overflow: hidden;
}
@media (hover: hover) {
    .lexicon-word-card:hover {
        transform: translateY(-4px);
        border-color: var(--holy-gold-bright);
        box-shadow: var(--shadow-holy), 0 0 30px var(--holy-gold-glow);
    }
}
.lexicon-word-card.hebrew-card {
    border-top: 4px solid var(--accent-hebrew);
}
.lexicon-word-card.greek-card {
    border-top: 4px solid var(--accent-greek);
}

.word-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.word-lang-tag {
    font-size: 0.76rem;
    font-family: var(--font-holy);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.word-lang-tag.hebrew {
    background: rgba(30, 85, 125, 0.18);
    color: var(--accent-hebrew);
    border: 1px solid rgba(75, 163, 227, 0.35);
}
.word-lang-tag.greek {
    background: rgba(94, 26, 122, 0.18);
    color: var(--accent-greek);
    border: 1px solid rgba(199, 125, 255, 0.35);
}

/* Wax Seal Impression Badges */
.word-mastery-badge {
    font-family: var(--font-holy);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(226, 186, 77, 0.12);
    color: var(--holy-gold-bright);
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: var(--transition-processional);
    letter-spacing: 0.05em;
}
.word-mastery-badge:hover {
    background: var(--holy-gold-bright);
    color: #100a1c;
    box-shadow: 0 0 12px var(--holy-gold-glow);
}

/* Lapidary Original Script Display */
.original-script-display {
    font-family: var(--font-ancient);
    font-size: 2.35rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 8px 0;
    letter-spacing: 0.04em;
}
.original-script-display.hebrew {
    direction: rtl;
    text-align: right;
    color: var(--accent-hebrew);
}
.original-script-display.greek {
    color: var(--accent-greek);
}

.word-transliteration {
    font-family: var(--font-holy);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.word-definition {
    font-family: var(--font-holy);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.word-theological-note {
    font-size: 0.88rem;
    line-height: 1.68;
    color: var(--text-secondary);
    margin-bottom: 14px;
    flex-grow: 1;
}

.word-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    margin-top: auto;
}
.pronounce-btn {
    background: rgba(226, 186, 77, 0.08);
    border: 1px solid var(--border-gold);
    color: var(--holy-gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-processional);
}
.pronounce-btn:hover {
    background: var(--holy-gold-bright);
    color: #100a1c;
    transform: scale(1.1);
    box-shadow: 0 0 12px var(--holy-gold-glow);
}

/* ── 5. 3D Folio Turn Flashcard Arena ────────────────────── */
.flashcard-arena {
    max-width: 540px;
    margin: 24px auto 44px auto;
    -webkit-perspective: 1400px;
    perspective: 1400px;
}
.flashcard-container {
    width: 100%;
    height: 360px;
    position: relative;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}
.flashcard-container.is-flipped {
    transform: rotateY(180deg);
}
.flashcard-face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--card-bg-elevated);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-holy), 0 0 45px var(--holy-gold-glow);
    padding: 38px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.flashcard-face.back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--card-bg-elevated) 0%, rgba(226, 186, 77, 0.08) 100%);
}

.flashcard-hint {
    position: absolute;
    bottom: 16px;
    font-family: var(--font-holy);
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

.flashcard-nav-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    margin-top: 24px;
}

