: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;
}

.header-theme-video {
    --hdr-text: #C5813D;
    --hdr-active: #D13A04;
    --hdr-hover: #e07b42;
    --hdr-border: rgba(18, 13, 8, 0.3);
}
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;
    -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;
}


.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;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    gap: 15px;
    padding-top: 10px;
}
.header-right {
    justify-content: flex-end;
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 8px;
    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;
}

.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;
    }


    .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;
    }

    .mobile-menu-overlay {
        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;
    }
    
    .mobile-menu-overlay.open {
        visibility: visible;
        opacity: 1;
    }

    .mobile-menu-card {
        box-sizing: border-box; 
        width: 90%;
        max-width: 400px;
        
        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;
        
        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;
        
        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;
        
        top: 0px; 
        
        left: 50%;
        
        transform: translate(-50%, -50%); 
        
        box-sizing: border-box; 
        width: 65px; 
        height: 65px;
        background-color: #EDCDA5; 
        border: 3px solid #D13A04; 
        border-radius: 50%;
        color: #D13A04; 
        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;
        width: 40px;
        margin-bottom: 10px;
    }
    .mobile-icons-grid .mobile-icon-box span {
        font-family: var(--font-serif);
        font-size: 11px;
        line-height: 1.3;
    }
}

.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-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: #D13A04;
    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;
    gap: 40px;
}

.player-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.responsive-video-container {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}
.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;
}

.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: 64px;
    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;
}
.actors-slider-track::-webkit-scrollbar { display: none; }

.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: 0px 10px;
    text-align: center;
    background: #080808;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.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;
    }
}

@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;
    }
}

.main-footer {
    background-color: #fdfbf7;
    color: #8a6d50;
    padding-top: 3cap;
    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: center;
    padding: 0 20px 60px;
}

.footer-col {
    /*flex: 1;*/
}

.col-left {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-direction: column;
    text-align: center;
}
.footer-logo {
    width: 60px;
    height: auto;
    opacity: 0.8;
}

.copyright {
    font-family: var(--font-serif);
    font-size: 10px;
    color: #3e3a35;
    margin: 0px;
}
.company-name {
    font-size: 14px;
    color: #a67c52;
    line-height: 1.4;
    margin: 0 0 5px;
}

.col-left .company-name {
    margin: 0px;
    padding: 0px;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
}

.company-name-d {
    font-size: 8px;
    margin-bottom: 5px;
    margin-top: 0px;
    font-style: italic;
    color: #a67c52;
}
.col-center {
    display: flex;
    text-align: center;
    /*padding-left: 40px;*/
}

.col-right {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.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;
}

.footer-flower-line {
    width: 100%;
    height: 60px;
    background: url('/static/img/footer_line.png') repeat-x bottom center;
    background-size: contain;
}

@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;
        gap: 5px;
    }

    .footer-links a {
        margin-left: 0px;
    }

    
    .col-center {
        padding-left: 0;
        text-align: center;
    }
    
    .col-right {
        text-align: center;
        align-items: center;
    }
    .footer-socials {
        justify-content: center;
    }
}

.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-layout-grid {
        grid-template-columns: 1fr;
    }
    .playlist-area {
        height: auto;
        max-height: 400px;
    }
    .player-area { border-right: none; border-bottom: 1px solid #333; }

    .contact-info { text-align: center; }
}


.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 -2px 20px rgba(0,0,0,0.5);
    margin-bottom: 24px;
}
.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 {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #1d1c1b;
    z-index: 2000;
    flex-direction: column;
}

.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;
}

.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; }

#book-zoom-wrapper {
    transition: transform 0.2s ease-out;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    margin: 0;
    transform-origin: center center;

    overflow: visible!important; 
    transition: width 0.3s, height 0.3s;
    will-change: left, top;
}
#book-container-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}
@media (max-width: 900px) {
    #book-zoom-wrapper {
        display: flex; 
        justify-content: center;
        overflow: hidden; 

        transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1), top 0.5s cubic-bezier(0.25, 1, 0.5, 1);
        
        will-change: left, top;
    }
    
    #flipbook {
        transition: none !important; 
        transform-origin: center center;
    }
    #flipbook.turning {
        
    }
}

#flipbook .page {
    background-color: #fcfbf7!important;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    background-size: 100% 100% !important;
}
#flipbook .text {
    position: absolute;
    color: #000;
    font-family: 'Times New Roman', serif;
    font-size: 16px;
}

.desktop-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 900px) {
    .reader-toolbar { padding: 0 10px; height: 37px;}
    
    .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; }

    .reader-dropdown {
        display: none;
        position: absolute;
        top: 40px; 
        
        left: 0; 
        
        background: #222;
        border: 1px solid #444;
        border-radius: 4px;
        min-width: 150px;
        
        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; }
}


#flipbook .page {
    background-color: #fcfbf7 !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    position: relative; 
    overflow: hidden;
}

#flipbook .text {
    position: absolute;
    
    font-size: 10pt; 
    font-family: 'Times New Roman', serif;
    line-height: 1.2;
    color: #000;
}

.poem_img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.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;
    top: 2px; 
    left: -30px; 
}
.play.stop {
    background-image: url("/static/image/book/pause_button.png");
}

#flipbook .author {
    font-size: 10pt;
    margin-bottom: 10px;
}
#flipbook .caption {
    font-size: 10pt;
    position: relative;
    
}

#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;
}

