function boldActiveNav() {
// Bold active top-level menu item
const activeLink = document.querySelector('.menu-list__link--active');
if (activeLink) {
const title = activeLink.querySelector('.menu-list__link-title');
if (title) title.style.fontWeight = 'bold';
}
// Bold parent when mega menu link matches current URL
const currentPath = window.location.pathname;
document.querySelectorAll('.mega-menu__link').forEach(function(link) {
if (link.getAttribute('href') === currentPath) {
const submenuInner = link.closest('[id^="submenu-"]');
if (submenuInner) {
const submenuId = submenuInner.id;
const parentLink = document.querySelector(`[aria-controls="${submenuId}"] .menu-list__link-title`);
if (parentLink) parentLink.style.fontWeight = 'bold';
}
}
});
}
// Run after full page load
window.addEventListener('load', boldActiveNav);
// Also try with a delay as fallback
setTimeout(boldActiveNav, 500);