/* --- VARIABLES --- */
:root {
    --gold: #D13A04; /* Оранжево-золотой из макета */
    --gold-hover: #C5813D;
    --dark-bg: #0F0F0F; /* Темный фон под дерево */
    --text-white: #f0f0f0;
    --text-gray: #aaa;
    --text-gold: #C5813D;

    --font-serif: 'PT Serif', serif;
    --font-sans: 'PT Sans', sans-serif;
    --text-bezh: #EDCDA5;
    /* Переменные цветов для хедера (можно вынести в :root) */
}

.header-theme-video {
    --hdr-text: #C5813D; /* Светло-коричневый/бежевый для текста */
    --hdr-active: #c65316; /* Оранжевый акцент */
    --hdr-hover: #e07b42;
    --hdr-border: rgba(18, 13, 8, 0.3);
}
/* --- RESET & BASE --- */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-serif);
    background-color: var(--dark-bg);
    color: var(--text-white);
    overflow-x: hidden;
}

/* ВАЖНО: Отключаем системные жесты внутри книги */
.reader-viewport,
#book-zoom-wrapper, 
#flipbook, 
#flipbook .page, 
#flipbook .page-wrapper {
    touch-action: none;       /* Запрет системных свайпов */
    -webkit-user-select: none; /* Запрет выделения */
    user-select: none;
    -webkit-touch-callout: none;
    /* Убираем подсветку при тапе на Android */
    -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }

/* Фоновая текстура */
.wood-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Путь к текстуре из старой статики, если она есть */
    background: url('/static/image/video/bg-web.jpg');
    z-index: -1;
}

/* --- HEADER (VIDEO THEME) --- */

.main-header {
    padding: 20px 0 10px;
    border-bottom: none; /* Убираем линию на всю ширину, если она не нужна */
    position: relative;
    z-index: 100;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Выравнивание по верху, так как центр высокий */
    padding: 0 30px;
}

/* --- LEFT & RIGHT BLOCKS --- */
.header-left, .header-right {
    flex: 1;
    display: flex;
    gap: 30px;
    padding-top: 10px; /* Компенсация высоты, чтобы быть на уровне лого */
}
.header-right {
    justify-content: flex-end;
}

/* Ссылки с иконками */
.icon-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.icon-link:hover { opacity: 1; }

.icon-link img {
    height: 40px; /* Размер иконок */
    width: auto;
}

.icon-link span {
    font-family: var(--font-serif); /* PT Sans */
    font-size: 14px;
    line-height: 1.2;
    text-transform: none; /* На макете вроде не капс, или мелкий капс */
    color: var(--hdr-text);
    border-bottom: 1px solid transparent;
}
.icon-link:hover span {
    color: var(--hdr-active);
    border-bottom-color: var(--hdr-active);
}

/* Поиск */
.search-form {
    display: flex;
    align-items: center;
    /*border-bottom: 1px solid var(--hdr-border);
    padding-bottom: 5px;
    margin-right: 20px;
    height: 35px;*/
    border-bottom: 1px solid var(--hdr-text);
}
.search-form input {
    background: transparent;
    border: none;
    color: var(--hdr-text);
    font-family: var(--font-serif);
    font-size: 14px;
    width: 140px;
    outline: none;
}
.search-form input::placeholder { color: rgba(166, 142, 116, 0.5); }
.search-form button {
    background: none; border: none; cursor: pointer; padding: 0;
}
.search-form button img {
    height: 16px;
    opacity: 0.7;
}

/* --- CENTER BLOCK --- */
.header-center {
    flex: 2; /* Занимает больше места */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Верхняя строка с орнаментами */
.logo-top-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}
.ornament-svg {
    height: 18px; /* Высота узора */
    width: auto;
    opacity: 0.8;
}
.anthology-text {
    font-family: var(--font-serif);
    font-size: 18px;
    color: #EDCDA5; /* Чуть светлее */
    letter-spacing: 0.5px;
}

/* Заголовок "Круг лета Господня" */
.main-title {
    font-family: var(--font-serif);
    font-size: 42px; /* Крупный размер как на макете */
    color: #EDCDA5; /* Почти белый */
    text-decoration: none;
    line-height: 1.1;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* НАВИГАЦИЯ (Кнопки) */
.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    font-family: var(--font-serif);
    font-size: 22px;
    font-style: italic;
    color: var(--hdr-text); /* Темный цвет для неактивных ссылок (как "Стихи" на скрине) */
    text-decoration: none;
    padding: 8px 25px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-btn:hover {
    color: var(--hdr-active);
}

/* АКТИВНАЯ КНОПКА (Как "Видео" на скрине) */
.nav-btn.active {
    color: var(--hdr-active); /* Оранжевый текст */
    background-color: rgba(20, 15, 12, 0.6); /* Темная подложка */
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.8), /* Внутренняя тень сверху */
        0 1px 0 rgba(255,255,255,0.05); /* Легкий блик снизу */
    text-shadow: 0 1px 2px rgba(0,0,0,1);
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ ХЕДЕРА (Специальный дизайн) --- */
@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        position: relative;
        
    }

    /* Скрываем боковые части */
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    /* Центр */
    .header-center { width: 100%; margin-top: 10px; }
    
    /* Заголовки */
    .logo-top-row { justify-content: center; margin-bottom: 5px; }
    .ornament-svg { height: 16px; } /* Орнаменты поменьше */
    
    .main-title {
        font-size: 30px;
        margin-bottom: 20px;
    }
    .anthology-text {
            font-size: 14px;
        }

    /* --- КНОПКА БУРГЕРА --- */
    .hamburger-btn {
        /* Делаем кнопку круглым оранжевым значком */
        background-color: var(--gold, #D13A04); 
        border: none;
        
        /* Задаем ровные размеры для круга */
        width: 60px; 
        height: 60px;
        border-radius: 50%;
        
        /* Центрируем полоски внутри */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px; /* Расстояние между полосками */
        
        cursor: pointer;
        margin: 0 auto 20px; /* Центрируем под заголовком */
        
        /* Легкая тень для объема */
        box-shadow: 0 4px 10px rgba(0,0,0,0.4);
        transition: transform 0.2s, background-color 0.3s;
    }

    /* Эффект при нажатии/наведении */
    .hamburger-btn:active,
    .hamburger-btn:hover {
        transform: scale(0.95);
        background-color: var(--gold-hover, #C5813D);
    }

    .hamburger-btn span {
        width: 32px; /* Длина полоски */
        height: 4px; /* Толщина полоски */
        background-color: #EDCDA5; /* Бежевый цвет из макета */
        border-radius: 4px; /* Сильное скругление краев, как на скрине */
        transition: 0.3s;
    }

    /* --- 2. НАВИГАЦИЯ (СТИХИ / ВИДЕО / МУЗЫКА) --- */
    /* Теперь она видна на мобильном под кнопкой */
    .main-nav {
        display: flex !important; /* Принудительно показываем */
        justify-content: center;
        width: 100%;
        gap: 5px;
    }
    
    .nav-btn {
        font-size: 24px;
        padding: 8px 15px;
        background: transparent; /* Убираем фон кнопок на мобильном, если нужно */
        color: #887; /* Цвет неактивных */
    }
    .nav-btn.active {
        background: rgba(0,0,0,0.3); /* Темная подложка для активного */
        box-shadow: none; /* Упрощаем тень */
    }

    /* --- 3. МОДАЛЬНОЕ ОКНО (POPUP) --- */
    .mobile-menu-overlay {
        /* Меняем display/opacity на visibility/opacity для плавной анимации */
        visibility: hidden;
        opacity: 0;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.85); /* Чуть темнее фон */
        z-index: 9999; /* Поверх всего */
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Класс open добавляется JS-ом */
    .mobile-menu-overlay.open {
        visibility: visible;
        opacity: 1;
    }

    .mobile-menu-card {
        box-sizing: border-box; 
        width: 90%;
        max-width: 400px;
        
        /* ИСПРАВЛЕНИЕ 1: УДАЛЯЕМ min-height! Он насильно вытягивал карточку */
        /* min-height: 550px; <-- УДАЛИТЬ */
        
        /* ИСПРАВЛЕНИЕ 2: Задаем жесткие пропорции вашей SVG-рамки (Ширина / Высота) */
        /* ЗАМЕНИТЕ ЦИФРЫ 350 и 550 НА РЕАЛЬНЫЕ РАЗМЕРЫ РАМКИ ИЗ ВАШЕГО МАКЕТА! */
        aspect-ratio: 350 / 550; 
        
        background-color: transparent; 
        border: none;
        border-radius: 0;
        box-shadow: none;
        
        background-image: url('/static/img/menu-frame.svg');
        background-repeat: no-repeat;
        background-position: center top;
        
        /* ИСПРАВЛЕНИЕ 3: Теперь фон вписывается пропорционально и никогда не искажается */
        background-size: contain; 
        
        filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));

        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        
        /* ИСПРАВЛЕНИЕ 4: Отступы тоже лучше задать в процентах, чтобы они сжимались вместе с рамкой */
        padding: 20% 8% 10%; 
        
        transform: translateY(-20px);
        transition: transform 0.4s ease;
    }

    .mobile-menu-overlay.open .mobile-menu-card {
        transform: translateY(0);
    }

    /* Кнопка ЗАКРЫТЬ (Крестик) */
    .mobile-menu-card .close-btn {
        position: absolute;
        
        /* ИСПРАВЛЕНИЕ 1: Используем проценты вместо пикселей! 
           Начните с 8%. Если кнопка выше выемки - ставьте 9% или 10%. 
           Если ниже - 7% или 6%. */
        top: 0px; 
        
        left: 50%;
        
        /* ИСПРАВЛЕНИЕ 2: Возвращаем центрирование по вертикали (-50%) 
           Теперь координаты (left: 50%, top: 8%) указывают ровно в ЦЕНТР кнопки */
        transform: translate(-50%, -50%); 
        
        box-sizing: border-box; 
        width: 65px; 
        height: 65px;
        background-color: #EDCDA5; 
        border: 3px solid #c65316; 
        border-radius: 50%;
        color: #c65316; 
        font-size: 34px; 
        font-weight: 300;
        cursor: pointer;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ссылки внутри меню */
    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 20px;
        text-align: center;
        margin-bottom: 30px;
        width: 100%;
    }
    .mobile-menu-links .mobile-link {
        font-family: var(--font-serif);
        font-size: 19px;
        color: #EDCDA5;
        text-decoration: none;
        padding-bottom: 10px;
    }

    /* Поиск в меню */
    .mobile-search-wrapper {
        width: 100%;
        margin-bottom: 30px;
        border-bottom: 1px solid #EDCDA5;
        padding-bottom: 5px;
    }
    .mobile-search-form {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .mobile-search-form input {
        width: 100%;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 16px;
        outline: none;
        font-family: ui-sans-serif;
    }
    .mobile-search-form button {
        background: none; border: none; font-size: 20px; color: #EDCDA5; cursor: pointer;
    }

    /* Иконки внизу меню */
    .mobile-icons-grid {
        display: flex;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }
    .mobile-icons-grid .mobile-icon-box {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        color: #ccc;
        text-decoration: none;
        transition: 0.2s;
    }
    .mobile-icons-grid .mobile-icon-box:hover {
        color: #EDCDA5;
    }

    .mobile-icons-grid .mobile-icon-box img {
        height: 35px;
        margin-bottom: 10px;
    }
    .mobile-icons-grid .mobile-icon-box span {
        font-family: var(--font-serif);
        font-size: 11px;
        line-height: 1.3;
    }
}