@media (max-width: 900px) and (orientation: portrait) {
    .nav-arrow {
        display: none !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .poem-popup-container {
        height: 95vh;
        padding: 20px 30px 20px 30px;
    }
    .poem-close-btn {
        top: 0px; 
        right: 10px;
    }
}

.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;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.poem-popup-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 80vh;
    
   
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 50px 25px 55px 40px;
    box-sizing: border-box;

    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
}

.poem-close-btn {
    position: absolute;
    top: 10px; 
    right: 15px;
    width: 30px;
    height: 20px;

    background: url('/static/img/book/popup-book-zm-close.svg') no-repeat center center;
    background-size: contain;
    
    border: none;
    font-size: 0;
    color: transparent;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
}

.poem-close-btn:hover {
    transform: scale(1.1);
}

.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: 22px !important;
    line-height: 1.3 !important;
    color: #2c1e16 !important;
    text-align: left;
    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;
}

#poem-popup-text * {
    font-size: 16px;
    line-height: inherit !important;
    font-family: inherit !important;
    
    position: static !important; 
    height: auto;
    width: auto !important;
    line-height: 1.25 !important;
    max-width: 100%;
}

.book-popup-author {
    display: flex;
    font-weight: 600;
    /*height: 15px !important;*/
}

.book-popup-st {
    display: flex;
    color: #cd0000;
    /*color: var(--gold) !important;*/
    font-weight: 700;
    font-size: 22px !important;
    /*height: 25px !important;*/
}

.book-popup-st-red {
    color: #cd0000;
}
.book-popup-comm {
    font-size: 16px;
    color: #000000;
    padding-left: 10px;
    border-left: 1px solid #000;
}



.book-popup-snoska {
    display: flex;
    margin-top: 15px !important;
    margin-bottom: 15px!important;
    padding-top: 15px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-style: italic;
}

.book-popup-snoska * {
    font-size: 16px !important;
    color: #666 !important;
    font-style: italic !important;
    line-height: 1.3 !important;
}

.book-popup {
    position: absolute !important;
    top: 65px !important;
    left: auto !important;
    right: 45px !important;
    width: 100% !important;
    height: 95% !important;
    margin: 0 !important;
    
    background: url('/static/img/book/book-picture-bg.png') no-repeat center center !important;
    background-size: 100% 100% !important;
    
    z-index: 110;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 40px 60px 60px 60px !important;
    box-sizing: border-box;
    border-radius: 0 !important;
}

.book-popup .inf, 
.book-popup .dotted, 
.book-popup .solid,
.book-popup .p-button {
    display: none !important;
}

.book-popup .inf-text, .book-popup .anim {
    font-family: 'PT Serif';
    font-size: 22px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    color: #2c1e16 !important;
    margin-bottom: 10px !important;
    font-weight: bold !important;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

.book-popup .anim-text {
    font-family: 'Times New Roman', serif;
    font-size: 14px !important;
    color: #2c1e16 !important;
    display: block;
    text-align: center;
    font-weight: normal !important;
}

.book-popup-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 25px;
    height: 25px;
    background: url('/static/img/book/book-picture-close.svg') no-repeat center center;
    background-size: contain;
    cursor: pointer;
    z-index: 101;
    transition: 0.2s;
    /*opacity: 0.6;*/
}
.book-popup-close:hover { opacity: 1; transform: scale(1.1); }

.book-popup-play {
    position: absolute;
    top: calc(50% - 20px);
    left: calc(50% - 10px);
    transform: translate(-50%, -50%);
    width: 65px;
    height: 65px;
    background: url('/static/img/book/book-picture-play.svg') no-repeat center center;
    background-size: contain;
    cursor: pointer;
    z-index: 101;
    transition: 0.2s;

    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;

    margin: 5px;
}
.book-popup-play:hover { transform: translate(-50%, -50%) scale(1.1); }

#audio-player-bar {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    height: 100px;
    background: #0f0b09;
    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: 60px;
    height: 6%;
    flex-shrink: 0;
    /*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;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-center {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    width: 100%;
    max-width: 800px;
}

.track-title {
    color: #d28e5d;
    font-size: 16px;
    margin-bottom: 5px;
    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-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;
}

.play-btn.playing::after {
    content: '';
    width: 4px;
    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-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);
}

.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);
}

.track-play-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #D13A04;
    background: transparent;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.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 #D13A04;
}

.track-item.active .track-play-btn::after {
    border: none;
    width: 3px;
    height: 8px;
    border-left: 2px solid #D13A04;
    border-right: 2px solid #D13A04;
    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: #D13A04;
    text-decoration-color: #D13A04;
}

.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 {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 15px;
    }
    
    .book-cover {
        width: 100%;
        max-width: 150px;
        height: 217px;
        
        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: #D13A04;
    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: #D13A04;
    font-style: italic;
    margin-bottom: 5px;
}
.toc-holiday-name {
    font-size: 15px;
    font-weight: bold;
    color: #2c1e16;
}
*/

#toc-popup-overlay {
    display: none;
    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;
}

.toc-popup-container {
    position: relative;
    width: 100%;
    max-width: 900px;
}

