/* ==========================================================================
   1. COLOR SOURCE OF TRUTH (:root)
   ==========================================================================
*/
:root {
    /* Backgrounds & Surfaces */
    --bg-body: #fdfdfb;           /* Your new color choice */
    --bg-surface: #ffffff;
    --bg-hero: linear-gradient(135deg, #fdfbf7 0%, #f1f5f9 100%);
    --bg-accent-card: #f8fafc;
    
    /* Brand & Scholar Colors */
    --brand-primary: #1a365d;     /* Deep Scholar Blue */
    --brand-secondary: #1e40af;   /* Heritage Blue */
    --brand-gradient: linear-gradient(135deg, #1a365d 0%, #1e40af 100%);
    
    /* Typography */
    --text-heading: #1a365d;
    --text-main: #4a5568;
    --text-muted: #64748b;
    --text-on-dark: #f8fafc;
    
    /* Decoration & Functional */
    --border-subtle: #e2e8f0;
    --root-highlight: #f7f3e9;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
}

/* ==========================================================================
   2. AUTOMATIC DARK MODE 
   ==========================================================================
*/
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f172a;       /* Midnight Ink */
        --bg-surface: #1e293b;
        --bg-hero: linear-gradient(135deg, #020617 0%, #0f172a 100%);
        --bg-accent-card: #1e293b;
        
        --brand-primary: #3b82f6;
        --brand-secondary: #60a5fa;
        --brand-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        
        --text-heading: #f8fafc;
        --text-main: #cbd5e1;
        --text-muted: #94a3b8;
        --border-subtle: #334155;
        --root-highlight: #2d3748;
        --shadow-sm: 0 4px 20px rgba(0,0,0,0.3);
    }
}

/* ==========================================================================
   3. CORE ELEMENT STYLING
   ==========================================================================
*/
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, .navbar-brand, .word-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
}

.navbar {
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--border-subtle);
}

/* ==========================================================================
   4. SCHOLARLY DETAILS
   ==========================================================================
*/
em, .root-word {
    font-family: 'Courier New', monospace;
    font-style: italic;
    background: var(--root-highlight);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--brand-secondary);
}

.hero-section {
    position: relative;
    background: var(--bg-hero);
    padding: 100px 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/natural-paper.png");
    opacity: 0.2;
    pointer-events: none;
}

/* ==========================================================================
   5. POST & ARTICLE INTERFACE
   ==========================================================================
*/
.post-hero {
    background: var(--brand-gradient);
    padding: 3.5rem 0;
    color: var(--text-on-dark);
}

.word-title {
    color: var(--text-on-dark);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.pronunciation-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.etymology-card {
    background: var(--bg-accent-card);
    border-left: 4px solid var(--brand-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    color: var(--text-main);
}

.content-area {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    line-height: 1.8;
}

.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-secondary);
}

.info-card-icon {
    width: 48px;
    height: 48px;
    background: var(--brand-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Timeline Components */
.timeline-card {
    background: var(--bg-surface);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.timeline-card::before {
    content: '';
    position: absolute;
    left: 2.5rem;
    top: 3rem;
    bottom: 2rem;
    width: 3px;
    background: var(--brand-gradient);
}