/**
 * EasySite Pro – Frontend JavaScript
 */
(function () {
	'use strict';

	var toggle = document.querySelector('.easysite-menu-toggle');
	var nav = document.querySelector('.easysite-primary-nav');

	if (toggle && nav) {
		toggle.addEventListener('click', function () {
			var open = nav.classList.toggle('is-open');
			toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
		});
	}

	// Sticky header shadow on scroll
	var header = document.getElementById('site-header');
	if (header && document.body.classList.contains('easysite-sticky-header')) {
		window.addEventListener('scroll', function () {
			header.classList.toggle('is-scrolled', window.scrollY > 10);
		}, { passive: true });
	}
})();
