/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */
:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Font Sizes - Restored to Premium large scale */
    --fs-large: 5rem;
    --fs-normal: 1.5rem;
    --fs-small: 1.1rem;

    /* 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: 4rem;
        --fs-normal: 1.5rem;
        --fs-small: 1.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 {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-normal);
    line-height: 1.7;
    /* Better readability for Inter */
    color: var(--color-text);
    background-color: #f8f9fa;
    /* Removed display: flex to restore full width block behavior */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* 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: 0.8rem 1.2rem;
    overflow-y: auto;
    z-index: 1000;
    font-size: var(--fs-small);
}

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

/* Language Switch & Audio Toggle in Sidebar */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar .lang-switch,
.sidebar .audio-toggle {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    position: relative;
    height: 32px;
    width: 84px;
    /* Slightly adjusted for better centering math */
    transition: all 0.3s ease;
}

.modern-arrow {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    /* Ensure block for consistent alignment */
}

.sidebar .lang-switch:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Audio Toggle Specifics */
.audio-toggle {
    color: var(--color-text);
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0 8px;
    /* Override zero padding from shared class */
}

.audio-toggle:hover {
    opacity: 1;
    color: var(--color-accent);
}

.audio-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audio-icon .wave {
    opacity: 0;
    transform-origin: left center;
    transition: opacity 0.3s ease;
}

.audio-toggle.playing {
    color: var(--color-accent);
    opacity: 1;
}

.audio-toggle.playing .wave-1 {
    animation: soundWave 1.5s ease-in-out infinite alternate;
}

.audio-toggle.playing .wave-2 {
    animation: soundWave 2s ease-in-out infinite alternate 0.5s;
}

@keyframes soundWave {
    0% {
        opacity: 0.2;
        transform: scaleY(0.8);
    }

    100% {
        opacity: 1;
        transform: scaleY(1.1);
    }
}

.lang-switch .current-flag,
.lang-switch .target-flag,
.lang-switch .arrow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transform-origin: center;
}

.lang-switch .target-flag {
    opacity: 0.85;
    filter: grayscale(75%);
    /* 25% color, but brighter now */
}

/* German Version Hover Logic (US-Left/Target, DE-Right/Current) */
body[lang="de"] .lang-switch:hover .current-flag,
body[lang="de"] .lang-switch:hover .arrow {
    transform: translateX(65px);
    opacity: 0;
}

body[lang="de"] .lang-switch:hover .target-flag {
    transform: translateX(30px) scale(1.3);
    opacity: 1;
    filter: grayscale(0%);
}

/* English Version Hover Logic (US-Left/Current, DE-Right/Target) */
body[lang="en"] .lang-switch:hover .current-flag,
body[lang="en"] .lang-switch:hover .arrow {
    transform: translateX(-65px);
    opacity: 0;
}

body[lang="en"] .lang-switch:hover .target-flag {
    transform: translateX(-30px) scale(1.3);
    opacity: 1;
    filter: grayscale(0%);
}

.flag-icon {
    width: 24px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    border-radius: 2px;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #5d6d7e;
}

.nav-header h2 {
    font-size: 1.1em;
    margin: 0;
    color: #bdc3c7;
    border: none;
    padding: 0;
}

.nav-container {
    display: flex;
    gap: 15px;
    position: relative;
}

/* ========================================
   CATERPILLAR (Raupe) - Vertical Inchworm
   ======================================== */

.caterpillar-track {
    position: fixed;
    left: calc(var(--sidebar-width) - 4px);
    /* Shift 4px left into sidebar */
    width: 6px;
    /* Slightly narrower for a branch look */
    background: linear-gradient(to right,
            #5d4037 0%,
            #795548 20%,
            #5d4037 40%,
            #8d6e63 60%,
            #5d4037 80%,
            #795548 100%);
    /* Organic brown "grain" gradient */
    border-radius: 3px;
    transform: translateX(-3px);
    /* Centered on the edge */
    z-index: 9999;
    pointer-events: none;
    box-shadow: inset -1px 0 2px rgba(0, 0, 0, 0.3);
    /* Add depth */
    top: 0;
    height: 0;
}

.caterpillar {
    position: absolute;
    left: -25px;
    /* Protruding into content area */
    width: 50px;
    height: 100px;
    transition: top 0.3s ease-out;
    pointer-events: none;
    z-index: 1000;
}

/* Raupen-Segmente - Basis-Stil (Vergrößert für Premium Feel) */
.caterpillar-segment {
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3);
    left: 17px;
    /* Adjusted for 16px width (50px container) */
    will-change: transform;
}

/* Raupen-Glieder (Tight Chain: 12px spacing) */
.caterpillar-segment:nth-child(1) {
    top: 0px;
    z-index: 1;
}

.caterpillar-segment:nth-child(2) {
    top: 12px;
    z-index: 2;
}

.caterpillar-segment:nth-child(3) {
    top: 24px;
    z-index: 3;
}

.caterpillar-segment:nth-child(4) {
    top: 36px;
    z-index: 4;
}