.toc-close-btn {
    position: absolute;
    top: -45px; right: -10px;
    background: none; border: none;
    color: #fff; font-size: 30px;
    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: #D13A04; }
.toc-tabs span.active { color: #D13A04; text-decoration: underline; }

.toc-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: #D13A04 transparent;
}
.toc-scroll-area::-webkit-scrollbar { width: 4px; }
.toc-scroll-area::-webkit-scrollbar-thumb { background: #D13A04; border-radius: 2px; }

.toc-item {
    display: flex;
    align-items: center;
    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 #D13A04;
    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 #D13A04;
}

.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: #cd0000; 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: #D13A04; font-style: italic; margin-bottom: 5px; }
.toc-holiday-name { font-size: 15px; font-weight: bold; font-style: italic; color: #2c1e16; }

@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: #D13A04;
    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; }

.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: #D13A04;
    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: #D13A04; }

#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: #D13A04;
    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; 
    }
}

.anim-cinema-body {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 30px;
    align-items: center;
}

.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: #D13A04;
}

.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: #D13A04; 
}

@media (max-width: 900px) {
    .anim-cinema-body { 
        display: flex;
        flex-direction: column; 
    }
    
    .anim-player-area { 
        width: 100%; 
        order: -1; 
        margin-bottom: 20px;
    }

    .anim-credits-left, .anim-credits-right { 
        text-align: center; 
        padding: 0; 
    }

    .anim-credits-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        text-align: left;
        margin-bottom: 20px;
    }

    .anim-credits-left .credit-block h3 {
        margin: 0; 
        font-size: 14px;
    }
    
    .anim-credits-left .credit-block p {
        font-size: 11px;
    }

    .anim-card { flex: 0 0 140px; }

    #info-desc {
        text-align: left;
    }

}

.alph-sidebar.search-sidebar {
    right: -80px;
    gap: 15px;
}
.alph-sidebar.search-sidebar span {
    font-size: 15px;
}

.alph-sidebar span.search-tab-btn.active {
    color: #D13A04;
    text-decoration: underline;
}

.alph-mobile-nav span.search-tab-btn.active {
    background: rgba(198, 83, 22, 0.3);
}

.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;
    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);
}

.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: 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; }

.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;
    align-items: center;
}

@media (max-width: 900px) {
    .h-menu-block-text-wrap h2 {
        border-bottom: 1.5px solid #fff;
        width: fit-content;
    }
}
.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: #D13A04;
    font-size: 16px;
    transition: 0.3s;
}
.scroll-down-btn:hover { color: #EDCDA5; }
.circle-arrow {
    width: 30px; height: 30px;
    background: #D13A04; 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); }

.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-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: #D13A04; 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: #D13A04; }

.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: #D13A04; }

@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%; } /* Уменьшаем книгу на мобильном */
}


.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: #D13A04;}


.award-item a { font-size: 11px; color: #D13A04; 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: #D13A04; 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: #D13A04; }
.hf-socials { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; color: #D13A04; 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;
        position: relative;
        margin: 30px auto 0;
    }
    .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;
}

@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-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;
    }
}

body.light-theme-body {
    background-color: #fdfbf7;
    color: #3e2b20;
}

.theme-light {
    --hdr-text: #8a6d50;
    --hdr-active: #D13A04;
    background-color: transparent;
}

.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%);
}

.theme-light .main-title {
    color: var(--gold);
    text-shadow: none;
}
.theme-light .anthology-text {
    color: var(--gold);
}

.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: #D13A04;
    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: #D13A04;
    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: #D13A04;
    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: #D13A04;
    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: #D13A04;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 15px;
    font-family: var(--font-serif);
}
.about-red-text { color: #D13A04; }
.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: #D13A04;
    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: #D13A04;
    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: #D13A04;
    font-style: italic;
    margin-bottom: 5px;
}
.red-bullets li::before {
    content: '■';
    color: #D13A04;
    position: absolute;
    left: 0; top: 0;
    font-size: 10px;
}

.creators-top-row {
    display: grid;
    grid-template-columns: repeat(5, 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;
}

.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-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));
}

.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;
    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: #D13A04; }

.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: #D13A04;
    line-height: 1;
    margin: 10px 0 5px;
}
.price-currency {
    color: #D13A04;
    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: #D13A04; }

.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: #D13A04; }
.custom-radio input:checked + .radio-mark::after {
    content: ''; width: 8px; height: 8px; background: #D13A04; 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: #D13A04; background: #D13A04; }
.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: #D13A04; 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: #D13A04; font-size: 20px;
}
.quantity-control button {
    background: none; border: none; color: #D13A04; font-size: 20px; cursor: pointer; padding: 0 5px;
}
.quantity-control input {
    width: 40px; text-align: center; border: none; background: #D13A04; 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: #D13A04; }
.total-currency { font-size: 16px; font-weight: normal; font-style: italic; }

.submit-buy-btn {
    background: #D13A04; 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: #D13A04;
    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: #D13A04; }
.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: #D13A04; text-decoration-color: #D13A04; }

@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%);
    }
}


@media (max-width: 900px) {
    .cinema-body-row {
        display: block; 
    }
    
    .player-area {
        position: -webkit-sticky;
        position: sticky;
        top: 0; 
        z-index: 99;
        
        background-color: #050505; 
        
        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: 20px;
    position: absolute;
    font-family: 'PT Serif';
    font-size: 18px;
}

.even .page-number {
    left: 20px;
    right: auto;
}

.odd .page-number {
    right: 20px;
    left: auto;
}

.audio-control {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.audio-control:hover {
    transform: scale(1.1);
}

.audio-control img {
    width: 100%;
    height: 100%;
    object-fit: contain;

    filter: drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.4));
    
    transition: filter 0.3s ease;
}
.audio-control:hover img {
    filter: drop-shadow(0px 0px 8px rgba(0, 0, 0, 0.6));
}

