/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */
:root {
    /* Font Sizes - 3 Tiers */
    --fs-large: 4rem;
    /* H1, H2 */
    --fs-normal: 1.8rem;
    /* Body, H3, H4 */
    --fs-small: 1.1rem;
    /* Sidebar, Glossary, Footer */

    /* Colors */
    --color-text: #1a1a1a;
    --color-sidebar-bg: #1a252f;
    --color-sidebar-text: #ffffff;
    --color-accent: #667eea;

    /* Layout */
    --sidebar-width: 280px;
}

/* Responsive Font Scaling */
@media (max-width: 1900px) {
    :root {
        --fs-large: 3.2rem;
        --fs-normal: 1.6rem;
        --fs-small: 1rem;
    }
}

@media (max-width: 1200px) {
    :root {
        --fs-large: 2.5rem;
        --fs-normal: 1.4rem;
        --fs-small: 0.95rem;
        --sidebar-width: 240px;
    }
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    font-size: var(--fs-normal);
    min-height: 100vh;
    background-color: #f5f5f5;
    /* Fallback */
}

/* ============================================
   LAYOUT: SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    padding: 1rem 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    font-size: var(--fs-small);
}

.sidebar li {
    font-size: var(--fs-small);
}

/* Language Switch in Sidebar */
.sidebar .lang-switch {
    width: 100%;
    margin-bottom: 2rem;
    padding: 12px;
    background-color: var(--color-sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--fs-small);
    transition: all 0.2s ease;
}

.sidebar .lang-switch:hover {
    background-color: #45627e;
}

/* Navigation */
.nav-header h2 {
    font-size: 1.1em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #5d6d7e;
    text-decoration: none;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.8rem;
}

.nav-list a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.nav-list a:hover {
    color: #ecf0f1;
}

/* ============================================
   LAYOUT: MAIN CONTENT
   ============================================ */
.content {
    margin-left: var(--sidebar-width);
    padding: 0;
    min-height: 100vh;

    /* Compound Background:
       1. White overlay in center (for text readability)
       2. Colorful vertical gradient (green → yellow → blue) */
    background-image:
        linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.95) 15%,
            /* Adjust opacity here: 0.90-0.98 */
            rgba(255, 255, 255, 0.95) 85%,
            transparent 100%),
        linear-gradient(to bottom,
            #5dade2,
            /* Blue */
            #ffe066,
            /* Yellow */
            #42e642
            /* Green */
        );
    background-attachment: scroll;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ============================================
   SCROLLYTELLING: VISUAL CONTAINER
   ============================================ */
#visual-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    z-index: 1;
    /* Behind text, in front of background */
    overflow: hidden;
    background-color: transparent;
    pointer-events: none;
    /* Text remains clickable */
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    /* Verlauf von Hellblau (#5dade2) nach Dunkelblau (#1a252f) */
    background: linear-gradient(to right, #5dade2, #1a252f);
    color: #ffffff;
    /* Text weiß, damit er auf Blau lesbar ist */
    padding: 6rem 2rem 4rem 2rem;
    text-align: center;
    /* Optional: Ein Schatten für mehr Tiefe */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.hero h1 {
    color: #ffffff;
    /* Überschrift explizit weiß */
    text-shadow: none;
    /* Kein Outline-Effekt hier nötig */
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    padding-bottom: 1rem;
}

.hero .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

/* ============================================
   TRIGGER WARNING
   ============================================ */
.trigger-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 2rem;
    margin-bottom: 0;
}

.trigger-warning .chapter-content {
    max-width: 1200px;
    margin: 0 auto;
}

.trigger-warning h3 {
    color: #856404;
    margin-top: 0;
    font-size: var(--fs-normal);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.trigger-warning p {
    color: #856404;
    font-size: var(--fs-normal);
}

/* ============================================
   CHAPTERS (SCROLLYTELLING STYLE)
   ============================================ */
.chapter {
    min-height: 80vh;
    padding: 10vh 2rem;
    background-color: transparent;
}

.chapter-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    /* Above animations */
}

/* ============================================
   TYPOGRAPHY: HEADINGS
   ============================================ */
h1,
h2 {
    font-size: var(--fs-large);
    text-align: center;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 4px;
    line-height: 1.5;
}

.chapter h2 {
    margin-bottom: 8vh;
    background-color: transparent;
}

