/* Gallery Pages Sticky Header and Scroll Behavior */

/* Topline Styles */
#topline {
    width: 100%;
    background-color: #222222;
    padding: 5px 0;
    z-index: 1001;
    position: relative;
    border-bottom: 1px solid #333;
}

/* Main Header Styles */
#header {
    transition: all 0.3s ease-in-out;
    width: 100%;
    z-index: 1000;
    position: relative;
    background-color: #fff;
    margin: 0;
}

#header.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

/* Content Wrapper - Add padding to prevent content from being hidden under fixed header */
.content-wrapper {
    padding-top: 60px; /* Adjust based on your header height */
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Styles */
@media (max-width: 767px) {
    #header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    #topline {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1002;
        padding: 3px 0;
    }
    
    #header {
        top: 35px; /* Height of the topline */
    }
    
    .content-wrapper {
        padding-top: 120px; /* Adjust based on header + topline height */
    }
}

/* Animation for header */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Sticky Class for JavaScript */
.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* Ensure proper spacing when header becomes fixed */
body.sticky-header-padding {
    padding-top: 60px;
}

/* Mobile menu adjustments */
@media (max-width: 767px) {
    .mobile-menu-open #mainmenu {
        position: fixed;
        top: 100px; /* Adjust based on your header height */
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}