@media (max-width: 768px) {
    .audio-control {
        top: 140px; 
    }
}

.poem-popup-play-btn.play {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    bottom: 25px !important;
    right: 15px !important;

    width: 30px !important;
    height: 20px !important;

    background: url('/static/img/book/popup-book-zm-play.svg') no-repeat center center !important;
    background-size: contain !important;

    z-index: 3100 !important;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.5));
    transition: transform 0.2s;
}

.poem-popup-play-btn.play:active {
    transform: scale(0.9);
}


#audio-player-bar {
    transition: bottom 0.4s ease-in-out, height 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s ease;
    overflow: hidden;
}

.player-left {
    transition: all 0.4s ease;
    overflow: hidden;
    white-space: nowrap;
}

.player-center {
    transition: all 0.4s ease;
}

#player-track-title {
    transition: all 0.3s ease;
}

.controls-row {
    transition: all 0.4s ease;
}

.player-right {
    transition: all 0.4s ease;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    width: auto !important;
}

.control-size-btn, #close-player-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-size-btn:hover, #close-player-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

#audio-player-bar.player-minimized {
    height: 70px !important;
    padding: 5px 0 !important;
}

#audio-player-bar.player-minimized .player-left {
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#audio-player-bar.player-minimized .player-center {
    width: 100% !important;
    padding: 0px !important;
    box-sizing: border-box;
}

#audio-player-bar.player-minimized #player-track-title {
    font-size: 15px;
    margin-bottom: 5px;
    text-align: left;
    padding-right: 80px;
}

#audio-player-bar.player-minimized .controls-row {
    padding-right: 80px !important;
    padding-left: 0 !important; 
}
#audio-player-bar.player-minimized .player-right {
    top: 12px !important;
    right: 20px !important;
    transform: none;
}


@media (max-width: 900px) {
    #audio-player-bar.player-minimized .player-right {
        position: absolute !important;
    }
}
.book-popup .inf-text {
    text-align: center !important;
}

.book-popup .anim {
    font-family: 'PT Serif';
    font-size: 26px !important;
}

#sitemap-popup-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 5000; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
}
.sitemap-modal {
    background: #fdfbf7; width: 100%; max-width: 900px; height: 85vh;
    border-radius: 12px; position: relative; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}
