/* 
 * GENERIC TEMPLATE STYLESHEET
 * ---------------------------
 * This CSS file defines the design system for the template.
 * 
 * SECTIONS:
 * 1. Design System (Variables)
 * 2. Theme Definitions (Dark & Light modes)
 * 3. General Styling (Body, Fonts)
 * 4. Typography
 * 5. Layout (Header, Banners)
 * 6. Components (Control Bar, Buttons, Dropdowns, Inputs, Tables)
 * 7. Main Content Area
 * 8. Responsive Design (Mobile optimizations)
 */

/* --------------------------- CSS Design System ------------------------------ */
:root {
    --font-base: 18px;
    --font-scale: 1;
    --border-radius: 12px;
    --transition-speed: 0.3s;
    --font-title: 'Gabriela', serif;
    --font-body: 'Lato', sans-serif;
    --max-width: 900px;

    /* Base Glowing Colors for Containers (Pinkish and Turquoise) */
    --outer-border-color: #ff66b2;
    --inner-border-color: #00e5ff;
    --outer-glow-shadow: 0 0 15px rgba(255, 102, 178, 0.5);
    --inner-glow-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    --neutral-shadow: rgba(0, 0, 0, 0.4);
}

/* --------------------------- Theme Definitions ------------------------------ */

/* --- DARK THEMES --- */

/* 1. Auburn Night */
body.theme-dark-auburn {
    --bg-color: #2a0a0a;
    --text-color: #fce4ec;
    --primary: #ff5252;
    --secondary: #4a0d0d;
    --accent: #ff8a80;
    --link-color: #ffb3b3;
    --shadow: rgba(0, 0, 0, 0.6);
}

/* 2. Art Deco (Classic Gold Luxury) */
body.theme-dark-art-deco {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary: #d4af37;
    --secondary: #1e1e1e;
    --accent: #f7e7ce;
    --link-color: #fdd835;
    --shadow: rgba(0, 0, 0, 0.8);
}

