// checks if the document is ready before executing the script
//alert("hey");
document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.siteMenu__heading').forEach(heading => {

        heading.addEventListener('click', e => {
            e.preventDefault();
            const childMenu = heading.nextElementSibling;
            if (childMenu && childMenu.classList.contains('childMenu')) {
                childMenu.classList.toggle('childMenu--open');
            }
        });
    });

});