.sitemap-close-btn {
    position: absolute; top: 5px; right: 5px; background: none; border: none;
    font-size: 25px; color: #5d4037; cursor: pointer; z-index: 10; font-weight: 300;
}
.sitemap-header {
    padding: 40px 40px 20px; border-bottom: 1px solid rgba(138, 109, 80, 0.2);
}
.sitemap-title {
    text-align: center; color: #D13A04; font-size: 26px; font-family: var(--font-serif); margin: 0 0 15px 0;
}
.sitemap-tabs {
    display: flex; justify-content: flex-start; gap: 30px; margin-bottom: 15px; flex-wrap: wrap;
}
.sitemap-tab {
    font-family: var(--font-serif); font-size: 17px; color: #4a3320; cursor: pointer;
    padding-bottom: 5px; border-bottom: 2px solid transparent; transition: 0.2s; font-weight: bold;
}
.sitemap-tab:hover { color: #D13A04; }
.sitemap-tab.active { color: #D13A04; border-bottom-color: #D13A04; }

.sitemap-search-box {
    display: flex; justify-content: center; margin-bottom: 20px;
}
.sitemap-search-box input {
    width: 100%; padding: 12px 25px; font-size: 16px;
    border: 1px solid #D13A04; border-radius: 30px; outline: none; font-family: var(--font-serif);
    color: #4a3320; background: transparent; transition: 0.3s;
}
.sitemap-search-box input:focus { box-shadow: 0 0 10px rgba(198, 83, 22, 0.2); }
.sitemap-search-box input::placeholder { color: rgba(74, 51, 32, 0.5); }

.sitemap-tags {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.sitemap-tag {
    font-size: 13px; font-family: var(--font-sans); background: rgba(198, 83, 22, 0.1);
    color: #D13A04; padding: 6px 16px; border-radius: 20px; cursor: pointer; transition: 0.2s;
}
.sitemap-tag:hover { background: rgba(198, 83, 22, 0.2); }
.sitemap-tag.active { background: #D13A04; color: #fff; }

.sitemap-body {
    flex: 1; overflow-y: auto; padding: 20px 40px 40px; scrollbar-width: thin; scrollbar-color: #D13A04 transparent;
}
.sitemap-body::-webkit-scrollbar { width: 4px; }
.sitemap-body::-webkit-scrollbar-thumb { background: #D13A04; border-radius: 2px; }

.sitemap-painting-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

.sitemap-painting-img {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.sitemap-painting-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sitemap-painting-img.empty-preview {
    background: rgba(198, 83, 22, 0.05);
    border: 1px dashed rgba(198, 83, 22, 0.3);
    box-shadow: none;
}

.sitemap-painting-text {
    flex: 1;
}

@media (max-width: 768px) {
    .sitemap-painting-img {
        width: 100px;
        height: 60px;
    }
}

.sitemap-modal .toc-author {
    color: #000;
}

#magazine, .magazine, #book, .magazine-viewport {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

#flipbook, #book-container-bg {
    opacity: 0 !important;
    transition: opacity 0.6s ease-in-out !important;
    pointer-events: none !important;
}

#flipbook.book-ready, #book-container-bg.book-ready {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.custom-book-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    color: #C5813D;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

.custom-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(198, 83, 22, 0.2);
    border-top-color: #C5813D;
    border-radius: 50%;
    animation: spin-book 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin-book {
    100% { transform: rotate(360deg); }
}


.h-search.desktop-only {
    display: flex;
    gap: 20px;
}

@media (min-width: 900px) {
    .global-fs-btn {
        width: max-content;
    }
}

.sitemap-book-cover {
    display: flex;
}
@media (max-width: 900px) {
    .sitemap-book-cover {
        display: none !important;
    }
}

.sitemap-custom-select {
                    width: 100%;
                    padding: 10px 15px;
                    border: 1px solid #D13A04;
                    border-radius: 25px;
                    font-family: inherit;
                    font-size: 14px;
                    color: #333;
                    background: transparent;
                    outline: none;
                    appearance: none;
                    -webkit-appearance: none;
                    -moz-appearance: none;
                    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C5813D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
                    background-repeat: no-repeat;
                    background-position: right 15px center;
                    background-size: 16px;
                    cursor: pointer;
                    transition: border-color 0.3s ease, box-shadow 0.3s ease;
                }
                .sitemap-custom-select:focus {
                    border-color: #C5813D;
                    box-shadow: 0 0 5px rgba(197, 129, 61, 0.3);
                }
                .sitemap-filter-label {
                    display: block;
                    font-size: 13px;
                    color: #888;
                    margin-bottom: 6px;
                    padding-left: 10px;
                    text-align: left;
                }

.sitemap-dropdown-filters {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 10px;
    width: 100%;

}

@media (min-width: 900px) {
    .global-fs-btn {
        width: max-content;
    }
}


.sitemap-holiday-item {
    cursor: pointer; padding: 15px 10px; border-bottom: 1px solid #eee; 
    display: flex; justify-content: space-between; align-items: center; 
    transition: background 0.2s, padding-left 0.2s;
}
.sitemap-holiday-item:hover {
    background: #fdfaf6;
    padding-left: 15px;
}
.sitemap-holiday-item:last-child {
    border-bottom: none;
}

.holiday-special-tag {
    background-color: #fdfaf6;
    border-color: #C5813D;
    color: #C5813D;
}

.new-search-modal {
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 800px;
    width: 100%;
    max-width: 1000px;
    background: #fdfbf7;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    padding: 30px 40px;
    box-sizing: border-box;
}

.sitemap-close-btn {
    position: absolute; 
    top: 15px; 
    right: 20px; 
    background: none; 
    border: none;
    font-size: 28px; 
    color: #8a6d50; 
    cursor: pointer; 
    z-index: 10; 
    font-weight: 300;
}

.sitemap-top-section {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.sitemap-title {
    color: #D13A04;
    font-size: 32px;
    font-family: var(--font-serif);
    margin: 0 0 20px 0;
    font-weight: normal;
}

.sitemap-tabs {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.sitemap-tab {
    font-size: 18px;
    font-family: var(--font-serif);
    color: #D13A04;
    border: 1.5px solid #D13A04;
    border-radius: 8px;
    padding: 8px 25px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
}

.sitemap-tab.active {
    background-color: #D13A04;
    color: #fff;
}

.sitemap-bottom-section {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden; 
    gap: 30px;
    min-height: 0;
}

.search-sidebar {
    width: 270px;
    display: flex;
    flex-direction: column;
    margin-right: 20px;
    border-right: none;
}

.sidebar-tabs {
    display: flex;
    position: relative;
    z-index: 2; 
    border-bottom: none; 
    margin-bottom: 0;
}

.sidebar-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 18px;
    font-family: var(--font-serif);
    color: #D13A04;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    z-index: 1; 
    background: transparent !important;
    border: none !important;
}

.sidebar-tab.active {
    z-index: 3; 
}

.sidebar-tab::before {
    content: '';
    position: absolute;
    top: -2px;
    bottom: 0; 
    z-index: -1;
    border: 1px solid #e0d0bd;
    background: #fdfbf7;
    transition: 0.2s;
}

.sidebar-tab[data-target="authors-list"]::before {
    left: 0px;
    right: -12px;
    transform-origin: bottom left;
    transform: perspective(100px) rotateX(6deg);
    border-radius: 12px 12px 0 0;
}

.sidebar-tab[data-target="actors-list"]::before {
    right: 0.5px;
    left: -12px; 
    transform-origin: bottom right;
    transform: perspective(100px) rotateX(6deg);
    border-radius: 12px 12px 0 0;
}

.sidebar-tab.active::before {
    background: #FFF6EC;
    border-bottom: none; 
    bottom: 0px;
}
.sidebar-tab:not(.active)::before {
    border-bottom: 1px solid #e0d0bd;
}

.sidebar-content {
    flex: 1;
    background: #FFF6EC;
    border: 1px solid #e0d0bd;
    border-top: none; 
    border-radius: 0 0 12px 12px; 
    padding: 15px 0px 15px 0;
    overflow-y: auto; 
    position: relative;
    z-index: 1;
}

.sidebar-content::-webkit-scrollbar { 
    width: 16px;
}
.sidebar-content::-webkit-scrollbar-track { 
    background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb { 
    background-color: #D13A04; 
    background-clip: padding-box;
    border-left: 6px solid transparent; 
    border-right: 6px solid transparent;
    border-radius: 10px;
}
.sidebar-content::-webkit-scrollbar-button:single-button {
    display: block;
    height: 15px;
    background-size: 6px;
    background-repeat: no-repeat;
    background-color: transparent;
    background-position: center;
}
.sidebar-content::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='%23c65316'/></svg>");
}
.sidebar-content::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='0,0 10,0 5,10' fill='%23c65316'/></svg>");
}

.sidebar-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0 15px; 
}
.sidebar-list.active {
    display: block;
}

.sidebar-list-item {
    padding: 4px 6px;
    margin-bottom: 6px;
    font-size: 14px;
    font-family: var(--font-serif);
    color: #2c1e16; 
    cursor: pointer;
    text-align: center; 
    transition: 0.2s;
    border-radius: 6px;
}

.sidebar-list-item:hover {
    color: #D13A04;
}

.sidebar-list-item.active {
    background-color: #D13A04; 
    color: #fff;
    box-shadow: 0 4px 8px rgba(198, 83, 22, 0.2); 
}

.search-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    min-height: 0;
}
.modern-search-box {
    display: flex;
    margin-bottom: 15px;
    width: 100%;
}
.modern-search-box input {
    flex: 1;
    border: 1px solid #D13A04;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 12px 20px;
    font-size: 16px;
    font-family: var(--font-serif);
    color: #4a3320;
    background: transparent;
    outline: none;
}
.modern-search-box input::placeholder {
    color: rgba(74, 51, 32, 0.5);
}
.search-submit-btn {
    background-color: #D13A04;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 0 35px;
    font-size: 18px;
    font-family: var(--font-serif);
    cursor: pointer;
    transition: 0.2s;
}
.search-submit-btn:hover {
    background-color: #a3410e;
}

.sitemap-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-start;
}

.sitemap-tag {
    font-size: 13px;
    font-family: var(--font-sans);
    color: #8a6d50;
    cursor: pointer;
    transition: 0.2s;
    font-style: italic;
}
.sitemap-tag:hover {
    color: #D13A04;
}
.sitemap-tag.active {
    color: #fff;
}
.holiday-special-tag {
    color: #4a3320;
}

.sitemap-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #D13A04 transparent;
    padding-right: 15px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-top: 5px;
    min-height: 0; 
}

.sitemap-body::-webkit-scrollbar { width: 4px; }
.sitemap-body::-webkit-scrollbar-thumb { background: #D13A04; border-radius: 2px; }

.mobile-filters-row {
    display: none;
}
.sitemap-title.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .new-search-modal {
        padding: 20px;
        height: 95vh;
    }
    
    .sitemap-bottom-section {
        flex-direction: column;
        gap: 10px;
    }

    .sitemap-title {
        font-size: 26px;
        margin-bottom: 15px;
    }

    .sitemap-tab {
        font-size: 15px;
        padding: 6px 12px;
    }

    .search-main-content {
        padding-top: 0;
    }

    .mobile-filters-row.mobile-only {
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(198, 83, 22, 0.2);
        padding-bottom: 10px;
    }
    .mobile-filter-btn {
        font-family: var(--font-serif);
        font-size: 16px;
        color: #8a6d50;
        cursor: pointer;
        font-weight: bold;
    }

    .search-sidebar {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background: #fdfbf7;
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        padding: 20px;
        box-sizing: border-box;
    }
    .search-sidebar.mobile-open {
        transform: translateY(0);
        z-index: 999;
    }
    
    .search-submit-btn {
        padding: 0 15px;
        font-size: 15px;
    }
}

.search-sidebar.single-tab-mode .sidebar-tab::before {
    transform: none !important;
    left: 0px !important;
    right: 0px !important;
    top: 0px;
    border-radius: 12px 12px 0 0 !important;
}

@media(max-width: 768px) {
    .sitemap-header { padding: 30px 20px 10px; }
    .sitemap-body {
        padding: 10px;
    }
    .sitemap-tabs {
        gap: 10px;
        margin-bottom: 5px;
        }
    .sitemap-tab {
        font-size: 15px;
        padding: 6px 18px;
    }
}

.toc-play-btn.stop::after {
    border-top: none;
    border-bottom: none;
    border-left: 1.5px solid #D13A04;
    border-right: 1.5px solid #D13A04;
    width: 3px;
    height: 8px;
    background: transparent;
    transform: translate(-50%, -50%);
    margin-left: 0;
}
.toc-play-btn.stop {
    background-image: none !important;
}

.cropped-version {
    max-width: 200px;
}

    .cropped-version:hover .cropped-text-content,
    .cropped-version:hover .read-more-link {
        text-decoration: underline;
    }

#poem-popup-text, 
.poem-popup-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.play.stop {
    background-image: url('/static/image/book/pause_button.png') !important;
}


@media (max-width: 768px) {
    .modern-search-box input {
        font-size: 12px;
    }
}

#poem-popup-text:has(.book-popup-st) .book-popup-comm,
#poem-popup-text:has(.book-popup-author) .book-popup-comm {
    display: none !important;
}

