/* Global Reset & Typography */
:root {
    --bg-body: #FDFDFD; /* Cream Whites */
    --bg-light: #ffffff;
    --text-main: #800020; /* Deep Burgundy */
    --text-muted: #B76E79; /* Soft Rose Gold */
    --accent: #B76E79; /* Soft Rose Gold */
    --border-color: #e5c3c8;
    --trust-blue: #0070ba; /* PayPal/Payment Blue */

    --font-heading: 'Lora', serif;
    --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #121212; /* Deep Charcoal */
        --bg-light: #1E1E1E;
        --text-main: #E5C3C8; /* Soft Rose Gold Text */
        --text-muted: #B76E79;
        --accent: #D4AF37; /* Warm Gold */
        --border-color: #333333;
        --trust-blue: #1E90FF; /* Brighter Blue for Dark Mode */
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.7);
    }
}

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

body {
    font-family: var(--font-body);
    font-size: 18px; /* Slightly larger for readability */
    line-height: 1.8; /* Increased line-height for scholarly feel */
    color: var(--text-main);
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-top: 0;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; color: var(--accent); }

p { margin-bottom: 1.5rem; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; outline: none; }
a:hover { text-decoration: underline; }

/* 2026 WCAG Accessibility Focus States */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Layout Containers */
.container {
    width: 90%;
    max-width: 900px; /* Journal width */
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header & Navigation (2026 Glassmorphism) */
header {
    background-color: rgba(253, 253, 253, 0.85); /* Cream Whites */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

@media (prefers-color-scheme: dark) {
    header {
        background-color: rgba(30, 30, 30, 0.85); /* Deep Charcoal */
    }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Reading Progress Bar */
#reading-progress-container {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    z-index: 1001;
}

#reading-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--accent);
    transition: width 0.1s ease;
}

/* Site Brand in Nav (was H1, now div for semantic correctness Law #16) */
.site-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    border: none;
    padding: 0;
    color: var(--text-main);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Journal Entry Styling */
.journal-entry {
    background: var(--bg-light);
    /* Subtle paper noise texture */
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9IjAuMDIiLz4KPC9zdmc+');
    padding: 3rem;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    animation: fadeIn 0.6s ease-out;
}

.site-card {
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg-light);
    animation: fadeIn 0.8s ease-out;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Quizzes */
#quiz-container {
    background: rgba(253, 253, 253, 0.85);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    #quiz-container {
        background: rgba(30, 30, 30, 0.85);
    }
}

.quiz-option-btn {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    background-color: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.quiz-option-btn:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent);
}

.quiz-fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

/* Drop Cap for the first paragraph in journal entries */
.journal-entry > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 0.8;
    padding-right: 0.5rem;
    padding-top: 0.5rem;
    color: var(--accent);
    font-weight: 700;
}

/* Blockquotes */
blockquote {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-main);
    background: var(--bg-body);
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 5px solid var(--accent);
    position: relative;
    border-radius: 4px;
}
blockquote::before {
    content: '\201C';
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 10px;
}
blockquote p {
    margin-bottom: 0;
}
blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-style: normal;
    text-align: right;
    font-weight: 600;
}

/* Buttons (Touch-Target Law: min 44px) */
.btn, .btn-payment, button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-body); /* Ensure buttons use UI font */
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: #800020; /* Deep Burgundy for hover */
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn-payment {
    background-color: var(--trust-blue);
    color: #fff;
    font-size: 1.1rem;
    width: 100%;
    max-width: 300px;
    margin: 1rem 0;
}
.btn-payment:hover {
    background-color: #005ea6;
    color: #fff;
    text-decoration: none;
}

/* AdSense Container (CLS Armor) */
.ad-container-leaderboard {
    min-height: 280px; /* Mobile first height for square/rect ads */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    background-color: #f0f2f5;
    border: 1px solid #e1e4e8;
    position: relative;
}
.ad-container-leaderboard::before {
    content: 'Advertisement';
    position: absolute;
    top: 0;
    right: 0;
    background: #e1e4e8;
    color: #555;
    font-size: 0.6rem;
    padding: 2px 5px;
}

@media (min-width: 768px) {
    .ad-container-leaderboard {
        min-height: 90px; /* Desktop leaderboard height */
    }
}

/* Revenue Modules (Footer) */
.revenue-module, .transparency-module {
    background: #fff;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.revenue-module {
    border-top: 4px solid var(--trust-blue);
}

.transparency-module {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.kicker {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.notice {
    font-style: italic;
    margin-bottom: 1.5rem;
}

.notice-list {
    list-style: none;
    padding: 0;
    font-size: 0.8rem;
}

/* Footer */
footer {
    background-color: #800020;
    color: #fff;
    padding: 4rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer a {
    color: #bdc3c7;
}

footer .disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    max-width: 700px;
    margin: 2rem auto 0;
    line-height: 1.5;
}

/* Sticky Floating Action Button (FAB) */
.fab-support {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--trust-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}
.fab-support:hover {
    transform: translateY(-3px);
    background-color: #005ea6;
    text-decoration: none;
    color: white;
}
.fab-support svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .journal-entry { padding: 1.5rem; }
    nav { flex-direction: column; gap: 1rem; }

    .fab-support span {
        display: none; /* Icon only on mobile */
    }
    .fab-support {
        padding: 14px;
        bottom: 15px;
        right: 15px;
    }
}


/* Hero Section (2026 Style) */
.hero-section {
    background: linear-gradient(135deg, var(--bg-body) 0%, rgba(183, 110, 121, 0.1) 100%);
    padding: 4rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3rem;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9IjAuMDIiLz4KPC9zdmc+');
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
.hero-section h1, .hero-section p, .hero-section .btn {
    position: relative;
    z-index: 1;
}
.hero-section h1 {
    font-size: 3rem;
    border-bottom: none;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.hero-section .notice {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}
