/*
 * The Flexbox Shield: Visual Rigidity & Antiquity Interface
 * Architectural Mandate: Physical Bible Layout, Parchment Context, Hanging Indents
 */

:root {
    /* Color Palette: Physical Antiquity */
    --garrison-bg: #e9e3d3;         /* Outer desk/table context */
    --garrison-surface: #f8f5ee;    /* The Parchment Page */
    --garrison-text: #1a1815;       /* Deep ink black/brown */
    --garrison-accent: #8b0000;     /* Deep crimson marker */
    --kjv-red-letter: #b71c1c;      /* Words of Christ */
    --sanctuary-blue: #2c3e50;      /* Dark slate for UI elements */
    --leather-bind: #3b1717;        /* Burgundy Cover */
    --gold-leaf: #d4af37;           /* Embossed Gold */
    
    /* Typography Constraints */
    --font-scripture: 'Georgia', 'Times New Roman', serif;
    --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--garrison-bg);
    color: var(--garrison-text);
    font-family: var(--font-ui);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.garrison-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-grow: 1;
}

.flex-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 768px) { .flex-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .flex-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- The Physical Book Layout --- */
.bible-page {
    background-color: var(--garrison-surface);
    border: 1px solid #dcd3b6;
    border-radius: 4px;
    box-shadow: 
        inset 0 0 40px rgba(0,0,0,0.02), /* Paper texture illusion */
        0 10px 20px rgba(0,0,0,0.1),     /* Book depth shadow */
        -2px 0 5px rgba(0,0,0,0.05);     /* Spine shadow */
    padding: 2.5rem;
    font-family: var(--font-scripture);
}

.bible-chapter-title {
    text-align: center;
    text-transform: uppercase;
    font-size: 1.75rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dcd3b6;
    padding-bottom: 0.5rem;
}

/* Classic Hanging Indent for Verses */
.verse-block {
    text-indent: -1.2em;
    padding-left: 1.2em;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    line-height: 1.5;
}

.verse-num {
    font-weight: bold;
    font-size: 0.75em;
    vertical-align: super;
    margin-right: 0.15rem;
}

/* UI Shields */
.shield-card {
    background-color: var(--garrison-surface);
    border: 1px solid #dcd3b6;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.shield-card-header, .shield-card-body, .shield-card-footer { padding: 1.5rem; }
.shield-card-body { flex-grow: 1; }

.garrison-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-family: var(--font-ui);
    font-size: 1rem;
}

.garrison-btn {
    display: inline-block;
    background-color: var(--leather-bind);
    color: var(--garrison-surface);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.garrison-btn:hover { opacity: 0.9; }
.trap-field { position: absolute; left: -9999px; top: -9999px; visibility: hidden; }

/* --- Enterprise Desktop Expansion --- */
@media (min-width: 1024px) {
    .bible-page {
        padding: 3rem 4rem;
        column-count: 2;         /* Traditional Double-Column Bible Layout */
        column-gap: 4rem;
        column-rule: 1px solid #dcd3b6;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .bible-chapter-title {
        column-span: all;        /* Title spans across both columns */
        margin-bottom: 2rem;
    }
}

/* --- The Lexicon Interaction (Clickable Words) --- */
.s-word {
    cursor: pointer;
    border-bottom: 1px dashed #bba371;
    color: inherit;
    transition: all 0.2s ease;
}

.s-word:hover {
    color: var(--garrison-accent);
    background-color: rgba(212, 175, 55, 0.15); /* Subtle gold highlight */
    border-bottom: 1px solid var(--garrison-accent);
}

/* --- The Enterprise Lexicon Modal --- */
.lexicon-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 24, 21, 0.6); /* Darkened room effect */
    backdrop-filter: blur(3px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lexicon-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -45%);
    width: 90%; max-width: 550px;
    background: var(--garrison-surface);
    border: 2px solid var(--leather-bind);
    border-radius: 6px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: var(--font-ui);
}

.lexicon-modal.active, .lexicon-overlay.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%); /* Snaps modal into place */
}

.lexicon-header {
    background: var(--leather-bind);
    color: var(--gold-leaf);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #240e0e;
}

.lexicon-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    color: var(--garrison-text);
}

.lexicon-lemma {
    font-size: 1.5rem;
    font-family: var(--font-scripture);
    color: var(--garrison-accent);
    margin-bottom: 0.5rem;
}