/* --- VIDEO PAGE LAYOUT --- */
.video-page-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ГЛАВНЫЙ ВИДЖЕТ (Черный блок) */
.cinema-widget {
    background-color: #050505; /* Почти черный */
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 1px solid #1a1a1a;
}

/* Шапка внутри виджета */
.cinema-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px; /* Отступ до видео */
    padding-bottom: 0;
    border-bottom: none;
}

#main-header-text {
    font-family: var(--font-serif);
    font-size: 22px; /* Чуть уменьшили, как на скрине */
    color: #EDCDA5; /* Бежево-золотой цвет */
    margin: 0;
    font-weight: normal;
    letter-spacing: 0.5px;
}

/* Переключатель (Toggle) */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 16px;
    margin: 0;
    padding: 0;
    box-shadow: none; /* Убрали лишнюю тень вокруг тумблера */
}
.toggle-label.active { opacity: 1; /* Яркий для активного */} 

/* Стилизация текста тумблера */
.toggle-label {
    color: #c65316; /* Оранжевый цвет для всех */
    opacity: 0.5; /* Полупрозрачный для неактивного */
    transition: opacity 0.3s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #29170fb5;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 4px; bottom: 4px;
    background-color: var(--gold); /* Цвет кружка неактивный */
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--gold); /* Цвет кружка активный */
}

/* ТЕЛО ВИДЖЕТА (Плеер + Список) */
.cinema-body-row {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Пропорции 66% / 33% */
    gap: 40px; /* Большой отступ между видео и списком */
}

/* Плеер */
.player-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.responsive-video-container {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    height: 100%;
}
.responsive-video-container iframe {
    width: 100%;
    height: 100%;
}
.player-toolbar {
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 14px;
    font-family: var(--font-sans);
}
.player-toolbar .url { opacity: 0.5; }
.player-toolbar .icons span { margin-left: 15px; cursor: pointer; }
.player-toolbar .icons span:hover { color: var(--gold); }


/* ПЛЕЙЛИСТ */
.playlist-area {
    /* На макете список имеет фиксированную высоту и скролл */
    height: 450px; 
    overflow: hidden; /* Скрываем внешний скролл */
    position: relative;
}

.playlist-scroll {
    height: 100%;
    overflow-y: auto;
    padding-right: 15px; /* Отступ для скроллбара */
}

/* СТИЛИЗАЦИЯ СКРОЛЛБАРА (Как на макете - тонкая линия) */
.playlist-scroll::-webkit-scrollbar {
    width: 4px; /* Очень тонкий */
}
.playlist-scroll::-webkit-scrollbar-track {
    background: #1a1a1a; /* Цвет дорожки (темно-серый) */
    border-radius: 2px;
}
.playlist-scroll::-webkit-scrollbar-thumb {
    background: var(--gold); /* Оранжевый ползунок */
    border-radius: 2px;
    height: 50px; /* Примерная высота, браузер сам решит */
}

/* Элемент списка */
.playlist-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: 0.2s;
    align-items: flex-start;
}
.playlist-item:first-child { padding-top: 0; }
.playlist-item:hover .line-title { color: #fff; }

/* Активный элемент */
.playlist-item.active .line-author,
.playlist-item.active .line-title,
.playlist-item.active .time-col {
    color: var(--gold); /* Всё становится оранжевым */
}

.time-col {
    width: 60px;
    font-family: var(--font-sans);
    color: #f0f0f0;
    font-size: 13px;
    padding-top: 2px;
    flex-shrink: 0;
}

.info-col {
    flex: 1;
}

.line-author {
    font-size: 15px;
    color: #f0f0f0;
    margin-bottom: 4px;
    font-family: var(--font-serif);
}

.line-title {
    font-size: 14px;
    color: #888; /* Серый для названия произведения */
    font-style: italic;
    line-height: 1.4;
}

/* --- SEPARATOR & SLIDER SECTION --- */

/* Деревянная линия-полка */
.wood-separator {
    width: 100%;
    height: 55px;
    background: url(/static/img/wood_line.png) center;
    z-index: 2;
    position: relative;
    margin-top: -10px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Деревянная линия-полка */
.wood-separator-book {
    width: 100%;
    height: 40px;
    background: url(/static/img/wood_line.png) center;
    position: relative;
    margin-top: -85px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}
/* Темная секция на всю ширину */
.actors-section-full {
    background-color: #050505; /* Черный фон */
    border-top: 1px solid #1a1a1a;
    padding: 40px 0;
    width: 100%;
    /* Тень внутрь, чтобы создать глубину под полкой */
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.8);
}

/* Контейнер слайдера (центровка) */
.actors-slider-container {
    max-width: 1300px; /* Совпадает с шириной плеера */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.actors-slider-track {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px; /* Отступы, чтобы тени/бордеры не обрезались */
    scrollbar-width: none; /* Скрыть скроллбар FF */
}
.actors-slider-track::-webkit-scrollbar { display: none; } /* Скрыть скроллбар Chrome */

/* КАРТОЧКА АКТЕРА */
.actor-card {
    flex: 0 0 220px; /* Фиксированная ширина карточки */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #222; /* Тонкая рамка по умолчанию */
}

.actor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Активная карточка (Оранжевая рамка) */
.actor-card.active {
    border: 1px solid var(--gold);
    box-shadow: 0 0 10px rgba(198, 83, 22, 0.3);
}

.actor-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.actor-photo-wrapper {
    height: 140px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.actor-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Фото заполняет область */
    opacity: 0.8;
    transition: opacity 0.3s;
}

.actor-card:hover img, 
.actor-card.active img {
    opacity: 1;
}

.no-photo {
    width: 100%; height: 100%; background: #1a1a1a;
}

.actor-info {
    padding: 12px 10px;
    text-align: center;
    background: #080808;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.actor-info .name {
    font-family: var(--font-serif);
    font-size: 15px;
    color: #f0f0f0;
    line-height: 1.2;
}

.actor-info .count {
    font-family: var(--font-sans);
    font-size: 12px;
    color: #666;
}

/* Кнопки слайдера */
.slider-btn {
    background: none;
    border: none;
    color: var(--gold); /* Оранжевые стрелки */
    font-size: 40px;
    font-family: monospace; /* Чтобы стрелки были тонкими */
    font-weight: 100;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.3s;
    user-select: none;
}
.slider-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--gold);
}

/* АДАПТИВНОСТЬ */
@media (max-width: 900px) {
    .actor-card {
        flex: 0 0 160px; /* Карточки поменьше */
    }
    .actor-photo-wrapper {
        height: 100px;
    }
    .actor-info .name {
        font-size: 13px;
    }
    .slider-btn {
        display: none; /* На мобилках скроллим пальцем, стрелки не нужны */
    }
}

/* АДАПТИВНОСТЬ (Mobile) */
@media (max-width: 900px) {
    .cinema-widget {
        padding: 15px;
        border-radius: 10px;
    }
    .cinema-header-row {
        flex-direction: column-reverse; 
        align-items: center;
        gap: 15px;
        text-align: center;
        margin-bottom: 20px;
    }
    .toggle-switch-container {
        align-self: center; /* Центрируем тумблер */
        font-size: 16px;
    }
    #main-header-text {
        font-size: 18px;
        line-height: 1.3;
    }
    
    .cinema-body-row {
        grid-template-columns: 1fr; /* Одна колонка */
        gap: 20px;
    }
    
    .playlist-area {
        height: auto;
        max-height: 300px;
    }
}

/* --- FOOTER --- */
.main-footer {
    background-color: #fdfbf7; /* Светло-кремовый фон */
    color: #8a6d50; /* Светло-коричневый/золотистый цвет текста */
    padding-top: 60px;
    margin-top: 0; /* Убираем отступ, так как футер стыкуется с темным блоком выше */
    font-family: var(--font-serif);
    position: relative;
    font-size: 14px;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 40px 60px; /* Отступ снизу для контента до линии */
}

.footer-col {
    flex: 1;
}

/* Колонка 1: Лого + Текст */
.col-left {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.footer-logo {
    width: 60px; /* Размер логотипа */
    height: auto;
    opacity: 0.8;
}

/* Типографика текстов */
.copyright {
    font-family: var(--font-sans); /* Цифры без засечек */
    font-size: 12px;
    color: #3e3a35; /* Темно-серый/коричневый для дат */
    margin-bottom: 5px;
}
.company-name {
    font-size: 14px;
    color: #a67c52; /* Золотистый цвет названий */
    line-height: 1.4;
}

/* Колонка 2: Центр */
.col-center {
    text-align: center; /* Или left, как на макете - там вроде выравнивание по левому краю столбца */
    padding-left: 40px; /* Сдвиг, если нужно */
}

/* Колонка 3: Право */
.col-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Ссылки (О проекте, О нас) */
.footer-links a {
    color: #a67c52;
    text-decoration: underline;
    margin-left: 20px;
    font-size: 14px;
}
.footer-links a:hover {
    color: #3e3a35;
    text-decoration: none;
}

/* Контакты */
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.footer-contacts a {
    font-family: var(--font-serif);
    color: #3e3a35; /* Темный цвет для телефона/email */
    font-size: 14px;
}
.footer-contacts .email {
    color: #a67c52;
}

/* Соцсети */
.footer-socials {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 5px;
    align-items: center;
}
.social-icon {
    font-family: var(--font-sans);
    font-weight: bold;
    color: #a67c52;
    font-size: 12px;
}

/* --- DECORATIVE LINE --- */
.footer-flower-line {
    width: 100%;
    height: 60px; /* Высота полоски с растениями */
    background: url('/static/img/footer_line.png') repeat-x bottom center;
    background-size: contain; /* Чтобы узор влез по высоте */
    /* Если фон картинки не прозрачный, а белый - всё ок. 
       Если прозрачный - он ляжет на кремовый фон футера. */
}

/* --- MOBILE ADAPTIVE FOOTER --- */
@media (max-width: 900px) {
    .main-footer {
        padding-top: 40px;
        text-align: center;
    }
    .footer-container {
        flex-direction: column;
        gap: 40px;
        padding: 0 20px 40px;
        align-items: center;
    }
    
    .col-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .col-center {
        padding-left: 0;
        text-align: center;
    }
    
    .col-right {
        text-align: center;
        align-items: center;
    }
    .footer-socials {
        justify-content: center;
    }
}

/* --- MOBILE ADAPTIVE --- */
.mobile-only { display: none; }

/* Прячем мобильное меню ТОЛЬКО на десктопе */
@media (min-width: 901px) {
    .mobile-menu-overlay { display: none!important; }
}

@media (max-width: 900px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }

    /* Video Page Mobile */
    .video-layout-grid {
        grid-template-columns: 1fr;
    }
    .playlist-area {
        height: auto;
        max-height: 400px;
    }
    .player-area { border-right: none; border-bottom: 1px solid #333; }

    /* Footer Mobile */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .contact-info { text-align: center; }
}


/* --- BOOKSHELF (ПОЛКА) --- */
.bookshelf-page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.bookshelf-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(166, 142, 116, 0.3);
    padding-bottom: 20px;
}
.bookshelf-search-row h1 {
    font-family: var(--font-serif);
    color: #f0f0f0;
    margin: 0;
}
.search-box {
    display: flex;
    border-bottom: 1px solid #666;
}
.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 5px;
    outline: none;
}
.search-box button {
    background: none; border: none; cursor: pointer; color: var(--gold);
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px;
    justify-items: center;
}

