/*
 Theme Name:   Film3
 Theme URI:    https://therootsons.com
 Description:  Default Film3 theme
 Author:       The Rootsons
 Author URI:   https://therootsons.com
 Template:     generatepress
 Version:      0.1
*/

/* Force GenerateBlocks Overlay open on mobile */
@media (max-width: 992px) {
    #gb-overlay-2873.gb-overlay {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        z-index: 1 !important;
    }
    
    /* Remove inert and aria-hidden states */
    #gb-overlay-2873.gb-overlay[aria-hidden="true"] {
        aria-hidden: false;
    }
    
    #gb-overlay-2873.gb-overlay[inert] {
        inert: unset;
    }
    
    /* Ensure content is visible */
    #gb-overlay-2873 .gb-overlay__content {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Hide the trigger button that opens the overlay on desktop */
    .gb-overlay-trigger[aria-controls="gb-overlay-2873"],
    [data-gb-overlay-target="#gb-overlay-2873"] {
        display: none !important;
    }
	.menu-item-has-gb-mega-menu{
		width: 100%;
	}
	.menu-item-has-gb-mega-menu .gb-submenu-toggle{
		display: none !important;
	}
}

/* ============================================
   MOBILE: Collapsible 240px preview + toggle
   ============================================ */

@media (max-width: 991px) {
    
    /* Overlay wrapper - collapsed by default at 240px */
    #gb-overlay-2873.gb-overlay {
        display: block !important;        /* always visible */
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: 240px !important;       /* collapsed height */
        overflow: hidden !important;    /* hide overflow */
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1 !important;
        transition: height 0.4s ease;
    }
    
    /* Expanded state */
    #gb-overlay-2873.gb-overlay.is-mobile-open {
        height: auto !important;        /* expand to full content */
        overflow: visible !important;
    }
    
    /* Remove inert/aria-hidden so content is accessible */
    #gb-overlay-2873.gb-overlay[aria-hidden="true"] {
        aria-hidden: false;
    }
    
    #gb-overlay-2873.gb-overlay[inert] {
        inert: unset;
    }
    
    /* Ensure content is visible */
    #gb-overlay-2873 .gb-overlay__content {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Gradient fade at bottom when collapsed */
    #gb-overlay-2873.gb-overlay:not(.is-mobile-open)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to bottom, transparent, white);
        pointer-events: none;
        z-index: 2;
    }
    
    /* Toggle button */
    .gb-mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 0px;
        margin: 0;
        background: #fff;
        border: none;
        color: #000;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        position: relative;
        z-index: 3;
    }
	.gb-mobile-menu-toggle:hover, .gb-mobile-menu-toggle:focus{
		background: #fff;
        color: #000;
	}
    
    .gb-mobile-menu-toggle::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.3s ease;
    }
    
    .gb-mobile-menu-toggle.is-open::after {
        transform: rotate(-135deg);
    }
    
    /* Hide desktop overlay trigger */
    .gb-overlay-trigger[aria-controls="gb-overlay-2873"],
    [data-gb-overlay-target="#gb-overlay-2873"] {
        display: none !important;
    }
}

/* Hide mobile toggle on desktop */
@media (min-width: 992px) {
    .gb-mobile-menu-toggle {
        display: none !important;
    }
    
    /* Restore desktop overlay behavior */
    #gb-overlay-2873.gb-overlay {
        height: auto !important;
        overflow: visible !important;
    }
    
    #gb-overlay-2873.gb-overlay::after {
        display: none !important;
    }
}