.holiday-search-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(138, 109, 80, 0.1);
}

.holiday-search-header .h-name {
    color: #2c1e16;
    font-size: 16px;
    font-family: var(--font-serif);
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.3;
    font-style: italic;
}

.back-to-holidays-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #D13A04;
    font-size: 12px;
    font-family: var(--font-serif);
    font-weight: bold;
    transition: 0.2s;
    padding: 6px 16px;
    background: transparent;
}

.back-to-holidays-btn:hover {
    color: #a3410e;
    border-color: #a3410e;
}

.book-popup.modernized .anim {
    position: absolute !important;
    top: calc(50% + 30px) !important; 
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin: 0 !important;
    z-index: 102 !important;
    line-height: 1.2 !important;

    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-font-smoothing: antialiased !important;
    font-style: italic;
}

.inf-text-note {
    display: inline-block;
    font-size: 14px;
    line-height: 1.4em;
}

.popup-pre-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(138, 109, 80, 0.2);
    padding-bottom: 15px;
}

.popup-image-wrap {
    text-align: center;
    margin-bottom: 25px;
}

.popup-image-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.popup-body-text {
    line-height: 1.6;
}
#poem-popup-text img {
    max-width: 200px;
    display: block !important;
}

.pre-formatted-top {
    text-align: left;
    margin-bottom: 15px;
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.4;
    color: #2c1e16;
}