/* 3. Midnight Sky Blue (DEFAULT) */
body.theme-dark-midnight {
    --bg-color: #0d1b2a;
    --text-color: #e0f1f8;
    --primary: #38bdf8;
    --secondary: #1b263b;
    --accent: #7dd3fc;
    --link-color: #7dd3fc;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* 4. Acid High Energy */
body.theme-dark-acid {
    --bg-color: #050505;
    --text-color: #eaffea;
    --primary: #39ff14;
    --secondary: #1a1a1a;
    --accent: #baffba;
    --link-color: #76ff03;
    --shadow: rgba(0, 255, 0, 0.2);
}

/* 5. Vaporwave Sunset */
body.theme-dark-vaporwave {
    --bg-color: #1a0b2e;
    --text-color: #ffdef9;
    --primary: #ff00ff;
    --secondary: #3b1e56;
    --accent: #00ffff;
    --link-color: #ea80fc;
    --shadow: rgba(128, 0, 255, 0.4);
}

/* 6. Boreal Night */
body.theme-dark-boreal {
    --bg-color: #002b36;
    --text-color: #e0f2f1;
    --primary: #26a69a;
    --secondary: #004d40;
    --accent: #80cbc4;
    --link-color: #4db6ac;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* 7. Neon Void */
body.theme-dark-neon {
    --bg-color: #000000;
    --text-color: #ccfffa;
    --primary: #00e5ff;
    --secondary: #111111;
    --accent: #e040fb;
    --link-color: #18ffff;
    --shadow: rgba(0, 255, 255, 0.3);
}


/* --- LIGHT THEMES --- */

/* 8. Creme and Gold */
body.theme-light-creme {
    --bg-color: #fdfbf7;
    --text-color: #3e3b32;
    --primary: #c5a059;
    --secondary: #f2efe6;
    --accent: #e0d5b7;
    --link-color: #8a6a2e;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* 9. Ink and Paper */
body.theme-light-ink {
    --bg-color: #ffffff;
    --text-color: #212121;
    --primary: #000000;
    --secondary: #f0f0f0;
    --accent: #616161;
    --link-color: #d32f2f;
    /* A sharp red for contrast like old manuscripts or editing */
    --shadow: rgba(0, 0, 0, 0.1);
}

/* 10. Forest Ethereal */
body.theme-light-forest {
    --bg-color: #f1f8e9;
    --text-color: #1b5e20;
    --primary: #388e3c;
    --secondary: #dcedc8;
    --accent: #8bc34a;
    --link-color: #2e7d32;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* 11. Denim Wash */
body.theme-light-denim {
    --bg-color: #ecf3f9;
    --text-color: #102a43;
    --primary: #336699;
    --secondary: #dbeafe;
    --accent: #9fb3c8;
    --link-color: #205c90;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* 12. Peach Fuzz */
body.theme-light-peach {
    --bg-color: #fff5f0;
    --text-color: #4e342e;
    --primary: #ff8a65;
    --secondary: #ffccbc;
    --accent: #ffab91;
    --link-color: #d84315;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* 13. Sahara Sand */
body.theme-light-sahara {
    --bg-color: #fff8e1;
    --text-color: #5d4037;
    --primary: #d4a017;
    --secondary: #ffecb3;
    --accent: #ffd54f;
    --link-color: #bf8d0a;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* 14. Lavender Mist */
body.theme-light-lavender {
    --bg-color: #faf5ff;
    --text-color: #4a148c;
    --primary: #9c27b0;
    --secondary: #f3e5f5;
    --accent: #e1bee7;
    --link-color: #7b1fa2;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* Light theme overrides for better visibility of container colors on light backgrounds */
body.theme-light-creme,
body.theme-light-ink,
body.theme-light-forest,
body.theme-light-denim,
body.theme-light-peach,
body.theme-light-sahara,
body.theme-light-lavender {
    --outer-border-color: #d02f7e; /* Elegant darker pink */
    --inner-border-color: #0c8a9c; /* Elegant darker turquoise */
    --outer-glow-shadow: 0 0 12px rgba(208, 47, 126, 0.22);
    --inner-glow-shadow: 0 0 12px rgba(12, 138, 156, 0.22);
    --neutral-shadow: rgba(0, 0, 0, 0.1);
}


/* --------------------------- General Styling ------------------------------ */
html {
    font-size: calc(var(--font-base) * var(--font-scale));
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --------------------------- Typography ------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-title);
    color: var(--primary);
    text-shadow: 1px 1px 2px var(--shadow);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
    font-weight: bold;
}

h6 {
    font-size: 1.1rem;
    font-weight: bold;
    font-style: italic;
}

p,
li {
    font-size: 1rem;
    text-align: justify;
    hyphens: auto;
    margin-bottom: 1em;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.bible-link {
    font-weight: bold;
    border-bottom: 1px dotted var(--link-color);
}

/* --------------------------- Header / Banner ------------------------------ */
.page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 100vh;
}

.page-header {
    width: 100%;
    max-width: 1600px;
    margin: 1rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    text-align: center;
}

.banner-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1600 / 400;
    border-radius: var(--border-radius);
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.2s;
}

.banner-image:hover {
    transform: scale(1.005);
}

.text-title {
    text-align: center;
    font-size: 3rem;
    margin: 2rem 0;
    cursor: pointer;
    color: var(--primary);
}

/* --------------------------- Description ------------------------------ */
#page-description {
    max-width: var(--max-width);
    text-align: center;
    padding: 0 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    opacity: 0.9;
    font-style: italic;
    font-size: 1.1rem;
}

/* --------------------------- Control Bar ------------------------------ */
.control-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    padding: 0 1rem;
    max-width: var(--max-width);
    width: 100%;
}

.control-btn {
    background-color: var(--secondary);
    color: var(--text-color);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    font-family: var(--font-body);
}

.control-btn:hover {
    background-color: var(--primary);
    color: var(--bg-color);
    /* Correct invalid hover text color for light themes on button text */
    text-shadow: none;
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(2px);
}

/* --------------------------- Dropdown ------------------------------ */
.dropdown {
    position: relative;
    display: inline-block;
}



.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--secondary);
    min-width: 200px;
    box-shadow: 0 8px 16px var(--shadow);
    z-index: 100;
    border-radius: var(--border-radius);
    overflow: hidden;
    right: 0;
    border: 1px solid var(--primary);
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1rem;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: var(--primary);
    color: var(--bg-color);
    text-decoration: none;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content hr {
    border: 0;
    border-top: 1px solid var(--primary);
    margin: 0;
    opacity: 0.3;
}

/* --------------------------- Main Content ------------------------------ */
main,
.content-body {
    max-width: var(--max-width);
    width: clamp(300px, 92vw, var(--max-width));
    background-color: transparent;
    padding: 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: none;
    margin: 0 auto 3rem auto;
    box-sizing: border-box;
}

main h2,
.content-body h2 {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --------------------------- Components ------------------------------ */

/* Blockquotes */
blockquote {
    border-left: 5px solid var(--primary);
    padding: 1rem 2rem;
    margin: 1.5rem 0;
    background-color: rgba(127, 127, 127, 0.1);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-color);
}

blockquote footer {
    text-align: right;
    font-weight: bold;
    color: var(--primary);
    margin-top: 0.5rem;
    font-style: normal;
}

/* Lists */
ul,
ol {
    margin: 1em 0;
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}

/* Buttons (Generic) */
button:not(.control-btn) {
    background-color: var(--primary);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

button:not(.control-btn):hover {
    opacity: 0.9;
}

/* Inputs & Form Elements */
input,
textarea,
select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--primary);
    padding: 8px;
    border-radius: 6px;
    margin: 5px 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--primary);
}

th {
    color: var(--primary);
    font-family: var(--font-title);
    font-size: 1.1rem;
}

tr:hover {
    background-color: rgba(127, 127, 127, 0.05);
}

/* Horizontal Rule */
hr {
    border: 0;
    border-top: 2px solid var(--primary);
    margin: 2em 0;
    opacity: 0.5;
}

/* Code */
code,
pre {
    font-family: 'Courier New', Courier, monospace;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

/* Details/Summary */
details {
    margin: 1em 0;
    padding: 0.5em 1em;
    background-color: rgba(127, 127, 127, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid var(--inner-border-color);
}

summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--inner-border-color);
}

/* Pull Quotes */
.pull-quote {
    font-size: 1.5rem;
    font-family: var(--font-title);
    text-align: center;
    color: var(--primary);
    margin: 2rem 0;
    padding: 1rem;
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    line-height: 1.4;
    background-color: rgba(127, 127, 127, 0.05);
}

/* External Link Indicators (only inside main content) */
main a[target="_blank"]:after,
.content-body a[target="_blank"]:after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
    display: inline-block;
    vertical-align: text-top;
}