.book-item {
    cursor: pointer;
    text-align: center;
}

.book-cover {
    width: 200px; /* Примерная ширина */
    height: 280px; /* Примерная высота */
    position: relative;
    transition: transform 0.3s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    margin-bottom: 12px;
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-title-overlay {
    position: absolute;
    bottom: 20px; left: 0; width: 100%;
    text-align: center;
    color: #fff;
    font-family: var(--font-serif);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-size: 18px;
    opacity: 0;
    transition: 0.3s;
}

.book-item:hover .book-cover {
    transform: translateY(-10px) rotateY(-10deg);
}
.book-item:hover .book-title-overlay { opacity: 1; }


/* --- READER OVERLAY (ПОПАП) --- */
.reader-overlay {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #1d1c1b; /* Темный фон, как в style.css */
    z-index: 2000;
    flex-direction: column;
}

/* Toolbar */
.reader-toolbar {
    height: 60px;
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 5px 15px;
    cursor: pointer;
    font-family: var(--font-serif);
    transition: 0.2s;
    border-radius: 4px;
}
.toolbar-btn:hover { border-color: var(--gold); color: var(--gold); }

.close-reader .mobile-icon { display: none; }

#book-title-display {
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 18px;
}

/* Viewport */
.reader-viewport {
    flex: 1;
    position: relative;
    overflow: hidden!important; /* Важно! */
    display: flex; /* Центрируем книгу */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    /* Важно для жестов */
    touch-action: none;
}

/* Навигационные стрелки */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 40px;
    padding: 20px 10px;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
}
.nav-arrow:hover { background: var(--gold); }
.nav-arrow.prev { left: 10px; }
.nav-arrow.next { right: 10px; }

/* Wrapper для зума */
#book-zoom-wrapper {
    /* Размеры задаются JS-ом */
    transition: transform 0.2s ease-out;
    position: absolute; /* Будем двигать JS-ом */
    /* Центрируем книгу внутри подложки */
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    /* Важно для мобильных: убираем лишние отступы, JS сам всё посчитает */
    margin: 0;
    /* Эти размеры будут переопределены JS-ом, но для надежности */
    transform-origin: center center;

    /* ВАЖНО: Скрываем вторую половину книги на мобильных */
    overflow: visible!important; 
    transition: width 0.3s, height 0.3s;
    /* Убираем лишние анимации, чтобы не конфликтовать с turn.js */
    will-change: left, top;
}
#book-container-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0; /* Под книгой */
}
/* На мобильных (ширина < 900px, как у вас в JS) */
@media (max-width: 900px) {
    #book-zoom-wrapper {
        /* JS сам задаст ширину, равную двойной книге. 
        CSS просто скрывает лишнее, выходящее за пределы экрана. */
        display: flex; 
        justify-content: center;
        overflow: hidden; 
        /* transition: transform 0.2s;  <-- Это можно убрать, если тормозит зум */
        /* === ИСПРАВЛЕНИЕ ПЛАВНОСТИ === */
        /* Мы анимируем свойство left, так как JS двигает книгу через left */
        transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1), top 0.5s cubic-bezier(0.25, 1, 0.5, 1);
        
        /* transform (зум) делаем быстрее, чтобы ресайз не тормозил */
        will-change: left, top;
    }
    
    #flipbook {
        /* Важно: плавность сдвига влево-вправо */
        /* Убираем транзишн с самой книги, так как двигаем обертку */
        transition: none !important; 
        transform-origin: center center;
    }
    /* Но при листании самой страницы (анимация turn.js) плавность контейнера не должна мешать */
    #flipbook.turning {
        
    }
}

/* --- ВНУТРЕННОСТИ КНИГИ (из старого CSS адаптировано) --- */
#flipbook .page {
    background-color: #fcfbf7!important; /* Цвет бумаги */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    background-size: 100% 100% !important;
}
/* Переносим стили текста из render_book_page.html / style.css */
#flipbook .text {
    position: absolute;
    color: #000;
    font-family: 'Times New Roman', serif;
    font-size: 16px; /* Базовый размер */
}


/* --- MOBILE READER --- */
@media (max-width: 900px) {
    .reader-toolbar { padding: 0 10px; }
    
    .desktop-controls { display: none; }
    .mobile-controls { display: block; position: relative; }
    
    .desktop-text { display: none; }
    .close-reader .mobile-icon { display: inline; font-size: 20px; }
    .close-reader { border: none; font-size: 24px; padding: 0; }

    /* Dropdown */
    .reader-dropdown {
        display: none;
        position: absolute;
        top: 40px; 
        
        /* ИСПРАВЛЕНИЕ: Меняем right: 0 на left: 0 */
        left: 0; 
        
        background: #222;
        border: 1px solid #444;
        border-radius: 4px;
        min-width: 150px;
        
        /* ИСПРАВЛЕНИЕ: Добавляем z-index, чтобы меню всегда было поверх книги */
        z-index: 3000; 
        box-shadow: 0 5px 15px rgba(0,0,0,0.5); /* Добавил легкую тень для красоты*/
    }
    .dropdown-item {
        padding: 10px 15px;
        color: #fff;
        border-bottom: 1px solid #333;
        cursor: pointer;
    }
    .dropdown-item:hover { background: #333; }
}

@media (min-width: 901px) {
    .mobile-controls { display: none; }
}

/* --- СТИЛИЗАЦИЯ КОНТЕНТА КНИГИ (Адаптация старого дизайна) --- */

/* 1. Базовые настройки страницы */
#flipbook .page {
    background-color: #fcfbf7 !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    /* Важно: сбрасываем наследование, чтобы координаты считались от угла страницы */
    position: relative; 
    overflow: hidden; /* Чтобы текст не вылезал за края */
}

/* 2. Позиционирование блоков текста */
/* В render_book_page.html у блоков есть класс .text */
#flipbook .text {
    position: absolute; /* Обязательно absolute, чтобы работали top/left из inline-стилей */
    
    /* Восстанавливаем базовый размер шрифта как в старом JS */
    /* В book.js было: 10 * book_height / max_height + 'pt' */
    /* Так как мы рендерим в max_height (1024), то шрифт = 10pt */
    font-size: 10pt; 
    font-family: 'Times New Roman', serif; /* Или ваш кастомный шрифт */
    line-height: 1.2;
    color: #000;
}

/* 3. Картинки внутри текста */
.poem_img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

/* 4. Кнопки воспроизведения (Play) */
/* Адаптируем их под новый масштаб */
.play {
    width: 21px;
    height: 21px;
    background: url("/static/image/book/play_button.png") no-repeat 0 0;
    background-size: contain;
    position: absolute;
    cursor: pointer;
    z-index: 100;
    /* Сдвиги из старого book.js */
    top: 2px; 
    left: -30px; 
}
.play.stop {
    background-image: url("/static/image/book/pause_button.png");
}

/* 5. Исправление для заголовков и авторов */
#flipbook .author {
    font-size: 10pt;
    margin-bottom: 10px;
}
#flipbook .caption {
    font-size: 10pt;
    position: relative; /* Чтобы кнопка play позиционировалась относительно заголовка */
}

/* --- ОПТИМИЗАЦИЯ АНИМАЦИИ --- */
#flipbook .page {
    /* Включаем аппаратное ускорение */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    /* Убираем мерцание "изнанки" страницы */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Улучшает сглаживание при трансформации */
    -webkit-perspective: 1000;
    perspective: 1000;
}

#flipbook {
    /* Убираем дерганье самого контейнера */
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Класс для мгновенных изменений без анимации */
.no-transition,
.no-transition #book-zoom-wrapper,
.no-transition #flipbook {
    transition: none !important;
}

/* 1. Скрываем стрелки на мобильных, они мешают хватать углы */
@media (max-width: 900px) {
    .nav-arrow {
        display: none !important;
    }
}

/* --- POEM POPUP (MOBILE) --- */
.poem-popup-overlay {
    display: none; /* Скрыт по умолчанию */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Затемнение фона */
    z-index: 3000; /* Поверх всего (overlay книги имеет 2000) */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.poem-popup-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 80vh; /* Высота попапа */
    
    /* Фон из вашей картинки */
    background: url('/static/img/popup_book_page.png') no-repeat center center;
    background-size: 100% 100%; /* Растягиваем картинку на весь блок */
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 50px 40px 40px 40px; /* Отступы внутри картинки (подбираются под дизайн) */
    box-sizing: border-box;
}

/* Кнопка закрыть */
.poem-close-btn {
    position: absolute;
    top: 5px; 
    right: 5px;
    width: 40px; height: 40px;
    background: transparent;
    border: none;
    font-size: 30px;
    color: #5d4037; /* Темно-коричневый под старину */
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
}

/* Область текста со скроллом */
.poem-popup-content {
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Вертикальный скролл */
    
    /* Стилизация скроллбара (тонкий и незаметный) */
    scrollbar-width: thin;
    scrollbar-color: rgba(93, 64, 55, 0.5) transparent;
}

#poem-popup-text {
    font-family: 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.5;
    color: #2c1e16; /* Цвет текста */
    text-align: left; /* Или center, как вам нравится */
    white-space: normal; /* Обычный перенос текста */
}