.pre-formatted-top p {
    margin: 0 0 10px 0;
}

.pre-formatted-top .rvts6_10, .pre-formatted-top .rvts6_4  {
    font-weight: bold;
    color: #cd0000;
    font-size: 18px!important;
}

.pre-formatted-top .rvts8_9, .pre-formatted-top .rvts7_4, .pre-formatted-top .rvts7_10 {
    color: #cd0000;
    font-style: italic;
}

.book-popup-h-date {
    display: flex;
    font-weight: bold;
    color: #cd0000;
    font-size: 18px!important;
}

.book-popup-h-name {
    display: flex;
    color: #cd0000;
    font-style: italic;
}

.pre-formatted-top .pre {
    display: grid!important;
    text-align: left;
}

.pre-formatted-top .rvps2_29 {
    margin-bottom: 5px;
}

.main-page-sections {
    width: 100%;
    color: var(--text-bezh);
    font-family: var(--font-serif);
}

.section-gratitude {
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(205, 129, 61, 0.1);
    background-color: #FCF7F3;
}

.gratitude-heart-icon {
    width: 125px;
    height: auto;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 10px rgba(209, 58, 4, 0.3));
}

.gratitude-message {
    max-width: 500px;
    margin: 0 auto;
    font-size: 18px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 10px;
}

.section-header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 50px;
}

.section-header-ornament h2 {
    font-size: 24px;
    /* text-transform: uppercase; */
    /* letter-spacing: 0.15em; */
    margin: 0;
    color: #000000;
    font-weight: 400;
}

.main-page-sections .ornament-svg {
    width: 30px;
    height: auto;
    opacity: 0.8;
}

.section-partners {
    padding: 80px 20px;
    text-align: center;
}

.bg-partners {

}

.bg-info-partners {

}

.partners-logos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 50px;
    max-width: 1300px;
    margin: 0 auto;
}

.partner-logo-box {
    flex: 0 1 200px;
    transition: transform 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.partner-logo-box img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    filter: grayscale(1) brightness(0.9);
    margin-bottom: 10px;
}

.partner-logo-box:hover {
    transform: translateY(-5px) scale(1.05);
}

.partner-logo-box:hover img {
    filter: grayscale(0) brightness(1);
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15); opacity: 1; }
}

@media (max-width: 768px) {
    .gratitude-message { font-size: 18px; }
    .section-header-ornament h2 { font-size: 18px; }
    .ornament-svg { width: 40px; }
    .partners-logos-grid { gap: 30px; }
    .partner-logo-box { flex: 0 1 240px; }
}

.section-gratitude a {
    color: #D13A04;
    text-decoration: underline;
}
.section-gratitude a:hover {
    
}

.partners-logos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    gap: 50px;
    margin: 0px auto;
}

.partner-logo-box-label {
    color: #757575;
    text-transform: uppercase;
    transition: color 0.3s ease;
}


.about-intro-accordion {
    margin-bottom: 40px;
    padding: 0;
    position: relative;
}

