const menu = document.querySelector('.menu');
const mobileMenu = document.querySelector('.mobileMenu')
const close = document.querySelector('#closeMobileMenu');
menu?.addEventListener('click', () => {
  const isExpanded = menu.getAttribute('aria-expanded') === 'true';
  menu.setAttribute('aria-expanded', `${!isExpanded}`);
  if (!isExpanded) {
    console.log('not expanded')
    mobileMenu.setAttribute('open', 'true');
  }
  else {
    console.log('expanded')
    mobileMenu.setAttribute('open', 'false');
  }
});

close.addEventListener('click', () => {
  mobileMenu.removeAttribute('open');
});