/* Адаптация картинки */
@media (max-width: 600px) {
    .poem-popup-container {
        padding: 40px 25px 30px 25px; /* Чуть меньше отступы на узких экранах */
    }
}

/* --- СТИЛИ ДЛЯ ТЕКСТА В ПОПАПЕ --- */
#poem-popup-text {
    /* Базовые настройки для контейнера */
    font-family: 'Times New Roman', serif;
    font-size: 22px !important;       /* Крупный шрифт */
    line-height: 1.2 !important;      /* Удобный межстрочный интервал */
    color: #2c1e16 !important;        /* Темно-коричневый цвет */
    text-align: left;
    white-space: normal;
}

/* ВАЖНО: Применяем эти же стили ко всем вложенным элементам (p, span, div),
   чтобы сбросить форматирование, пришедшее со страницы */
#poem-popup-text * {
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    font-family: inherit !important;
    
    /* Сбрасываем позиционирование, если оно скопировалось */
    position: static !important; 
    display: block !important;    /* Или inline, если нужно, но block для стихов надежнее */
    margin-bottom: 10px !important; /* Отступы между строфами */
    height: auto !important;
    width: auto !important;
    line-height: 1.25 !important;
    max-width: 100%;
}

/* --- СТИЛИ ДЛЯ БАННЕРА (BOOK POPUP) --- */
.book-popup {

    position: relative;
    top: 20px;
    right: auto;
    width: 90%;
    margin: 0 auto 20px;

    display: block;
    /*position: absolute;*/
    /*top: 157px;*/      /* Как в старой версии */
    /*right: 50px;*/     /* Отступ справа */
    /*width: 250px;*/    /* Ширина баннера */
    background: rgba(255, 255, 255, 0.6); /* Полупрозрачный фон (опционально) */
    padding: 15px;
    border-radius: 4px;
    z-index: 100;    /* Поверх текста */
    font-family: 'Times New Roman', serif;
    color: #4a3c31;  /* Коричневый цвет текста */
}

.book-popup .inf, .book-popup .anim {
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
}

.book-popup .dotted {
    border-bottom: 1px dotted #8d7b6b;
    margin: 5px 0 10px;
}

.book-popup .solid {
    border-bottom: 1px solid #8d7b6b;
    margin: 15px 0;
}

.book-popup .inf-text {
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 10px;
}

.book-popup .anim-text {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    display: block;
}

.book-popup .p-button {
    text-align: center;
    margin-top: 10px;
}

.book-popup .p-button a {
    display: inline-block;
    padding: 6px 20px;
    background: #4a3c31;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border-radius: 3px;
    transition: background 0.3s;
}

.book-popup .p-button a:hover {
    background: #6d5848;
}

/* Скрываем на мобильных, если они мешают, или адаптируем */
@media (max-width: 900px) {
    .book-popup {
        position: relative;
        top: 20px;
        right: auto;
        width: 90%;
        margin: 0 auto 20px;
        background: rgba(255,255,255,0.8);
    }
}

/* --- АУДИО ПЛЕЕР --- */
#audio-player-bar {
    position: fixed;
    bottom: -150px; /* Скрыт внизу экрана */
    left: 0;
    width: 100%;
    height: 100px;
    background: #0f0b09; /* Темный фон (почти черный/коричневый) */
    /* Если есть текстура дерева, раскомментируйте следующую строку: */
    /* background: url('/static/image/wood_dark.jpg') repeat; */
    border-top: 1px solid #3e2b20;
    z-index: 9999;
    color: #fff;
    font-family: 'Times New Roman', serif;
    transition: bottom 0.4s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

#audio-player-bar.active {
    bottom: 0; /* Показываем */
}

.player-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* --- Левая часть: Актер --- */
.player-left {
    display: flex;
    align-items: center;
    width: 300px;
}

.actor-avatar {
    width: 70px;
    /*height: 70px;*/
    /*border-radius: 50%;*/
    overflow: hidden;
    /*border: 2px solid #fff;*/
    /*margin-right: 15px;*/
    /*background: #333;*/
}

.actor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.actor-info {
    display: flex;
    flex-direction: column;
}

.actor-info .label {
    font-style: italic;
    color: #888;
    font-size: 14px;
    margin-bottom: 2px;
}

.actor-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: normal;
    color: #fff;
}

/* --- Центр: Управление --- */
.player-center {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    width: 100%;
}

.track-title {
    color: #d28e5d; /* Оранжево-коричневый цвет из макета */
    font-size: 16px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls-row {
    display: flex;
    align-items: center;
}

.play-btn {
    background: none;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    margin-right: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Иконка Play (треугольник) */
.play-btn::after {
    content: '';
    display: block;
    width: 0; 
    height: 0; 
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #fff;
    margin-left: 2px; /* Чуть сдвинуть для визуального центра */
}

/* Иконка Pause (две палочки) при классе .playing */
.play-btn.playing::after {
    content: '';
    width: 10px;
    height: 12px;
    border: none;
    border-left: 3px solid #fff;
    border-right: 3px solid #fff;
    margin-left: 0;
}

#curr-time, #total-dur {
    font-size: 14px;
    font-family: sans-serif; /* Цифры лучше смотрятся без засечек */
    width: 45px;
}

/* --- Слайдер прогресса --- */
.progress-container {
    flex-grow: 1;
    margin: 0 15px;
    position: relative;
    height: 20px; /* Область клика */
    display: flex;
    align-items: center;
}

input[type=range]#seek-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 2px;
    background: #555;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    z-index: 2;
}

/* Ползунок (кружок) */
input[type=range]#seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: 0; 
}

/* --- Правая часть: Закрыть --- */
.player-right {
    width: 50px;
    text-align: right;
}

.close-btn-player {
    background: none;
    border: none;
    color: #aaa;
    font-size: 30px;
    font-weight: 100;
    cursor: pointer;
    line-height: 1;
}
.close-btn-player:hover { color: #fff; }

/* Адаптив для мобильных */
@media (max-width: 768px) {
    #audio-player-bar { height: auto; padding: 10px 0; bottom: -200px; }
    .player-container { flex-direction: column; text-align: center; }
    .player-left { width: 100%; justify-content: flex-start; margin-bottom: 10px; }
    .actor-avatar { width: 40px; height: 40px; }
    .actor-info h3 { font-size: 16px; }
    .player-right { position: absolute; top: 10px; right: 10px; }
    .controls-row { width: 100%; }
}


/* --- MUSIC PAGE --- */
.music-page-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Верхний блок */
.music-top-section {
    position: relative;
    height: 250px; /* Высота подгоняется под размер граммофона */
    display: flex;
    flex-direction: column;
}

.music-toggle-center {
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 4;
}

.music-decorations {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Прижимаем к полке снизу */
    flex-grow: 1;
    padding: 0 50px;
    z-index: 3;
    margin-top: -38px;
}

.gramophone-img {
    height: 260px; /* Подстрой под реальный размер картинки */
    width: auto;
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.5)); /* Тень от граммофона */
 }
 .figures-img {
    width: 400px;
 }

/* Подзаголовок под полкой */
.music-subtitle {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 20px;
    color: #a67c52; /* Золотисто-коричневый */
    margin: 30px 0 40px;
    letter-spacing: 0.5px;
}

/* Фон книги с треками */
.music-book-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 80px;
}

.music-book-bg {
    width: 100%;
    max-width: 900px; /* Ширина разворота */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 60px 40px; /* Отступы от краев картинки до текста */
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    background-image: url(/static/image/music/music_field.jpg);
}

/* Сетка треков (2 колонки) */
.music-tracks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 60px; /* Расстояние между левой и правой страницей */
    row-gap: 20px;
}

/* Отдельный трек */
.track-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.track-item:hover {
    background: rgba(166, 124, 82, 0.1);
}

.track-item.active {
    background: rgba(255, 255, 255, 0.4); /* Подсветка активного трека */
}

/* Кнопка Play в списке (стилизуем под скриншот) */
.track-play-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #c65316;
    background: transparent;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Треугольник Play */
.track-play-btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-40%, -50%);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid #c65316;
}

/* Кнопка Pause для активного трека (две палочки) */
.track-item.active .track-play-btn::after {
    border: none;
    width: 6px;
    height: 8px;
    border-left: 2px solid #c65316;
    border-right: 2px solid #c65316;
    transform: translate(-50%, -50%);
}

/* Название трека */
.track-name {
    font-family: var(--font-serif);
    font-size: 15px;
    color: #5a4031; /* Темно-коричневый текст */
    line-height: 1.4;
    text-decoration: underline;
    text-decoration-color: rgba(90, 64, 49, 0.3);
}

.track-item.active .track-name {
    color: #c65316; /* Активный текст оранжевый */
    text-decoration-color: #c65316;
}

/* --- ТЕКСТ НА ПОЛКЕ --- */
.music-shelf #shelf-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: #9d6d45; /* Золотисто-коричневый (как на старом скрине) */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* Вдавленный эффект */
    margin-top: 15px;
    text-align: center;
}

/* --- ОБНОВЛЕННАЯ СЕТКА КНИГИ --- */
.music-tracks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 60px; /* Расстояние между страницами */
}

.tracks-column {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Отступы между треками в одной колонке */
}


/* Адаптив для мобильных */
@media (max-width: 900px) {
    .music-top-section { height: 130px; }
    .music-decorations { padding: 0px; }
    .gramophone-img { height: 120px; }
    .figures-img { width: 200px; }
    .music-tracks-grid { grid-template-columns: 1fr; /* В одну колонку */ }
    .music-book-bg { padding: 40px 20px; }
}

/* Адаптив для мобильных */
@media (max-width: 580px) {
    .music-shelf #shelf-title {
        margin: 40px 20px 0px 20px;
    }
    .wood-separator {
        height: 100px;
        background: url(/static/img/wood_line-m.png) center;
        margin-top: -25px;
    }
    .toggle-switch-container {
        display: flex;
        gap: 20px;
        /*align-self: flex-end;*/
        font-size: 18px;
        text-align: center;
    }
    .toggle-label {
        width: min-content;
    }

}

@media (max-width: 1200px) {
    .header-left, .header-right {
        flex-wrap: wrap;
    }
}