.accordion-inner {
    display: flex;
    flex-direction: column;
    font-size: 17px;
    line-height: 1.6;
    color: #333;
    text-align: left;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.accordion-preview p {
    margin-bottom: 0;
}

.accordion-full-text {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
    opacity: 0;
    transition: all 0.4s ease-in-out;
    font-style: italic;
    max-width: 850px;
}

.about-intro-accordion.is-expanded .accordion-full-text {
    max-height: 2000px;
    transition: max-height 0.7s ease-in-out;
    opacity: 1;
}

.accordion-preview {
    margin-bottom: 20px;
    font-style: italic;
    max-width: 850px;
}

.accordion-controls {
    text-align: center;
    border-top: 1px solid #eee;
}

.about-accordion-btn {
    background: none;
    border: none;
    color: #D13A04;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
    outline: none;
}

.about-accordion-btn:hover {
    color: #a30000;
}

.about-accordion-btn .btn-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.about-intro-accordion.is-expanded .about-accordion-btn .btn-icon {
    transform: rotate(0deg);
}

@media(max-width: 768px) {
    .partners-logos-grid {
        justify-content: center;
    }
}

.partner-logo-box img {
    transition: transform 0.3s ease-in-out, filter 0.4s ease;
    
    display: block;
}

.partner-logo-box:hover img { 
    filter: grayscale(0) brightness(1);
}

.paintings-box-m {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    /* flex-direction: column; */
    /* flex-wrap: wrap; */
}
.paintings-box-m .toc-poem-title{
    color: #000000;
    text-decoration: none;
}

.paintings-box-m .toc-poem-title:hover{
    color: #cd0000;
    text-decoration: underline;
}



.paintings-box-m .toc-author{
    color: #000000;
    text-decoration: none;
}

.paintings-box-m .toc-author:hover{
    color: #cd0000;
    text-decoration: underline;
}

.video-box-m .toc-poem-title{
    color: #000000;
    text-decoration: none;
}

.video-box-m .toc-poem-title:hover{
    color: #cd0000;
    text-decoration: underline;
}

.music-box-m .toc-poem-title{
    color: #000000;
    text-decoration: none;
}

.music-box-m .toc-poem-title:hover{
    color: #cd0000;
    text-decoration: underline!important;
}

@media(max-width: 900px) {
    .paintings-box-m {
     gap: 20px;

    }
}

.sitemap-painting-left {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    width: 55%;
}

@media(max-width: 768px) {
    .paintings-box-m {
        flex-direction: column;
    }
    .sitemap-painting-left {
        width: 100%;
    }
}

.reviews-content h2:hover {
    color: #D13A04;
}

.block-about h2:hover {
    color: #D13A04;
}

@media(max-width: 900px) {
    .reviews-content a {
        border-bottom: 1.4px solid #2c1e16;
    }

    .block-about a {
        border-bottom: 1.4px solid #333333;
    }
}


.magnifier-glass {
    position: absolute;
    top: 0; left: 0;
    border: 3px solid #C5813D;
    border-radius: 50%;
    cursor: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.2);
    display: none;
    pointer-events: none;
    z-index: 9999;
    /*background-color: #fff;*/
    overflow: hidden;
    
    will-change: transform;
    -webkit-backface-visibility: hidden;
    
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.magnifier-glass .clone-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform-origin: 0 0;
    will-change: transform;
    -webkit-backface-visibility: hidden;
}

.reader-viewport.loupe-active {
    cursor: crosshair;
}

@keyframes popupSmoothOpen {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.poem-popup-container {
    animation: popupSmoothOpen 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
@media (max-width:768px) {
    .book-popup-close {
        top: 35px;
        right: 35px;
        width: 35px;
        height: 35px;
    }
} 

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #D13A04;
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: transparent;
    padding: 0 10px;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; 
}
.search-input-container::-webkit-scrollbar { display: none; }

.modern-search-box input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 5px !important;
    min-width: 130px;
    background: transparent;
    color: #4a3320;
    font-family: var(--font-serif);
    font-size: 16px;
    outline: none;
}

.search-chips-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mobile-chips {
    display: none;
    margin-top: -5px;
    margin-bottom: 15px;
}

.mobile-chips .search-chip {
    background: none;
    padding: 0px;
}

.search-chip {
    display: flex;
    align-items: center;
    background: rgba(198, 83, 22, 0.15);
    color: #D13A04;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-serif);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-chip-close {
    margin-left: 8px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}
.search-chip-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

@media (max-width: 900px) {
    /* Прячем чипы внутри строки */
    .desktop-chips {
        display: none !important;
    }
    
    .mobile-chips {
        display: flex;
    }
    
    .modern-search-box {
        margin-bottom: 10px;
    }
    
    .search-input-container {
        padding: 6px 10px;
        min-height: 46px; 
    }
}

/* Включаем стили только для мобильных устройств (ширина экрана до 900px) */
@media (max-width: 900px) {
    
    /* Описываем сценарий увеличения */
    @keyframes sequentialMobileZoom {
        0%, 33.33%, 100% {
            transform: scale(1);
        }
        16.66% {
            transform: scale(1.05); /* Увеличение блока на 5% */
        }
    }

    /* Применяем анимацию ко всем трем карточкам */
    .hero-center-menu .h-menu-block {
        animation: sequentialMobileZoom 6s infinite ease-in-out;
        will-change: transform; /* Оптимизация для плавности на телефонах */
    }

    /* Раздаем задержки: 1-й блок стартует сразу */
    .hero-center-menu .h-menu-block:nth-child(1) {
        animation-delay: 0s;
    }
    
    /* 2-й блок ждет 2 секунды */
    .hero-center-menu .h-menu-block:nth-child(2) {
        animation-delay: 2s;
    }
    
    /* 3-й блок ждет 4 секунды */
    .hero-center-menu .h-menu-block:nth-child(3) {
        animation-delay: 4s;
    }
}

.footer-link-z:hover {
    transform: translateY(-5px) scale(1.05);
}

.col-left img {
    width: 105px;
}

.review-m-title {
    color: #D13A04!important;
    font-size: 16px!important;
    font-weight: normal!important;
    margin-bottom: 15px!important;
    font-family: var(--font-serif)!important;
}

.anim-card-label {
    color: #C5813D;
    font-style: italic;
    font-size: 14px;
}

.sitemap-painting-left-label {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.sitemap-poem-right {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    text-align: left;
}

.main-icon-mail {
    height: 30px!important;
}

.main-icon-feedback {
    height: 46px!important;
}

.header-icon-mail {
    height: 20px!important;
}

.header-icon-feedback {
    height: 26px!important;
}