.caterpillar-segment:nth-child(5) {
    top: 48px;
    z-index: 5;
}

.caterpillar-segment:nth-child(6) {
    top: 60px;
    /* Head is simply the final segment */
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    border-radius: 40% 50% 50% 40%;
    z-index: 10;
    left: 13px;
    /* Center 24px head */
}

/* Augen-Logik (Consistent Pupils & Size) */
.caterpillar-segment:nth-child(6)::before,
.caterpillar-segment:nth-child(6)::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    top: 16px;
    left: 9px;
    transition: all 0.3s ease;
    z-index: 11;
    box-shadow: inset -1px -1px 0 1px black;
}

.caterpillar-segment:nth-child(6)::after {
    top: 22px;
    opacity: 0;
}

/* Mund-Logik (Smiling Mouth) */
.caterpillar-mouth {
    position: absolute;
    width: 8px;
    height: 8px;
    /* Taller box for deeper curve */
    border: 1px solid transparent;
    border-bottom: 2px solid black;
    border-radius: 50%;
    /* Perfect U-shape */
    top: 17px;
    /* Adjusted base top */
    left: 8px;
    opacity: 0;
    /* Hidden in profile/crawling */
    transition: all 0.3s ease;
    z-index: 11;
}

.caterpillar.idle-looking .caterpillar-mouth {
    animation: mouth-look-39 12s infinite ease-in-out;
}

/* Farb-Variationen */
.caterpillar-segment:nth-child(2n) {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.caterpillar-segment:nth-child(3n) {
    background: linear-gradient(135deg, #1e8449 0%, #196f3d 100%);
}

/* ========================================
   SCROLL-SYNCED CRAWLING (Scrubbing)
   ======================================== */

.caterpillar.crawling .caterpillar-segment {
    animation-play-state: paused;
    animation-delay: calc(var(--worm-progress) * -2s);
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    /* Crucial for scrubbing */
}

.caterpillar.crawling .caterpillar-segment:nth-child(1) {
    animation-name: tail-crawl-v;
}

.caterpillar.crawling .caterpillar-segment:nth-child(2) {
    animation-name: seg2-arch-v;
}

.caterpillar.crawling .caterpillar-segment:nth-child(3) {
    animation-name: seg3-arch-v;
}

.caterpillar.crawling .caterpillar-segment:nth-child(4) {
    animation-name: seg4-arch-v;
}

.caterpillar.crawling .caterpillar-segment:nth-child(5) {
    animation-name: seg5-arch-v;
}

.caterpillar.crawling .caterpillar-segment:nth-child(6) {
    animation-name: head-crawl-v;
}

/* Unified Crawl Animation (Wave Logic) */
@keyframes tail-crawl-v {

    0%,
    40%,
    100% {
        transform: translate(0, 0);
    }

    70% {
        transform: translate(0, 12px);
    }
}

@keyframes seg2-arch-v {

    0%,
    35%,
    100% {
        transform: translate(0, 0);
    }

    65% {
        transform: translate(8px, 12px);
    }
}

@keyframes seg3-arch-v {

    0%,
    30%,
    100% {
        transform: translate(0, 0);
    }

    60% {
        transform: translate(14px, 12px);
    }
}

@keyframes seg4-arch-v {

    0%,
    25%,
    100% {
        transform: translate(0, 0);
    }

    55% {
        transform: translate(12px, 10px);
    }
}

@keyframes seg5-arch-v {

    0%,
    20%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(8px, 8px);
    }
}

@keyframes head-crawl-v {

    0%,
    100% {
        transform: translate(0, 0);
    }

    40% {
        transform: translate(0, 12px);
    }
}

/* Idle: Subtle Look (Phase 39: True Vertical Stacking) */
.caterpillar.idle-looking .caterpillar-segment:nth-child(6) {
    animation: look-at-reader-39 12s infinite ease-in-out;
}

@keyframes look-at-reader-39 {

    0%,
    10%,
    90%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25%,
    75% {
        transform: rotate(90deg) scale(1.2);
    }
}

/* Mapping local coordinates to screen vertical when rotated 90deg */
.caterpillar.idle-looking .caterpillar-segment:nth-child(6)::before {
    animation: eye-right-39 12s infinite ease-in-out;
}

.caterpillar.idle-looking .caterpillar-segment:nth-child(6)::after {
    animation: eye-left-39 12s infinite ease-in-out;
}

@keyframes eye-right-39 {

    0%,
    10%,
    90%,
    100% {
        top: 16px;
        left: 5px;
        /* Keep it further out even when looking down/profile */
        opacity: 1;
    }

    25%,
    75% {
        top: 9px;
        left: 5px;
        /* Was 7px, moved 2px further out */
        opacity: 1;
    }

    /* Higher on screen in 90deg turn */
}

@keyframes eye-left-39 {

    0%,
    10%,
    90%,
    100% {
        top: 22px;
        left: 15px;
        /* Stay wide as it rotates away */
        opacity: 0;
    }

    25%,
    75% {
        top: 9px;
        left: 15px;
        /* Was 13px, moved 2px further out */
        opacity: 1;
    }

    /* Lower on screen in 90deg turn */
}

@keyframes mouth-look-39 {

    0%,
    10%,
    90%,
    100% {
        top: 17px;
        left: 9px;
        opacity: 0;
    }

    25%,
    75% {
        top: 13px;
        /* Shifted down 2px to increase distance from eyes */
        /* Shifted up to compensate for the 4px taller height */
        left: 8px;
        /* Perfectly centered between the widened eyes */
        opacity: 1;
    }
}

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

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

.nav-list a {
    text-decoration: none;
    color: #bdc3c7;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: block;
    padding: 2px 0;
}

.nav-list a:hover,
.nav-list a.active {
    color: #ffffff;
    transform: translateX(5px);
}

.nav-list a.active::before {
    content: '•';
    position: absolute;
    left: -12px;
    color: var(--color-accent);
}

/* ============================================
   LAYOUT: MAIN CONTENT
   ============================================ */
.content {
    margin-left: var(--sidebar-width);
    width: auto;
    /* Allow natural expansion */
    min-height: 100vh;
    position: relative;
    z-index: 0;
    padding: 0;

    /* Compound Background:
       1. Soft white overlay (Restored to 10-90% for wide colorful edges)
       2. Colorful vertical gradient */
    background-image:
        linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.95) 10%,
            rgba(255, 255, 255, 0.95) 90%,
            transparent 100%),
        linear-gradient(to bottom, #5dade2, #ffe066, #42e642);
    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;
    /* Between background (0) and text (2) */
    overflow: hidden;
    background-color: transparent;
    pointer-events: none;
    /* Text remains clickable */
}

