/* Custom Menu Styles for Centered Layout + Language Switcher */

/* --- Desktop Layout --- */
#logo_wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative;
    padding: 0 30px !important;
    box-sizing: border-box;
}

.logo_container {
    width: auto !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

#menu_wrapper {
    flex-grow: 1 !important;
    display: flex !important;
    justify-content: center !important;
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    height: auto !important;
}

#nav_wrapper {
    float: none !important;
    width: auto !important;
    border: none !important;
}

.nav_wrapper_inner {
    display: block !important;
}

/* Language Switcher Styles (Desktop) */
.lang-switcher {
    flex-shrink: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    z-index: 10;
    margin-left: 20px;
}

.lang-switcher a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: #bf311a;
}

.lang-switcher span {
    margin: 0 5px;
    color: #ccc;
}

.header_style_wrapper.transparent .lang-switcher {
    color: #fff;
}
.header_style_wrapper.scroll .lang-switcher {
    color: #444;
}

/* Hide Mobile Only Items on Desktop */
.mobile-only {
    display: none !important;
}

/* Fix Ancient Books Page Title Padding on Mobile */
@media only screen and (max-width: 768px) {
    .page-id-1956 .elementor-heading-title {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Fix Activity List "Taihu" Text Block Padding */
    .elementor-element-258c1cc .elementor-column-wrap {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* --- Mobile Redesign (Below 960px) --- */
@media only screen and (max-width: 960px) {
    /* Nuclear hide of all distracting elements */
    /* .top-bar-marquee, RE-ENABLED */
    .header_top,
    #mobile_menu_border,
    #menu_wrapper,
    .lang-switcher,
    #menu_border_wrapper {
        display: none !important;
    }

    /* Force the header container to be a solid bar */
    .top_bar {
        height: 60px !important;
        background-color: #fff !important;
        border-bottom: 1px solid #eee !important;
        display: block !important;
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    /* Reset Marquee Wrapper for Mobile (Prevent off-screen text) */
    .top-bar-marquee .standard_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 10px !important;
        display: block !important; /* Stack blocking */
    }

    /* Hide the Culture Lounge button on mobile as requested */
    .top-bar-marquee .culture-lounge-btn {
        display: none !important;
    }

    /* Ensure Marquee container is clean */
    .top-bar-marquee {
        height: auto !important;
        min-height: 30px;
        line-height: 30px;
        overflow: hidden;
    }
    
    .top-bar-marquee .marquee-content {
        width: 100% !important;
        text-align: center !important;
    }

    /* RESET THE UNRULY STANDARD WRAPPER */
    /* This was the root cause of misalignment: theme settings fighting our layout */
    .top_bar .standard_wrapper {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 20px !important; /* Left/Right padding for the whole bar */
        box-sizing: border-box !important;
        display: block !important; /* Wrapper just holds the Logo Wrapper */
        float: none !important;
    }

    /* Clear any theme-level styles on the logo wrapper */
    /* Clear any theme-level styles on the logo wrapper */
    /* THIS IS THE FLEX CONTAINER FOR LOGO AND BURGER */
    #logo_wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important; /* Logo on left */
        flex-wrap: nowrap !important; /* Never wrap */
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important;
        width: 100% !important;
        float: none !important;
        border: none !important;
        max-width: none !important;
        position: relative !important; /* For absolute burger */
    }
    
    /* Logo Container - Flex Item */
    .logo_container {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 100% !important; /* Fill height to center vertically */
        width: auto !important;
        float: none !important;
        position: static !important;
        transform: none !important;
    }

    /* Hidden logic for scroll/transparent states */
    .logo_container:has(.logo_wrapper.hidden) { display: none !important; }
    #logo_normal .logo_wrapper.hidden, #logo_transparent .logo_wrapper.hidden { display: none !important; }

    /* Elegant logo size - Matching Assouline reference */
    .logo_container img {
        height: 18px !important; /* Fixed elegant height */
        width: auto !important;
        display: block !important;
        margin: 0 !important;
    }

    /* Burger Icon - Absolute Right */
    #mobile_burger_icon {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-end !important; /* Align lines to right */
        width: 40px !important; /* Larger touch target */
        height: 40px !important; /* Fixed height for centering */
        cursor: pointer !important;
        z-index: 1000 !important;
        margin: 0 !important;
        
        /* Absolute Positioning Strategy */
        position: absolute !important; 
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        
        float: none !important;
    }

    /* Delicate Burger Lines */
    #mobile_burger_icon span {
        display: block !important;
        width: 18px !important; /* Smaller width for elegance */
        height: 1px !important;
        background-color: #000 !important;
        margin: 2px 0 !important; /* Tighter spacing */
        transition: all 0.3s;
    }

    /* Handle States - Transparent to Solid */
    .header_style_wrapper.transparent .top_bar:not(.scroll) {
        background-color: transparent !important;
        border-bottom: none !important;
    }
    .header_style_wrapper.transparent:not(.scroll) #mobile_burger_icon span {
        background-color: #fff !important;
    }

    /* Force Black Burger when Scrolled (Fix disappearing issue) */
    .header_style_wrapper.scroll #mobile_burger_icon span,
    .top_bar.scroll #mobile_burger_icon span {
        background-color: #000 !important;
    }
    
    /* Scroll state */
    .header_style_wrapper.scroll .top_bar {
        background-color: #fff !important;
        height: 60px !important;
    }
    /* Ensure wrapper matches height on scroll */
    .header_style_wrapper.scroll .top_bar .standard_wrapper {
        height: 60px !important;
    }
}

/* --- Mobile Slide-out Drawer --- */
#mobile_menu_drawer {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden */
    /* width: 300px; */ /* Removed fixed width to match reference wider feel if needed, but 300 is standard */
    width: 320px; /* Slightly wider */
    height: 100%;
    background-color: #ffffff; /* White clean background */
    z-index: 100000;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Smoother ease */
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto;
}

#mobile_menu_drawer.open {
    right: 0;
}

/* Overlay to dim the background */
.drawer_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: none;
    backdrop-filter: blur(2px); /* Subtle blur for modern feel */
}

#mobile_menu_drawer.open + .drawer_overlay {
    display: block;
}

.drawer_content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left align everything */
}

.drawer_header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

/* Make sure the logo inside drawer is sized correctly */
.drawer_logo img {
    height: 20px; /* Assouline style small logo */
    width: auto;
    display: block;
}

.drawer_close {
    font-size: 32px;
    color: #000; /* Black close icon */
    cursor: pointer;
    line-height: 1;
    font-weight: 300;
    transition: transform 0.3s;
}
.drawer_close:hover {
    transform: rotate(90deg);
}

.drawer_lang {
    margin-bottom: 30px;
    color: #000;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    width: 100%;
    text-align: left; /* Left align */
}

.drawer_lang a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.drawer_lang a.active,
.drawer_lang a:hover {
    color: #000; /* Black active */
}

.drawer_nav {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: left; /* Left align */
}

.drawer_nav li {
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0; /* Very light divider */
    padding: 18px 0;
}

.drawer_nav li:first-child {
    border-top: 1px solid #f0f0f0;
}

.drawer_nav li:last-child {
    border-bottom: 1px solid #f0f0f0;
}

.drawer_nav a {
    color: #000; /* Black text */
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    position: relative;
    transition: padding-left 0.3s;
}

.drawer_nav a:hover {
    color: #bf311a;
    padding-left: 10px; /* Slight movement on hover */
}