/* --------------------------- Theme Toast Notification ------------------------------ */
#theme-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: var(--secondary);
    color: var(--text-color);
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: 0 5px 20px var(--shadow);
    border: 1px solid var(--primary);
    font-weight: bold;
    font-family: var(--font-body);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
    text-align: center;
    min-width: 200px;
}

#theme-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------- Flash Title Splash ------------------------------ */
#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    animation: flashFade var(--flash-duration, 2.5s) ease-in-out forwards;
}

#flash-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
}

@keyframes flashFade {
    0% {
        opacity: 0;
        visibility: visible;
    }

    10% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* --------------------------- Responsive ------------------------------ */
@media (max-width: 768px) {
    :root {
        --font-base: 16px;
    }

    .page-header {
        padding: 0 0.25rem;
        margin: 0.5rem auto;
    }

    main,
    .content-body {
        padding: 1.5rem 0.5rem; /* Tight side padding for mobile */
        margin: 0 auto 2rem auto;
        border-radius: 0;
        /* Full width for mobile usually looks better without rounded corners on sides */
        width: 100%;
        max-width: 100%;
    }

    .page-container {
        padding: 0;
    }

    .control-bar {
        position: relative;
        gap: 8px;
        padding: 0 0.5rem;
    }

    .dropdown {
        position: static;
    }

    .dropdown-content {
        left: 8px;
        right: 8px;
        width: auto;
        min-width: unset;
        top: 100%;
    }

    .control-btn {
        padding: 8px 12px;
        flex-grow: 1;
        font-size: 1rem;
        min-width: unset;
    }

    blockquote {
        padding: 0.5rem 1rem;
        margin: 1rem 0;
    }

    details {
        padding: 0.5em 0.5em;
    }
}
/* --------------------------- Quiz Modal & Components ------------------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    background: var(--secondary);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); } to { transform: translateY(0); } }

.modal-header {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#quiz-score-top {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.2rem;
}

.close-btn {
    background: transparent !important;
    color: var(--accent) !important;
    font-size: 1.2rem;
    padding: 5px 10px !important;
    border: 1px solid var(--accent) !important;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--accent) !important;
    color: var(--bg-color) !important;
}

#quiz-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.quiz-question-text {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: bold;
}

.quiz-options {
    display: grid;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.quiz-opt-btn {
    text-align: left !important;
    padding: 12px 20px !important;
    background: var(--bg-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--primary) !important;
    transition: all 0.2s !important;
}

.quiz-opt-btn:hover {
    background: var(--primary) !important;
    color: var(--bg-color) !important;
}

.quiz-opt-btn.correct {
    background: #2e7d32 !important;
    color: #ffffff !important;
    border-color: #4caf50 !important;
}

.quiz-opt-btn.incorrect {
    background: #c62828 !important;
    color: #ffffff !important;
    border-color: #ef5350 !important;
}

.quiz-input-container {
    margin-bottom: 1.5rem;
}

.quiz-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.sample-answer-box {
    background: rgba(127, 127, 127, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-top: 10px;
    font-style: italic;
}

.quiz-nav-btns {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.link-score {
    font-size: 0.9rem;
    color: var(--primary);
    margin-left: 10px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* --------------------------- Lesson Containers & Event Containers ------------------------------ */

/* Common base styles for details containers */
.lesson-container,
.event-container {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.lesson-container summary,
.event-container summary {
    background-color: rgba(127, 127, 127, 0.1);
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    list-style: none; /* Hide default marker */
    user-select: none;
}

.event-container summary {
    padding: 1.25rem 1.75rem;
    background-color: rgba(127, 127, 127, 0.08);
}

/* Hide default marker for webkit */
.lesson-container summary::-webkit-details-marker,
.event-container summary::-webkit-details-marker {
    display: none;
}

/* Inner Container Headers */
.lesson-container summary h2 {
    margin: 0;
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none; /* Remove template's default h2 border */
    font-size: 1.4rem; /* Default for sub-containers */
    color: var(--inner-border-color); /* Turquoise */
    font-family: 'Roboto Mono', monospace; /* Technical font for sub-sections */
    text-align: left; /* Prevent wrapped text from being centered */
}

/* Outer Container Headers (Direct child of main, and the event container) */
main > .lesson-container > summary > h2,
.event-container summary h2 {
    font-size: 2.1rem;
    color: var(--outer-border-color); /* Pinkish */
    font-weight: 800;
    font-family: 'Gabriela', serif; /* Elegant font for major sections */
}

.event-container summary h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Outer Containers (Event and Top-level Lesson Containers) */
.event-container,
main > .lesson-container {
    max-width: var(--max-width);
    width: clamp(300px, 92vw, var(--max-width));
    margin: 0 auto 2rem auto;
    border: 2px solid var(--outer-border-color);
    box-shadow: 0 8px 32px var(--neutral-shadow);
}

.event-container[open],
main > .lesson-container[open] {
    border-color: var(--outer-border-color);
    box-shadow: 0 12px 40px var(--neutral-shadow), var(--outer-glow-shadow);
}

.event-container:hover,
main > .lesson-container:hover {
    box-shadow: 0 12px 40px var(--neutral-shadow), var(--outer-glow-shadow);
}

/* Inner Containers (Nested Lesson Containers) */
.lesson-content > .lesson-container {
    border: 2px solid var(--inner-border-color);
    box-shadow: 0 4px 15px var(--neutral-shadow);
}

.lesson-content > .lesson-container[open] {
    border-color: var(--inner-border-color);
    box-shadow: 0 6px 20px var(--neutral-shadow), var(--inner-glow-shadow);
}

.lesson-content > .lesson-container:hover {
    box-shadow: 0 6px 20px var(--neutral-shadow), var(--inner-glow-shadow);
}

.instruction-text {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.8;
    text-align: center;
    margin-bottom: 2rem;
}

.chevron::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: var(--inner-border-color); /* Default to inner (turquoise) */
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

/* Outer chevrons use outer border color */
.event-container > summary .chevron::after,
main > .lesson-container > summary .chevron::after {
    background-color: var(--outer-border-color);
}

.lesson-container[open] .chevron::after,
.event-container[open] .chevron::after {
    transform: rotate(180deg);
}

.lesson-content {
    padding: clamp(0.75rem, 3vw, 1.5rem) clamp(0.5rem, 2vw, 1rem); /* Dynamic padding */
    border-top: 1px solid var(--inner-border-color);
}

main > .lesson-container > .lesson-content {
    border-top: 1px solid var(--outer-border-color);
}

/* Deeply nested containers should have dynamic tight padding */
.lesson-content .lesson-container {
    margin-left: clamp(0.1rem, 1.5vw, 0.5rem);
    margin-right: clamp(0.1rem, 1.5vw, 0.5rem);
}

.lesson-content .lesson-content {
    padding: clamp(0.5rem, 2vw, 1rem) clamp(0.25rem, 1.5vw, 0.5rem);
}

.quiz-btn-icon {
    margin-right: 8px;
}

/* --------------------------- Event Content Styles ------------------------------ */
.event-content {
    padding: 2rem 1.75rem;
    border-top: 1px solid var(--outer-border-color);
    background-color: rgba(0, 0, 0, 0.1);
}

/* For light themes, darken background slightly for contrast if background is white */
body.theme-light-creme .event-content,
body.theme-light-ink .event-content,
body.theme-light-forest .event-content,
body.theme-light-denim .event-content,
body.theme-light-peach .event-content,
body.theme-light-sahara .event-content,
body.theme-light-lavender .event-content {
    background-color: rgba(0, 0, 0, 0.02);
}

.event-headline {
    text-align: center;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--outer-border-color); /* Pinkish */
    font-family: var(--font-title);
}

.event-sub-headline {
    text-align: center;
    margin: 0 0 2rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.95;
    font-family: var(--font-body);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background-color: var(--secondary);
    border: 1px solid rgba(127, 127, 127, 0.15);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px var(--neutral-shadow);
}

.event-card:hover {
    transform: translateY(-4px);
    border-color: var(--inner-border-color); /* Turquoise */
    box-shadow: 0 8px 25px var(--neutral-shadow), var(--inner-glow-shadow);
}

.event-card.special-card {
    background: linear-gradient(135deg, rgba(255, 102, 178, 0.12) 0%, rgba(255, 102, 178, 0.02) 100%);
    border: 1.5px solid var(--outer-border-color);
}

/* For light themes, adjust background of special-card slightly */
body.theme-light-creme .event-card.special-card,
body.theme-light-ink .event-card.special-card,
body.theme-light-forest .event-card.special-card,
body.theme-light-denim .event-card.special-card,
body.theme-light-peach .event-card.special-card,
body.theme-light-sahara .event-card.special-card,
body.theme-light-lavender .event-card.special-card {
    background: linear-gradient(135deg, rgba(208, 47, 126, 0.08) 0%, rgba(208, 47, 126, 0.02) 100%);
}

.event-card-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}

