/* Страница главы - СВЕТЛЫЙ ФОН */
.chapter-page {
    background-color: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
    padding-top: 120px;
}

/* Кнопка возврата на карту - темная на светлом фоне */
.chapter-back-button {
    position: fixed;
    top: 40px;
    left: 0;
    width: 60px;
    height: 60px;
    background-color: #1a1a1a;
    border: 2px solid #333;
    border-left: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 15px;
    text-decoration: none;
    color: white;
    font-family: 'Georgia', serif;
    font-size: var(--chapter-text-size, 1.25rem);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.chapter-back-button:hover {
    width: 150px;
    background-color: #2a2a2a;
}

.chapter-back-button:active {
    background-color: #0a0a0a;
    transition-duration: 0.1s;
}

.chapter-back-button .button-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.chapter-back-button:hover .button-icon {
    transform: translateX(5px);
}

.chapter-back-button .button-text {
    opacity: 0;
    margin-left: 15px;
    transition: opacity 0.3s ease 0.1s;
}

.chapter-back-button:hover .button-text {
    opacity: 1;
}

/* Основной контент главы */
.chapter-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 100px;
}

/* Заголовок главы */
.chapter-header {
    text-align: center;
    margin-bottom: 40px;
}

.chapter-title {
    font-size: var(--chapter-title-size, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* Текст главы */
.chapter-text {
    background-color: white;
    padding: 60px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 1000px; /* ШИРИНА 1000px */
    margin: 0 auto;
}

/* Подзаголовок главы (Глава 1, Глава 2) */
.chapter-subtitle {
    font-size: var(--chapter-subtitle-size, 2rem); /* 32px для уровня 2 */
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

/* Обычный текст без колонок */
.text-content {
    font-size: var(--chapter-text-size, 1.25rem);
    line-height: 1.8; /* Увеличиваем межстрочный интервал */
    color: #333;
    margin-bottom: 40px;
}

.text-content p {
    margin-bottom: 1.5em;
    text-align: justify;
    hyphens: auto; /* Автоматические переносы */
}

/* Иллюстрации */
.illustration-block {
    margin: 60px auto;
    text-align: center;
}

.chapter-illustration {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 15px;
}





/* Навигация */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background-color: #1a1a1a;
    border: 2px solid #333;
    color: white;
    font-family: 'Georgia', serif;
    font-size: var(--nav-button-size, 1.5rem);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-button:hover {
    background-color: #2a2a2a;
    border-color: #555;
}

.nav-button:active {
    background-color: #0a0a0a;
    transition-duration: 0.1s;
}

.nav-button img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.back-to-top:hover img {
    transform: translateY(-5px);
}

.continue-button:hover img {
    transform: translateX(5px);
}

/* Меню для страницы главы (фиксированное) */
.chapter-page .menu-container {
    position: fixed;
    top: 40px;
    right: 0;
    z-index: 1000;
}

/* Стили для меню на светлом фоне */
.chapter-page .menu-slide {
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
}

.chapter-page .settings-panel {
    background-color: transparent;
}

/* Переменные для размеров текста (по умолчанию - уровень 2) */
:root {
    --chapter-title-size: 4rem;        /* 64px */
    --chapter-subtitle-size: 2rem;     /* 32px */
    --chapter-text-size: 1.25rem;      /* 20px */
    --nav-button-size: 1.5rem;         /* 24px */
}

/* Адаптивность */
@media (max-width: 1200px) {
    .chapter-text {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .chapter-text {
        max-width: 800px;
        padding: 50px;
    }
    
    .chapter-title {
        font-size: calc(var(--chapter-title-size, 4rem) * 0.85);
    }
    
    .chapter-subtitle {
        font-size: calc(var(--chapter-subtitle-size, 2rem) * 0.85);
    }
    
    .chapter-illustration {
        max-width: 500px;
    }
}

@media (max-width: 900px) {
    .chapter-text {
        max-width: 700px;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .chapter-page {
        padding-top: 100px;
    }
    
    .chapter-back-button {
        top: 20px;
        width: 50px;
        height: 50px;
    }
    
    .chapter-back-button:hover {
        width: 120px;
    }
    
    .chapter-page .menu-container {
        top: 20px;
    }
    
    .chapter-content {
        padding: 0 20px 60px;
    }
    
    .chapter-text {
        padding: 30px;
        max-width: 100%;
    }
    
    .chapter-illustration {
        max-width: 400px;
    }
    
    .chapter-title {
        font-size: calc(var(--chapter-title-size, 4rem) * 0.7);
    }
    
    .chapter-subtitle {
        font-size: calc(var(--chapter-subtitle-size, 2rem) * 0.7);
    }
    
    .chapter-navigation {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }
    
    .nav-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .chapter-title {
        font-size: calc(var(--chapter-title-size, 4rem) * 0.6);
    }
    
    .chapter-subtitle {
        font-size: calc(var(--chapter-subtitle-size, 2rem) * 0.6);
    }
    
    .chapter-text {
        padding: 25px 20px;
    }
    
    .text-content {
        font-size: calc(var(--chapter-text-size, 1.25rem) * 0.9);
    }
    
    .chapter-illustration {
        max-width: 300px;
    }
    
    .nav-button {
        padding: 12px 24px;
        font-size: calc(var(--nav-button-size, 1.5rem) * 0.9);
    }
}