h3,
h4,
h5,
h6 {
    font-size: var(--fs-normal);
    color: var(--color-text);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ============================================
   TYPOGRAPHY: PARAGRAPHS & LISTS
   ============================================ */
p,
li {
    font-size: var(--fs-normal);
    color: var(--color-text);
    line-height: 1.7;
}

/* Scrollytelling spacing for chapters */
.chapter p,
.chapter li {
    font-size: var(--fs-normal);
    line-height: 5.0;
    margin-bottom: 8vh;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.chapter li {
    text-align: left;
    margin-bottom: 5vh;
}

.chapter ul,
.chapter ol {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 8vh;
    list-style-type: disc;
    padding-left: 2rem;
}

/* ============================================
   TEXT EMPHASIS
   ============================================ */
strong {
    color: var(--color-accent);
    font-weight: 600;
}

em {
    font-style: italic;
    color: #555;
}

/* ============================================
   FORMULAS
   ============================================ */
.formula {
    font-family: 'Courier New', monospace;
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    font-size: var(--fs-normal);
    margin: 1.5rem 0;
}

/* ============================================
   SPECIAL SECTIONS: AUSKLANG, BONUS, GLOSSARY
   ============================================ */

/* Ausklang & Bonus: Normal size, moderate line-height */
#ausklang p,
#ausklang li,
#bonus p,
#bonus li {
    font-size: var(--fs-normal) !important;
    line-height: 2.0 !important;
    margin-bottom: 2rem !important;
    text-align: left;
}

/* Glossary: Small size, moderate line-height */
#glossar p,
#glossar li {
    font-size: var(--fs-small) !important;
    line-height: 2.0 !important;
    margin-bottom: 2rem !important;
    text-align: left;
}

#glossar dt {
    font-weight: 600;
    color: var(--color-sidebar-bg);
    margin-top: 1.2rem;
    font-size: var(--fs-normal);
}

#glossar dd {
    margin-left: 0;
    margin-bottom: 1rem;
    color: var(--color-text);
    font-size: var(--fs-small);
    line-height: 1.6;
}

.bg-glossary {
    background-color: #f1f4f6;
}

/* ============================================
   CHAT BLOCKS (AUSKLANG)
   ============================================ */
.chat-block-container,
.chat-block {
    margin-bottom: 2rem;
}

.chat-label {
    font-weight: bold;
    color: var(--color-sidebar-bg);
    margin-bottom: 0.5rem;
    font-size: var(--fs-normal);
}

.chat-label.user {
    color: #2c3e50;
}

.chat-label.claude {
    color: var(--color-accent);
}

.chat-bubble {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-accent);
    font-size: var(--fs-normal);
}

.chat-bubble.user {
    background-color: #f1f4f6;
    border-left-color: #2c3e50;
}

.chat-bubble.claude {
    background-color: #f8f9fa;
    border-left-color: var(--color-accent);
}

.chat-bubble.result {
    border-left-color: #333;
    color: #555;
}

/* ============================================
   BONUS SECTION DETAILS
   ============================================ */
.bonus-details {
    margin-top: 3rem;
    background-color: #f1f4f6;
    border-radius: 8px;
    overflow: hidden;
}

.bonus-summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    color: var(--color-sidebar-bg);
    list-style: none;
    font-size: var(--fs-normal);
}

.bonus-summary-arrow {
    float: right;
    transition: transform 0.3s ease;
}

.bonus-content {
    padding: 1.5rem;
    border-top: 1px solid #ddd;
}

.bonus-message-container {
    margin-bottom: 2rem;
}

.bonus-message-small {
    margin-bottom: 1rem;
}

.bonus-role {
    font-size: var(--fs-small);
    font-weight: bold;
}

.role-author {
    color: var(--color-accent);
}

.role-translator {
    color: #27ae60;
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background-color: var(--color-sidebar-bg);
    color: #bdc3c7;
    padding: 2rem;
    text-align: center;
    font-size: var(--fs-small);
}

/* ============================================
   UTILITIES
   ============================================ */
.closing {
    font-size: var(--fs-normal);
    text-align: center;
    font-style: italic;
    margin-top: 3rem;
    color: var(--color-accent);
}

.placeholder,
.illustration {
    display: none;
}

.chapter-divider {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 3rem 0;
}

.font-monospace {
    font-family: monospace;
}

.margin-top-1rem {
    margin-top: 1rem;
}

.italic {
    font-style: italic;
}

.opacity-08 {
    opacity: 0.8;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #95a5a6;
}

.font-small {
    font-size: var(--fs-small);
}

/* ============================================
   DETAILS/SUMMARY STYLING
   ============================================ */
details summary::-webkit-details-marker {
    display: none;
}

details summary {
    outline: none;
}

details[open] .bonus-summary-arrow,
details[open] summary span[style*="float: right"] {
    transform: rotate(180deg);
    display: inline-block;
}

/* ============================================
   LANGUAGE SWITCHING
   ============================================ */
[lang="de"] [data-en]:not([data-de]) {
    display: none !important;
}

[lang="en"] [data-de]:not([data-en]) {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    #visual-container {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .content {
        margin-left: 0;
    }

    .chapter {
        padding: 3rem 1.5rem;
    }

    #visual-container {
        left: 0;
        width: 100%;
    }
}


/* ============================================
   lenis scrolling
   ============================================ */

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
    /* Verhindert Konflikte mit nativem Smooth-Scroll */
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
    /* Bessere Performance bei Iframes */
}