.event-card-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.event-card-text strong {
    color: var(--inner-border-color); /* Turquoise */
    font-size: 1.05rem;
    display: block;
    margin-bottom: 0.3rem;
}

.event-card-text span {
    display: block;
    color: var(--text-color);
}

.event-card-text a {
    color: var(--link-color);
    border-bottom: 1px dotted var(--link-color);
    transition: all 0.2s ease;
}

.event-card-text a:hover {
    text-decoration: none;
    border-bottom-style: solid;
}

/* --------------------------- Lightbox Modal & Components ------------------------------ */
.lightbox-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.93); /* Dark translucent background, no blur */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 11000; /* Higher than other modals (10001) */
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.lightbox-modal-overlay.show {
    opacity: 1;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Elegant bounce animation */
}

.lightbox-modal-overlay.show .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 65vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    border: 3px solid var(--inner-border-color);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), var(--inner-glow-shadow);
    display: block;
}

.lightbox-text-caption {
    background: var(--secondary);
    color: var(--text-color);
    border: 1px solid var(--inner-border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem 2rem;
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.lightbox-text-caption strong {
    color: var(--primary);
}

.lightbox-close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 2.5rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 11001;
    font-weight: 300;
}

.lightbox-close-btn:hover {
    background: var(--outer-border-color);
    color: #ffffff;
    border-color: var(--outer-border-color);
    transform: rotate(90deg) scale(1.05);
    box-shadow: var(--outer-glow-shadow);
}

/* Thumbnail and Vision Test Styling */
.image-hover-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 2px solid var(--inner-border-color);
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.image-hover-wrapper img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.image-hover-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--shadow), var(--inner-glow-shadow) !important;
}