/* --- АДАПТИВ ДЛЯ ПОЛКИ С КНИГАМИ (ДВЕ КОЛОНКИ НА МОБИЛЬНЫХ) --- */
@media (max-width: 600px) {
    .bookshelf-grid {
        /* Жестко задаем 2 колонки одинаковой ширины */
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 15px; /* Отступы: 30px по вертикали, 15px по горизонтали */
    }
    
    .book-cover {
        width: 100%; /* Резиновая ширина по размеру колонки */
        max-width: 150px; /* Ограничитель, чтобы книги не раздуло на планшетах */
        height: 217px; /* Сбрасываем жесткую высоту 280px из десктопной версии */
        
        /* КРИТИЧНО ВАЖНО: сохраняем пропорции книги (Ширина / Высота) */
        aspect-ratio: 200 / 280; 
        
        margin: 0 auto 14px; /* Центрируем обложку внутри колонки */
    }
    
    /* Чуть уменьшаем шрифт подписей ("Осень", "Зима"), чтобы смотрелось аккуратнее */
    .book-item > div:not(.book-cover):not(.book-shadow) {
        font-size: 14px;
    }
}
.toc-holiday-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #c65316;
    margin: 25px 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* Заголовок месяца (напр., СЕНТЯБРЬ) */
.toc-month-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #2c1e16;
    margin: 30px 0 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
}

/* Заголовок праздника */
.toc-holiday-header {
    text-align: center;
    margin: 20px 0 15px;
}
.toc-holiday-date {
    font-size: 13px;
    color: #c65316; /* Красный/оранжевый цвет для дат */
    font-style: italic;
    margin-bottom: 5px;
}
.toc-holiday-name {
    font-size: 15px;
    font-weight: bold;
    color: #2c1e16;
}

/* --- СОДЕРЖАНИЕ (TOC) ПОПАП --- */
#toc-popup-overlay {
    display: none; /* JS будет делать display: flex */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 4000; /* ВАЖНО: Должно быть больше, чем у читалки (2000) */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.toc-popup-container {
    position: relative;
    width: 100%;
    max-width: 900px; /* Ширина разворота книги */
}

/* Кнопка закрытия (крестик) */
.toc-close-btn {
    position: absolute;
    top: -40px; right: -10px;
    background: none; border: none;
    color: #fff; font-size: 35px;
    font-weight: 300; cursor: pointer; z-index: 10;
}

.toc-book-bg {
    display: flex;
    width: 100%;
    background-image: url('/static/image/book/content_bg_2.jpg'); /* Обновленный фон */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    aspect-ratio: 900 / 600; 
    padding: 5% 6%;
    box-sizing: border-box;
}

.toc-left-page, .toc-right-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #2c1e16;
    font-family: var(--font-serif);
}