/* ============================================
   SCROLL FADES (PHASE 49)
   ============================================ */
.scroll-fade-top,
.scroll-fade-bottom {
    position: sticky;
    left: 0;
    right: 0;
    height: 20vh;
    z-index: 50;
    pointer-events: none;
    /* Exactly matches the central white background of .content */
    background-image: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.95) 10%,
            rgba(255, 255, 255, 0.95) 90%,
            transparent 100%);
}

.scroll-fade-top {
    top: -1px;
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
}

.scroll-fade-bottom {
    bottom: -1px;
    -webkit-mask-image: linear-gradient(to top, black 20%, transparent 100%);
    mask-image: linear-gradient(to top, black 20%, transparent 100%);
}

/* ============================================
   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: rgba(255, 243, 205, 0.4);
    border-left: 4px solid #ffc107;
    padding: 4rem 2rem;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.trigger-warning .chapter-content {
    width: 100%;
    margin: 0;
}

.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;
    position: relative;
}

.chapter-content {
    max-width: 100%;
    /* Background fill */
    margin: 0;
    padding: 0 15vw;
    /* Premium focused padding */
    position: relative;
    z-index: 2;
}

/* ============================================
   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;
    width: 100%;
    text-align: center;
}

/* Drop Caps for the first paragraph of each regular chapter */
.chapter-content>p:first-of-type::first-letter {
    font-size: 2.2em;
    /* Normal größer */
    font-weight: 700;
}

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

.chapter ul,
.chapter ol {
    display: inline-block;
    /* Allows the parent to center the block */
    text-align: left;
    /* Keeps the bullets left-aligned within the block */
    margin-bottom: 8vh;
    list-style-type: disc;
    padding-left: 2rem;
    /* Standard bullet padding */
}

/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-item {
    text-align: left;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq-item summary {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    list-style: none;
    /* Hide default arrow in standard browsers */
    position: relative;
    padding-right: 2rem;
    user-select: none;
    transition: color 0.3s ease;
}

.faq-item summary:hover {
    color: #ffd166;
    /* Slightly brighter on hover */
}

/* Custom Arrow for Summary */
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-accent);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    content: '−';
    /* Minus sign when open */
    transform: translateY(-50%);
}

/* Hide default marker in Safari */
.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    text-align: left;
}

/* ============================================
   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;
}

/* ============================================
   GLOSSARY TOOLTIPS
   ============================================ */
.glossary-term {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted rgba(102, 126, 234, 0.3);
}

.glossary-trigger {
    color: var(--color-accent);
    font-weight: bold;
    font-size: 0.8em;
    cursor: help;
    padding: 0 2px;
    position: relative;
    display: inline-block;
}

.glossary-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-10%);
    background-color: #ffffff;
    color: #1a1a1a;
    text-align: left;
    padding: 15px;
    border-radius: 8px;
    width: 280px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: var(--font-body);
    font-style: normal;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.glossary-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.glossary-trigger:hover .glossary-tooltip {
    visibility: visible;
    opacity: 1;
}

.chapter {
    opacity: 1;
    transform: none;
    filter: none;
    will-change: auto;
}

.chapter.visible {
    opacity: 1;
    transform: none;
    filter: none;
}

/* ============================================
   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 */
}