/*FORCING SPPB HEADINGS TO MATCH TEMPLATE*/
h1, h2, h3, h4, h5, h6, 
.sppb-addon-heading h1, 
.sppb-addon-heading h2, 
.sppb-addon-heading h3 {
    color: #006699 !important;
}

/* INCREASE LOGO SIZE ON MOBILE DEVICES*/
/* Force mobile logo to grow by overriding HTML height */
@media (max-width: 991.98px) {
    img.logo-image {
        height: 100px !important; /* Change this to make it bigger or smaller */
        max-height: none !important;
        width: auto !important;
    }
}

/* Increase mobile header/menu bar height */
@media (max-width: 991.98px) {
    header, .header, #sp-header, .container-header, .navbar {
        min-height: 120px !important; /* Adjust this value if you need it taller or shorter */
        display: flex !important;
        align-items: center !important;
    }
}



/*CLOSES OFFCANVAS MENU WHEN AN ANCHOR LINK IS CLICKED*/
jQuery(document).ready(function($) {
    $(document).on('click', '.offcanvas-menu a, .offcanvas-inner a', function (e) {
        var href = $(this).attr('href');
        
        // If the link contains a hash (#)
        if (href && href.indexOf('#') !== -1) {
            // Force close all possible Helix/Bootstrap offcanvas classes and overlays
            $('.offcanvas-init').removeClass('offcanvas-active full-offcanvas');
            $('body').removeClass('offcanvas-shown');
            $('.offcanvas-overlay').removeClass('open');
            $('.offcanvas').removeClass('show');
            
            // If we are already on the home page and it's a local hash jump
            var parts = href.split('#');
            if (parts[0] === '' || parts[0] === window.location.pathname || parts[0] === window.location.origin + window.location.pathname) {
                var targetHash = '#' + parts[1];
                if ($(targetHash).length) {
                    e.preventDefault();
                    $('html, body').animate({
                        scrollTop: $(targetHash).offset().top - 70
                    }, 400);
                }
            }
        }
    });
});

/* 1. Your desktop/global logo position  */
#sp-logo .sp-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#sp-logo .logo img.logo-image {
    margin-top: -10px !important;
}

/* 2. Your mobile-specific logo position */
@media (max-width: 767.98px) {
    #sp-logo .logo img.logo-image {
        margin-top: 40px !important; /* Adjust this value if needed for mobile */
    }
}