/* --- ЛЕВАЯ СТРАНИЦА (ОБЛОЖКА) --- */
.toc-left-page {
    align-items: center;
    text-align: center;
    padding-right: 4%;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.toc-cover-title { font-size: 26px; font-weight: bold; margin: 10% 0 5%; line-height: 1.1; }
.toc-cover-sub { font-size: 11px; text-transform: uppercase; font-weight: bold; margin-bottom: 5%; letter-spacing: 1px; }
.toc-cover-vol { font-size: 10px; font-weight: bold; margin-bottom: 10%; }
.toc-cover-img { width: 50%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 5px 10px rgba(0,0,0,0.3); }
.toc-cover-footer {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    align-items: center;
}
.toc-cover-footer span { font-size: 10px; font-weight: normal; font-style: italic; }
/* Новая иконка под текстом "Для семейного чтения" */
.toc-footer-icon {
    width: 45px; /* Размер можно будет подкорректировать */
    margin-top: 15px;
    object-fit: contain;
}

/* --- ПРАВАЯ СТРАНИЦА (СПИСОК) --- */
.toc-right-page {
    padding-left: 6%;
    height: 100%;
    overflow: hidden; 
}

.toc-title { text-align: center; font-size: 24px; font-weight: bold; margin-bottom: 15px; margin-top: 5%; }

.toc-tabs { text-align: center; font-size: 13px; font-weight: bold; margin-bottom: 25px; }
.toc-tabs span { cursor: pointer; color: #2c1e16; transition: 0.2s; }
.toc-tabs span:hover { color: #c65316; }
.toc-tabs span.active { color: #c65316; text-decoration: underline; }

.toc-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: #c65316 transparent;
}
.toc-scroll-area::-webkit-scrollbar { width: 4px; }
.toc-scroll-area::-webkit-scrollbar-thumb { background: #c65316; border-radius: 2px; }

/* Элемент списка */
.toc-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}
.toc-item:hover .toc-poem-title { color: #2c1e16; text-decoration-color: #2c1e16; }

.toc-play-btn {
    width: 20px; height: 20px;
    border-radius: 50%; border: 1px solid #c65316;
    position: relative; flex-shrink: 0; margin-top: 2px;
}
.toc-play-btn::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-40%, -50%);
    border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid #c65316;
}

/* ИСПРАВЛЕНИЕ: Отменяем старые стили .play (абсолютное позиционирование), чтобы кнопки не улетали */
.toc-item .toc-play-btn.play {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    background: transparent !important;
}

.toc-item-info { flex: 1; line-height: 1.3; }
.toc-author { font-size: 14px; font-weight: bold; }
.toc-poem-title { font-size: 14px; color: #c65316; font-weight: bold; text-decoration: underline; text-decoration-color: rgba(198, 83, 22, 0.4); transition: 0.2s; }
.toc-actor { font-size: 12px; color: #555; }

.toc-page-num { font-size: 14px; font-weight: bold; flex-shrink: 0; margin-left: 10px; }
.toc-separator { text-align: center; color: #888; letter-spacing: 2px; margin-bottom: 10px; font-weight: bold; }

/* Стили для названий месяцев и праздников */
.toc-month-title {
    text-align: center; font-size: 16px; font-weight: bold; color: #2c1e16;
    margin: 30px 0 15px; text-transform: uppercase; letter-spacing: 2px;
    border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 5px;
}
.toc-holiday-header { text-align: center; margin: 20px 0 15px; }
.toc-holiday-date { font-size: 13px; color: #c65316; font-style: italic; margin-bottom: 5px; }
.toc-holiday-name { font-size: 15px; font-weight: bold; color: #2c1e16; }

/* --- МОБИЛЬНЫЙ АДАПТИВ ДЛЯ TOC --- */
@media (max-width: 768px) {
    .toc-popup-container { max-width: 450px; }
    .toc-book-bg { 
        aspect-ratio: auto; 
        height: 80vh; 
        padding: 8% 6%;
        background-size: cover; 
        background-position: right center; 
    }
    .toc-left-page { display: none !important; }
    .toc-right-page { padding-left: 0; }
    .toc-close-btn { top: 10px; right: 10px; color: #5d4037; }
}

/* --- АЛФАВИТНЫЙ УКАЗАТЕЛЬ --- */

/* Оранжевая кнопка запуска */
.alph-main-btn {
    background-color: #c65316;
    color: #fff;
    font-family: var(--font-serif);
    font-size: 18px;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.alph-main-btn:hover { background-color: #a3410e; }

/* 4 картинки на левой странице */
.alph-four-images {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    padding: 0 10%;
}
.alph-four-images img {
    width: 22%;
    aspect-ratio: 1;
    object-fit: cover;
    filter: grayscale(100%); /* На макете они выглядят ч/б, если нужны цветные - удалите */
    opacity: 0.8;
}

/* Крупная буква в списке (А, Б, В...) */
.alph-letter-header {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #c65316;
    margin: 20px 0 10px;
}

/* Боковой алфавит (справа за пределами книги) */
.alph-sidebar {
    position: absolute;
    top: 50%;
    right: -40px; /* Выносим за правый край попапа */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
}
.alph-sidebar span {
    color: #fff;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
}
.alph-sidebar span:hover { color: #c65316; }

#alph-popup-overlay, #search-popup-overlay {
    display: none; /* JS будет делать display: flex */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- МОБИЛЬНАЯ ПАНЕЛЬ АЛФАВИТА --- */
.alph-mobile-nav {
    display: none; /* Скрыто на десктопе */
    width: 100%;
    overflow-x: auto; /* Горизонтальный скролл */
    white-space: nowrap;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    
    /* Прячем системный скроллбар для красоты */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.alph-mobile-nav::-webkit-scrollbar {
    display: none; 
}

/* Сами буковки-кнопки */
.alph-mobile-nav span {
    display: inline-block;
    padding: 6px 14px;
    font-size: 16px;
    font-family: var(--font-serif);
    font-weight: bold;
    color: #c65316;
    cursor: pointer;
    background: rgba(198, 83, 22, 0.1); /* Легкий оранжевый фон */
    border-radius: 6px;
    margin-right: 8px;
    transition: background 0.2s;
}
.alph-mobile-nav span:active {
    background: rgba(198, 83, 22, 0.3);
}

/* Включаем видимость панели на экранах телефонов */
@media (max-width: 768px) {
    .alph-mobile-nav.mobile-only {
        display: block; 
    }
}

/* --- ANIMATION WIDGET --- */
.anim-cinema-body {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 30px;
}

.anim-credits-left, .anim-credits-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
}

.anim-credits-left { text-align: right; }
.anim-credits-right { text-align: left; }

.credit-block p {
    color: #888;
    font-size: 13px;
    margin: 0 0 5px 0;
    font-family: var(--font-serif);
}

.credit-block h3 {
    color: #ddd;
    font-size: 16px;
    margin: 0 0 20px 0;
    font-family: var(--font-serif);
    font-weight: normal;
}

.anim-player-area {
    flex: 2.5; /* Центральное видео шире боковых колонок */
}

/* Карточки анимации в слайдере */
.anim-card {
    flex: 0 0 180px; 
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #222;
    transition: 0.2s;
    text-align: center;
    padding-bottom: 12px;
}

.anim-card:hover { 
    transform: translateY(-5px); 
    border-color: #555; 
}

.anim-card.active { 
    border-color: #c65316; /* Оранжевая рамка как на скрине */
}

.anim-card-img { 
    height: 100px; 
    margin-bottom: 10px; 
}

.anim-card-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.anim-card-title { 
    color: #ccc; 
    font-size: 14px; 
    padding: 0 10px; 
    font-family: var(--font-serif); 
}

.anim-card.active .anim-card-title { 
    color: #c65316; 
}

/* Мобильный адаптив для анимации */
@media (max-width: 900px) {
    .anim-cinema-body { flex-direction: column; }
    .anim-credits-left, .anim-credits-right { text-align: center; }
    .anim-player-area { width: 100%; }
    .anim-card { flex: 0 0 140px; }
}

/* Специфичные стили для боковых вкладок Поиска */
.alph-sidebar.search-sidebar {
    right: -80px; /* Отодвигаем чуть дальше, чтобы влезли целые слова */
    gap: 15px;
}
.alph-sidebar.search-sidebar span {
    font-size: 15px; /* Делаем шрифт чуть крупнее */
}

/* Подсветка активной вкладки (Десктоп) */
.alph-sidebar span.search-tab-btn.active {
    color: #c65316;
    text-decoration: underline;
}

/* Подсветка активной вкладки (Мобильные) */
.alph-mobile-nav span.search-tab-btn.active {
    background: rgba(198, 83, 22, 0.3);
}

/* ==========================================================================
   === ГЛАВНАЯ СТРАНИЦА (HOME) ===
   ========================================================================== */

.homepage-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #15110e;
}

/* --- САЙДБАР --- */
.home-sidebar {
    width: 140px;
    background-color: #1a1512; /* Темно-коричневый */
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* Идеально равномерное распределение */
    align-items: center;
    padding: 0; /* Flexbox сам создаст нужные отступы сверху и снизу */
    z-index: 100;
    box-shadow: 2px 0 15px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.side-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #ccc;
    font-size: 14px;
    font-family: var(--font-serif);
    transition: 0.3s;
    margin-bottom: 0px;
}
.side-link:hover { color: #EDCDA5; transform: scale(1.05); }
.side-link img { height: 48px; margin-bottom: 12px; opacity: 0.7; transition: 0.3s; }
.side-link:hover img { opacity: 1; }

.home-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - 140px); /* Вычитаем сайдбар */
}

/* --- ЭКРАН 1: HERO (ВИДЕО) --- */
.home-hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.hero-bg-video {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 15, 10, 0.7); /* Легкое затемнение */
    z-index: 1;
}

/* Шапка над видео */
.hero-header {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Увеличили padding снизу (80px), чтобы градиент мягко растворялся */
    padding: 30px 50px 80px; 
    color: #EDCDA5;
    /* ПРОЗРАЧНАЯ ПОДЛОЖКА (Мягкий градиент сверху вниз) */
    background: linear-gradient(to bottom, rgba(15, 10, 8, 0.9) 0%, rgba(15, 10, 8, 0.6) 50%, rgba(15, 10, 8, 0) 100%);
}
.h-links a { font-size: 14px; text-decoration: underline; color: #EDCDA5; }
.h-links a:hover { text-decoration: none; }
.h-links .dot { margin: 0 10px; font-size: 10px; opacity: 0.5; }

.h-center { text-align: center; }
.h-subtitle { font-size: 14px; margin-bottom: 5px; opacity: 0.8; }
.h-title { font-size: 42px; margin: 0 0 5px 0; font-weight: normal; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.h-subtext { font-size: 14px; font-style: italic; opacity: 0.8; }

.h-search form { display: flex; border-bottom: 1px solid rgba(237, 205, 165, 0.5); }
.h-search input { background: transparent; border: none; outline: none; color: #fff; width: 150px; padding: 5px; font-family: var(--font-serif); }
.h-search input::placeholder { color: rgba(237, 205, 165, 0.5); }
.h-search button { background: none; border: none; cursor: pointer; }
.h-search button img { height: 16px; opacity: 0.8; }

/* Центральное меню с HOVER SVG */
.hero-center-menu {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: auto; /* Центрирует по вертикали оставшееся пространство */
    padding: 0 50px;
    max-width: 1100px;
    flex-wrap: wrap;
}
.h-menu-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
    color: #fff;
    padding: 10px 20px 40px 20px;
    position: relative;
    transition: 0.3s;
    width: 250px;
    height: 250px;
    justify-content: center;
    align-items: center;
}
.h-menu-block-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
/* Оранжевая рамка из макета (изначально скрыта) */
.h-menu-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('/static/img/main_page/bg-main_menu-hover.svg') no-repeat center center;
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}
.h-menu-block:hover::before { opacity: 1; }

.h-menu-block h2 { font-size: 32px; font-weight: normal; margin: 0 0 20px; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.h-menu-block p { font-size: 14px; font-style: italic; line-height: 1.4; opacity: 0.8; margin: 0; }

/* Скролл вниз */
.scroll-down-btn {
    position: relative;
    z-index: 2;
    align-self: center;
    text-align: center;
    margin-bottom: 30px;
    color: #c65316;
    font-size: 16px;
    transition: 0.3s;
}
.scroll-down-btn:hover { color: #EDCDA5; }
.circle-arrow {
    width: 30px; height: 30px;
    background: #c65316; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 10px auto 0;
    transition: 0.3s;
}
.scroll-down-btn:hover .circle-arrow { background: #EDCDA5; color: #111; transform: translateY(5px); }

/* --- ЭКРАН 2: СЕТКА --- */
/* --- ЭКРАН 2: СЕТКА --- */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}
.grid-item {
    aspect-ratio: 16 / 9; 
    position: relative;
    overflow: hidden;
}
.item-light { background: #fdfbf7; color: #2c1e16; }
.item-dark { background: #111; color: #fff; }
.item-black { background: #000; display: flex; align-items: center; justify-content: center; } 

/* Специфичный блок "О проекте" */
.item-about {
    background-size: cover;
    background-position: center;
}
.item-about .grid-content {
    text-align: left; /* Выравнивание по левому краю по макету */
    padding: 50px;
    height: 100%;
    box-sizing: border-box;
}
.grid-img-book {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 45%; /* Книга занимает низ блока */
    object-fit: contain;
}

/* --- ОБЩИЕ СТИЛИ СЛАЙДЕРОВ --- */
.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}
/* Один слад */
.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.slide.active {
    opacity: 1;
    z-index: 1;
}

/* Оверлей для темного блока с актерами */
.grid-content-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    padding: 50px;
    display: flex; flex-direction: column; justify-content: flex-start;
    text-align: left;
    box-sizing: border-box;
}
.grid-content-overlay h2 { font-size: 26px; font-weight: normal; margin: 0 0 10px; color: #fff; line-height: 1.2; }
.grid-content-overlay .actor-name { font-size: 16px; font-style: italic; color: #aaa; margin: 0; }

/* Кнопка Play */
.play-btn-large {
    width: 0; height: 0;
    border-top: 30px solid transparent; border-bottom: 30px solid transparent; border-left: 45px solid #a33b09;
    cursor: pointer; transition: 0.2s;
}
.play-btn-large:hover { border-left-color: #c65316; transform: scale(1.1); }

/* --- СЛАЙДЕР ОТЗЫВОВ --- */
.reviews-content { 
    padding: 50px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.reviews-content h2 {
    font-size: 24px; font-weight: normal; margin: 0 0 15px; text-align: left;
}
.review-text-block { 
    position: relative;
    text-align: center;
    margin: auto;
    max-width: 80%;
}
.quote-marks { 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 150px; font-family: Georgia, serif; color: rgba(198, 83, 22, 0.05); 
    line-height: 0; z-index: 0;
}
.r-text { font-size: 15px; color: #444; margin-bottom: 15px; position: relative; z-index: 1; font-style: italic;}
.r-author { font-size: 14px; font-weight: bold; color: #2c1e16; position: relative; z-index: 1;}

/* --- ЭЛЕМЕНТЫ НАВИГАЦИИ СЛАЙДЕРА --- */
.nav-arrow { 
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 40px; font-weight: 100; font-family: sans-serif;
    color: rgba(255,255,255,0.5); cursor: pointer; transition: 0.2s; user-select: none; z-index: 10;
}
.nav-arrow:hover { color: #fff; }
.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

/* Темные стрелки для светлого блока Отзывов */
.item-light .nav-arrow { color: rgba(0,0,0,0.2); }
.item-light .nav-arrow:hover { color: #c65316; }

/* Точки */
.slider-dots { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 10;
}
.slider-dots span { width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 50%; cursor: pointer; }
.slider-dots span.active { background: #fff; }

.slider-dots.orange span { background: rgba(198, 83, 22, 0.3); }
.slider-dots.orange span.active { background: #c65316; }

/* Адаптив для сетки на мобильных */
@media (max-width: 900px) {
    .home-grid { grid-template-columns: 1fr; }
    /* На мобилке снимаем жесткие пропорции, чтобы контент не обрезался */
    .grid-item { aspect-ratio: auto; min-height: 400px; } 
    .item-about .grid-content, .grid-content-overlay, .reviews-content { padding: 30px 20px; text-align: center; }
    .grid-img-book { height: 35%; } /* Уменьшаем книгу на мобильном */
}


/* --- ЭКРАН 3: БЕЛЫЙ ФОН (Награды и Футер) --- */
.home-awards-partners {
    background: #fdfbf7;
    color: #2c1e16;
    padding: 60px 40px 0;
}

.awards-row, .partners-row {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; margin-bottom: 40px;
}
.awards-row { justify-content: space-around; }
.award-item { text-align: center; max-width: 150px; }
.award-item img { height: 60px; object-fit: contain; margin-bottom: 15px; }
.award-item p { font-size: 11px; line-height: 1.3; margin: 0;}
.award-item span {font-size: 11px; color: #c65316;}


.award-item a { font-size: 11px; color: #c65316; text-decoration: underline; }

.divider-line { width: 100%; height: 1px; background: rgba(0,0,0,0.1); margin: 40px 0; }

.partners-title { text-align: center; font-size: 20px; font-weight: normal; margin-bottom: 30px; }
.partners-row img { object-fit: contain; opacity: 0.7; transition: 0.2s; margin-bottom: 5px;}
.partners-row img:hover { opacity: 1; }
.partners-row a {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

/* Специфичный футер главной */
.home-footer {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 40px; font-size: 12px; color: #555;
}
.hf-col.center { text-align: center; }
.hf-col.links { display: flex; flex-direction: column; gap: 5px; }
.hf-col.links a { color: #c65316; text-decoration: underline; }
.hf-col.contacts { text-align: right; }
.hf-col.contacts p { margin: 0 0 5px; color: #2c1e16; font-weight: bold; }
.hf-mail { color: #c65316; }
.hf-socials { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; color: #c65316; font-weight: bold; }

.bottom-floral-border {
    width: 100%; height: 50px;
    background: url('/static/img/footer_line.png') repeat-x bottom center;
    background-size: contain; background-color: #fdfbf7;
}

/* --- АДАПТИВНОСТЬ ГЛАВНОЙ СТРАНИЦЫ --- */
@media (max-width: 900px) {
    .home-sidebar { display: none; } /* Скрываем левый сайдбар */
    .home-main-content { width: 100%; }
    
    .hero-header {
        padding: 30px 20px 0px; 
        flex-direction: column;
        align-items: center;
    }
    .h-center { 
        margin-top: 0; /* Сбросили старый отступ */
        text-align: center;
     } /* Сдвигаем заголовок ниже бургера */
     /* Иконка меню: центрируем ровно под текстом */
    .hero-header .hamburger-btn.mobile-only {
        display: flex !important; /* Обязательно flex, чтобы полоски внутри стояли ровно */
        position: relative;
        margin: 30px auto 0; /* Отступ 30px сверху от текста */
    }
    .h-title { font-size: 32px; }
    
    .hero-center-menu { flex-direction: column; gap: 20px; }
    .h-menu-block { padding: 20px; }
    .h-menu-block h2 { font-size: 24px; margin-bottom: 10px; }
    .h-menu-block p {
        line-height: 1.2;
    } /* Скрываем длинный текст на мобильных */
    
    /* Сетка в одну колонку */
    .home-grid { grid-template-columns: 1fr; }
    .grid-item { aspect-ratio: auto; }
    
    .home-footer { flex-direction: column; text-align: center; gap: 30px; }
    .hf-col.contacts { text-align: center; }
    .hf-socials { justify-content: center; }
    .reviews-content h2 {
        text-align: center;
    }
    .award-item {
        max-width: 120px;
    }
    .partners-row img {max-width: 110px; max-height: 80px;}
    .partners-row a {max-width: 100px;}
}

.block-about {
    color: #333333;
}

.block-about h2 {
    margin: 0;
}

/* --- ИСПРАВЛЕНИЯ ДЛЯ СЛАЙДЕРОВ НА ГЛАВНОЙ (МОБИЛЬНЫЕ) --- */
@media (max-width: 900px) {
    /* Возвращаем стрелки только для блоков на главной странице */
    .home-grid .nav-arrow {
        display: block !important;
        font-size: 35px; /* Делаем чуть меньше для аккуратности */
    }
    
    /* Прижимаем чуть ближе к краям на узких экранах */
    .home-grid .nav-arrow.left { left: 10px; }
    .home-grid .nav-arrow.right { right: 10px; }
}

#grid-section .nav-arrow {
    background: none;
}
#grid-section h2 {
    font-size: 26px!important;
    font-weight: normal!important;
    margin: 0 0 10px!important;
    line-height: 1.2!important;
}

/* Адаптивность grid-section для планшетов*/
@media (max-width: 1250px) {
    .item-about .grid-content {
        padding: 20px;
        font-size: 14px;
    }
    .grid-content-overlay, .reviews-content {
        padding: 20px; 
    }
    .reviews-content h2 {
        margin: 0px;
    }
    .r-text {
        font-size: 14px;
    }
    .r-text {
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Укажи количество строк, которые должны остаться видимыми */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #grid-section h2 {
        font-size: 22px!important;
    }
    .hero-center-menu {
        padding: 0;
    }
    .home-hero {
        height: auto;
    }

}
@media (max-width: 600px) {
    .h-menu-block:hover::before {
        opacity: 0;
    }
}

/* ==========================================================================
   === THEME LIGHT (Светлая тема для текстовых страниц) ===
   ========================================================================== */

/* Сброс фона для светлой страницы */
body.light-theme-body {
    background-color: #fdfbf7; /* Цвет кремовой бумаги */
    color: #3e2b20;
}

/* Настройки цветов шапки */
.theme-light {
    --hdr-text: #8a6d50; /* Коричнево-бежевый текст */
    --hdr-active: #c65316; /* Оранжевый акцент */
    background-color: transparent;
}

/* 1. ХИТРОСТЬ: Перекрашиваем белые иконки SVG в коричневые цвета через фильтр! */
.theme-light .icon-link img,
.theme-light .search-form button img,
.theme-light .ornament-svg {
    filter: invert(42%) sepia(23%) saturate(700%) hue-rotate(345deg) brightness(95%) contrast(85%);
}

/* 2. Тексты шапки в светлой теме */
.theme-light .main-title {
    color: var(--gold); /* Темно-коричневый заголовок */
    text-shadow: none;
}
.theme-light .anthology-text {
    color: var(--gold);
}

/* 3. Меню в рамке (по макету) */
.theme-light .main-nav {
    border: 1px solid rgba(198, 83, 22, 0.4);
    border-radius: 30px;
    padding: 3px 20px;
    gap: 30px;
    background-color: #fff6ec;
}
.theme-light .nav-btn {
    font-size: 18px;
    padding: 5px 10px;
}
.theme-light .nav-btn.active {
    background-color: transparent;
    box-shadow: none;
    text-shadow: none;
}

/* ==========================================================================
   === СТРАНИЦА "О ПРОЕКТЕ" ===
   ========================================================================== */

.light-page-wrapper {
    max-width: 1000px;
    margin: 40px auto 80px;
    padding: 0 20px;
    font-family: var(--font-serif);
}

.page-main-title {
    text-align: center;
    font-weight: normal;
    color: #4a3320;
    font-size: 32px;
    margin-bottom: 20px;
}

/* Переключатель Времена года / Праздники */
.about-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}
.about-toggle-container .toggle-label {
    font-size: 18px;
    font-style: italic;
    color: #c65316;
    opacity: 0.5;
    transition: 0.3s;
}
.about-toggle-container .toggle-label.active { opacity: 1; text-decoration: underline; }

/* Подменю (хлебные крошки) */
.about-submenu {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}
.about-submenu a {
    color: #8a6d50;
    font-size: 16px;
}
.about-submenu a:hover, .about-submenu a.active {
    color: #c65316;
    text-decoration: underline;
}

/* Интро-блок */
.about-intro-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
}
.intro-image {
    flex: 1;
}
.intro-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.intro-text {
    flex: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.intro-text .red-line {
    width: 25px;
    height: 1px;
    background-color: #c65316;
    margin-top: 12px;
    flex-shrink: 0;
}
.intro-text .text-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin: 0 0 15px 0;
}

/* Карточки */
.about-cards-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.about-card {
    background: #fdfbf7;
    border: 1px solid rgba(138, 109, 80, 0.2);
    border-radius: 12px;
    padding: 30px 40px;
    text-align: left;
}
.card-img-wrapper {
    text-align: center;
    margin-bottom: 20px;
}
.card-img-wrapper img {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
}
.about-card h3 a {
    display: block;
    font-size: 18px;
    font-weight: normal;
    color: #c65316;
    text-decoration: underline;
    margin-bottom: 15px;
}
.about-card p {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px;
}

/* Мобильный адаптив */
@media (max-width: 900px) {
    .about-intro-section { flex-direction: column; }
    .about-cards-section { grid-template-columns: 1fr; }
    .about-submenu { gap: 15px; }
    .intro-text { flex-direction: column; gap: 5px; }
    .intro-text .red-line { margin-bottom: 10px; }
    .theme-light .main-nav { max-width: 350px; }
}

/* ==========================================================================
   === ПОДСТРАНИЦЫ "О ПРОЕКТЕ" (Авторы, Пресса, Отзывы и т.д.) ===
   ========================================================================== */

/* Общие элементы типографики */
.about-red-title {
    color: #c65316;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 15px;
    font-family: var(--font-serif);
}
.about-red-text { color: #c65316; }
.italic { font-style: italic; }
.text-center { text-align: center; }

.about-divider {
    width: 100%;
    height: 1px;
    background: rgba(138, 109, 80, 0.2);
    margin: 20px 0;
}

/* Авторы (Сетка) */
.authors-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a3320;
}
.css-columns-3 ul {
    column-count: 3;
    column-gap: 40px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #4a3320;
    line-height: 2;
}

/* Вступительные статьи */
.articles-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    text-align: center;
    margin-bottom: 50px;
}
.article-person img {
    width: 120px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.article-person a {
    display: block;
    color: #c65316;
    text-decoration: underline;
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.2;
}
.article-person span { font-size: 13px; color: #4a3320; }

.article-text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a3320;
    margin-bottom: 40px;
}

.article-signature {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    color: #4a3320;
}
.article-signature img { width: 150px; margin-bottom: 20px; }
.article-signature h4 { font-size: 16px; margin-bottom: 10px; }
.article-signature p { font-size: 12px; }

/* Публикации (Список) */
.publications-list ul {
    column-count: 2;
    column-gap: 60px;
    list-style: none;
    padding: 0;
}
.publications-list li {
    margin-bottom: 25px;
    position: relative;
    padding-left: 15px;
}
.publications-list li::before {
    content: '■';
    color: #c65316;
    position: absolute;
    left: 0; top: -2px;
    font-size: 10px;
}
.publications-list a {
    color: #8a6d50;
    text-decoration: underline;
    font-size: 14px;
    line-height: 1.4;
}

/* Отзывы */
.reviews-list-container {
    display: flex;
    flex-direction: column;
}
.review-row {
    padding: 30px 0;
    border-bottom: 1px solid rgba(138, 109, 80, 0.15);
}
.review-row:nth-child(even) { background-color: rgba(253, 251, 247, 0.5); }
.review-row p {
    font-size: 14px;
    line-height: 1.6;
    color: #4a3320;
    margin: 0;
}

/* Для прессы */
.about-section-divider {
    text-align: center;
    position: relative;
    margin-bottom: 40px;
}
.about-section-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; width: 100%; height: 1px;
    background: rgba(138, 109, 80, 0.2);
    z-index: 1;
}
.about-section-divider span {
    background: #fdfbf7;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    color: #8a6d50;
    font-size: 18px;
}

.press-files-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 20px;
}
.press-file-item img { height: 40px; margin-bottom: 15px; }
.press-file-item span {
    display: block;
    color: #8a6d50;
    text-decoration: underline;
    font-size: 13px;
    line-height: 1.3;
}

.press-awards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 40px;
}
.award-item-press {
    display: flex;
    flex-direction: column;
}

.award-item-press img { height: 100px; object-fit: contain; margin-bottom: 20px; }
.award-item-press a {
    color: #8a6d50;
    text-decoration: underline;
    font-size: 13px;
    line-height: 1.4;
}

/* --- МОБИЛЬНЫЙ АДАПТИВ --- */
@media (max-width: 900px) {
    .authors-top-grid, .article-text-columns { grid-template-columns: 1fr; gap: 30px; }
    .css-columns-3 ul, .publications-list ul { column-count: 1; }
    .articles-header-grid { grid-template-columns: 1fr; }
    .press-files-grid { grid-template-columns: 1fr 1fr; row-gap: 40px;}
    .press-awards-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   === МУЛЬТИМЕДИЙНАЯ ВЕРСИЯ (Специфичные стили) ===
   ========================================================================== */

/* Сетка для "О проекте" (Мультимедиа) */
.about-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a3320;
}
.red-bullets {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}
.red-bullets li {
    position: relative;
    padding-left: 15px;
    color: #c65316;
    font-style: italic;
    margin-bottom: 5px;
}
.red-bullets li::before {
    content: '■';
    color: #c65316;
    position: absolute;
    left: 0; top: 0;
    font-size: 10px;
}

/* Сетка Создателей */
.creators-top-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 20px;
    font-size: 13px;
    color: #4a3320;
}
.creators-divider-row {
    display: flex;
    justify-content: space-around;
    text-align: center;
    font-size: 13px;
    color: #4a3320;
    margin-bottom: 50px;
}
.creators-anim-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: left; /* Как на макете */
    gap: 30px;
    font-size: 13px;
    color: #4a3320;
}
.creators-divider-coll {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 50px;
}

/* Для прессы (5 элементов вместо 4) */
.media-press-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* Мобильный адаптив */
@media (max-width: 900px) {
    .about-media-grid { grid-template-columns: 1fr; gap: 30px; }
    .creators-top-row, .creators-anim-row { grid-template-columns: 1fr 1fr; row-gap: 30px; text-align: center; }
    .media-press-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .creators-top-row, .creators-anim-row { grid-template-columns: 1fr; }
    .media-press-grid { grid-template-columns: 1fr; }
}
.about-toggle-container .slider {
    background-color: #efe8db;
}

/* ==========================================================================
   === СТРАНИЦА "ЛОКАЛЬНАЯ ВЕРСИЯ" (Buy Local Version) ===
   ========================================================================== */

.buy-page-wrapper {
    max-width: 800px;
    margin: 40px auto 80px;
    padding: 0 20px;
    font-family: var(--font-serif);
    color: #4a3320;
}

.buy-header { text-align: center; margin-bottom: 30px; }
.buy-subtitle { font-size: 16px; color: #555; margin-top: -10px; }

/* Картинка товара */
.buy-product-image {
    text-align: center;
    margin-bottom: 40px;
}
.buy-product-image img {
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.103));
}

/* Вкладки с рамкой SVG */
.buy-tabs-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
}

.buy-tab {
    position: relative;
    width: 200px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.buy-tab .tab-text {
    font-size: 18px;
    color: #4a3320;
    line-height: 1.3;
    z-index: 2;
    transition: 0.3s;
}

.buy-tab .tab-ornament {
    height: 12px;
    margin-top: 15px;
    opacity: 0.6;
    z-index: 2;
    /* Красим черный SVG в оранжевый */
    filter: invert(42%) sepia(23%) saturate(700%) hue-rotate(345deg) brightness(95%) contrast(85%);
}

/* Рамка книги появляется на активной вкладке или при наведении */
.buy-tab::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('/static/img/main_page/bg-main_menu-hover.svg') no-repeat center center;
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.buy-tab:hover::before { opacity: 0.5; }
.buy-tab.active::before { opacity: 1; }
.buy-tab.active .tab-text { color: #c65316; }

/* Инфо-Сетка (Цена и описание) */
.buy-info-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
}

.info-left { text-align: right; font-size: 16px; line-height: 1.4; }
.info-right { text-align: left; font-size: 14px; color: #333; }
.info-left p { margin-bottom: 10px; }
.mb-2 { margin-bottom: 10px; }
.underline { text-decoration: underline; }

.info-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.price-big-value {
    font-size: 60px;
    font-weight: bold;
    color: #c65316;
    line-height: 1;
    margin: 10px 0 5px;
}
.price-currency {
    color: #c65316;
    font-style: italic;
    font-size: 16px;
    margin-bottom: 10px;
}
.price-ornament { width: 100px; opacity: 0.5; }
.price-ornament.top { transform: rotate(180deg); }

/* --- ФОРМА ЗАКАЗА --- */
.buy-form-container {
    border: 1px solid rgba(138, 109, 80, 0.4);
    border-radius: 10px;
    padding: 40px 50px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.form-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}
.form-line { flex: 1; height: 1px; background: rgba(138, 109, 80, 0.4); }
.form-title { font-size: 24px; font-weight: normal; color: #4a3320; margin: 0; }

.buy-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(138, 109, 80, 0.4);
    background: transparent;
    padding: 10px 5px;
    margin-bottom: 25px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-style: italic;
    color: #4a3320;
    outline: none;
    box-sizing: border-box;
}
.buy-input::placeholder { color: #8a6d50; }
.buy-input:focus { border-bottom-color: #c65316; }

/* Кастомные Радио и Чекбоксы */
.buy-radio-group { display: flex; gap: 40px; margin-bottom: 25px; }
.custom-radio, .custom-checkbox {
    display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px;
}
.custom-radio input, .custom-checkbox input { display: none; }

.radio-mark {
    width: 16px; height: 16px;
    border: 1px solid #aaa; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.custom-radio input:checked + .radio-mark { border-color: #c65316; }
.custom-radio input:checked + .radio-mark::after {
    content: ''; width: 8px; height: 8px; background: #c65316; border-radius: 50%;
}

.check-mark {
    width: 16px; height: 16px; border: 1px solid #aaa; border-radius: 3px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.custom-checkbox input:checked + .check-mark { border-color: #c65316; background: #c65316; }
.custom-checkbox input:checked + .check-mark::after {
    content: '✓'; color: #fff; font-size: 12px; font-family: sans-serif;
}
.check-text { font-size: 13px; color: #555; line-height: 1.4; }
.check-text a { color: #c65316; text-decoration: underline; }

/* Подвал формы */
.buy-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.quantity-control {
    display: flex; align-items: center; gap: 10px; color: #c65316; font-size: 20px;
}
.quantity-control button {
    background: none; border: none; color: #c65316; font-size: 20px; cursor: pointer; padding: 0 5px;
}
.quantity-control input {
    width: 40px; text-align: center; border: none; background: #c65316; color: #fff;
    font-size: 16px; border-radius: 4px; padding: 5px 0; font-family: var(--font-serif);
}

.total-price-block { font-size: 28px; font-weight: bold; color: #c65316; }
.total-currency { font-size: 16px; font-weight: normal; font-style: italic; }

.submit-buy-btn {
    background: #c65316; color: #fff; border: none; padding: 12px 30px;
    font-family: var(--font-serif); font-size: 16px; border-radius: 6px; cursor: pointer;
    transition: 0.2s;
}
.submit-buy-btn:hover { background: #a3410e; }

.form-legal-text { font-size: 12px; color: #888; font-style: italic; text-align: left; margin: 0; }

/* --- МОБИЛЬНЫЙ АДАПТИВ --- */
@media (max-width: 768px) {
    .buy-tabs-container { flex-direction: column; align-items: center; gap: 0; }
    .buy-tab { width: 100%; max-width: 250px; padding: 50px 10px; }
    
    .buy-info-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .info-left, .info-right { text-align: center; }
    
    .buy-form-container { padding: 30px 20px; }
    .buy-radio-group { flex-direction: column; gap: 15px; }
    
    .buy-form-footer { align-items: center; text-align: center; }
}


/* ==========================================================================
   === ИНФОРМАЦИОННЫЕ СТРАНИЦЫ (Приобрести издание / Донат) ===
   ========================================================================== */

.message-page-wrapper {
    max-width: 800px;
    margin: 80px auto 120px; /* Большие отступы сверху и снизу для "воздушности" */
    text-align: center;
    font-family: var(--font-serif);
}

/* Заголовок с тире */
.message-page-title {
    font-size: 34px;
    font-weight: normal;
    color: #4a3320; /* Темно-коричневый */
    margin-bottom: 50px;
}
.message-page-title .title-dash {
    color: #c65316; /* Оранжевые тире как на макете */
    font-weight: 300;
}

/* Текстовые блоки */
.message-page-content {
    font-size: 19px;
    line-height: 1.6;
    margin-bottom: 25px;
}
.message-page-content p {
    margin: 0 0 15px 0;
}

/* Цвета текста */
.text-orange { color: #c65316; }
.text-dark { color: #4a3320; }

/* Утилиты */
.italic { font-style: italic; }
.mt-40 { margin-top: 40px; }

/* Линия-разделитель */
.message-divider {
    width: 200px;
    height: 1px;
    background-color: rgba(138, 109, 80, 0.3); /* Полупрозрачная коричневая линия */
    margin: 30px auto;
}

/* Ссылки внутри текста */
.msg-link {
    text-decoration: underline;
    text-decoration-color: rgba(198, 83, 22, 0.5);
    transition: 0.2s;
    color: inherit;
}
.msg-link:hover {
    color: #a3410e;
    text-decoration-color: #a3410e;
}
.text-dark .msg-link { text-decoration-color: rgba(74, 51, 32, 0.5); }
.text-dark .msg-link:hover { color: #c65316; text-decoration-color: #c65316; }

/* Мобильный адаптив */
@media (max-width: 768px) {
    .message-page-wrapper { margin: 40px auto 80px; padding: 0 20px; }
    .message-page-title { font-size: 26px; margin-bottom: 30px; }
    .message-page-content { font-size: 16px; }
}

.light-theme-body {
    .hamburger-btn {
        background-color: #fff;
        box-shadow: 2px 0px 4px rgb(154 154 154 / 40%);
    }
    .hamburger-btn span {
        height: 2px;
        background-color: var(--gold);
    }
    .mobile-menu-card {
        background-image: url(/static/img/menu-frame-light.svg);
    }
    .mobile-menu-card .close-btn {
        background-color: #FDFBF7;
        border: none;
    }
    
    .mobile-menu-links .mobile-link {
        color: #000000;
    }

    .mobile-icons-grid .mobile-icon-box {
        color: var(--hdr-text);
    }
    .mobile-search-form input {
        color: var(--hdr-text);
    }
    .mobile-search-wrapper {
        border-bottom: 1px solid var(--hdr-text);
    }
    .mobile-icon-box img {
        filter: invert(42%) sepia(23%) saturate(700%) hue-rotate(345deg) brightness(95%) contrast(85%);
    }
}


/* --- ПЛАВАЮЩИЙ ПЛЕЕР ДЛЯ МОБИЛЬНЫХ (Sticky Player) --- */
@media (max-width: 900px) {
    .cinema-body-row {
        /* Разрешаем элементам внутри сетки вести себя независимо */
        display: block; 
    }
    
    .player-area {
        position: -webkit-sticky; /* Поддержка для Safari (iPhone) */
        position: sticky;
        top: 0; /* Прилипает к самому верху экрана */
        z-index: 99; /* Держится поверх текста и плейлиста */
        
        /* Добавляем фон, чтобы текст плейлиста не просвечивал под тулбаром при скролле */
        background-color: #050505; 
        
        /* Небольшие отступы, чтобы компенсировать padding родительского виджета */
        margin: -15px -15px 15px -15px;
        padding: 15px 15px 5px 15px;
        
        /* Добавляем легкую тень снизу для красоты при скролле */
        box-shadow: 0 10px 20px rgba(0,0,0,0.8);
        height: 200px;
    }
    
    .playlist-area {
        /* Убираем внутренний скролл, теперь скроллится вся страница целиком */
        height: auto;
        max-height: none; 
        overflow: visible;
        padding-right: 0;
    }
}

.page-number {
    color: #cd0000;
    top: 10px;
    left: 10px;
    position: absolute;
}