.image-hover-wrapper:hover img {
    filter: brightness(0.85);
    transform: scale(1.02);
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Let clicks pass through to wrapper */
}

.image-hover-wrapper:hover .hover-overlay {
    opacity: 1;
}

.hover-overlay span {
    color: #ffffff;
    font-weight: bold;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.75);
    padding: 8px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px); /* Minor aesthetic blur inside overlay badge is fine, backdrop is not blurred */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.vision-challenge-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, 0.06);
    border: 2px dashed var(--inner-border-color);
    box-shadow: 0 4px 15px var(--shadow);
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.vision-challenge-box:hover {
    box-shadow: 0 6px 20px var(--shadow), var(--inner-glow-shadow);
}

.challenge-questions li {
    background: rgba(127, 127, 127, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--inner-border-color);
}

.document-challenge-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, 0.06);
    border: 2px dashed var(--outer-border-color);
    box-shadow: 0 4px 15px var(--shadow);
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.document-challenge-box:hover {
    box-shadow: 0 6px 20px var(--shadow), var(--outer-glow-shadow);
}

.challenge-questions.doc-test li {
    border-left: 4px solid var(--outer-border-color);
}

.creative-challenge-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, 0.06);
    border: 2px dashed var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.creative-challenge-box:hover {
    box-shadow: 0 6px 20px var(--shadow), 0 0 15px var(--accent);
}

.challenge-questions.creative-test li {
    border-left: 4px solid var(--accent);
}

.clicker-challenge-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, 0.06);
    border: 2px dashed var(--primary);
    box-shadow: 0 4px 15px var(--shadow);
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.clicker-challenge-box:hover {
    box-shadow: 0 6px 20px var(--shadow), 0 0 15px var(--primary);
}

.challenge-questions.clicker-test li {
    border-left: 4px solid var(--primary);
}

.flyer-challenge-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, 0.06);
    border: 2px dashed var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.flyer-challenge-box:hover {
    box-shadow: 0 6px 20px var(--shadow), 0 0 15px var(--accent);
}

.challenge-questions.flyer-test li {
    border-left: 4px solid var(--accent);
}




