/*
 * Header dropdown menus (desktop) and grouped mobile menu.
 * Uses the theme's existing header styles; only adds sub-menu behaviour.
 */

/* ---------- Desktop dropdowns (WP menus: ul.menu > li.menu-item-has-children > ul.sub-menu) ---------- */
ul.menu li.menu-item-has-children { position: relative; }
ul.menu li.menu-item-has-children > a::after {
	content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; margin-left: 6px; display: inline-block;
}
ul.menu .sub-menu {
	position: absolute; top: 100%; left: 0; z-index: 1000; min-width: 260px; margin: 0; padding: 10px 0; list-style: none;
	background: #fff; border-radius: 15px; box-shadow: 5px 5px 15px 5px rgba(0, 0, 0, .1);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s;
}
/* hover bridge so the pointer can travel from the parent to the panel */
ul.menu li.menu-item-has-children::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
ul.menu li.menu-item-has-children:hover > .sub-menu,
ul.menu li.menu-item-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(4px); }
ul.menu .sub-menu li { display: block; padding: 0; }
ul.menu .sub-menu a { display: block; padding: 10px 20px; font-size: 16px; color: #101010; white-space: nowrap; }
ul.menu .sub-menu a:hover,
ul.menu .sub-menu a:focus-visible { color: var(--accent); background: #F2F2F2; }
ul.menu .sub-menu li.current-menu-item > a { color: var(--accent); }

/* The theme turns the right menu's last item into the pink CTA — keep that for the top level only. */
.main-menu.right-menu ul.menu .sub-menu li:last-child a {
	background: transparent; color: #101010; padding: 10px 20px; border-radius: 0;
}
.main-menu.right-menu ul.menu .sub-menu li:last-child a:hover { background: #F2F2F2; color: var(--accent); }
/* Right-aligned panels so they don't run off the screen edge. */
.main-menu.right-menu ul.menu .sub-menu { left: auto; right: 0; }
/* Parent stays dark when only a child page is current. */
ul.menu li.current-menu-ancestor > a { color: var(--accent); }

/* ---------- Mobile menu groups (hard-coded list in header.php) ---------- */
div#menu-nav.active { max-height: 1400px; }
ul.mobile-menu .dw-m-group details { text-align: center; }
ul.mobile-menu .dw-m-group summary {
	list-style: none; cursor: pointer; color: var(--main); font-size: 18px; padding: 0;
}
ul.mobile-menu .dw-m-group summary::-webkit-details-marker { display: none; }
ul.mobile-menu .dw-m-group summary::after {
	content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; margin-left: 6px; display: inline-block; transition: transform .2s;
}
ul.mobile-menu .dw-m-group details[open] summary::after { transform: rotate(180deg); }
ul.mobile-menu .dw-m-group ul { list-style: none; margin: 8px 0 4px; padding: 0; }
ul.mobile-menu .dw-m-group ul li { padding: 4px 0; }
ul.mobile-menu .dw-m-group ul li a { font-size: 16px; color: #555; }
/* keep the pink button for the real last item only */
ul.mobile-menu .dw-m-group ul li:last-child a {
	background: transparent; color: #555; padding: 0; border-radius: 0; display: inline; width: auto;
}
ul.mobile-menu .dw-m-group ul li:last-child a:hover { background: transparent; color: var(--accent); }

/* ---------- Keep menu labels on one line (desktop header) ---------- */
@media (min-width: 1200px) {
	.header-bar-menu ul.menu { align-items: center; }
	.header-bar-menu ul.menu > li > a { white-space: nowrap; }
	.header-bar-menu .main-menu.right-menu ul.menu > li:last-child a { display: inline-block; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
	.header-bar-menu ul.menu > li { padding: 0 6px; }
	.header-bar-menu ul.menu > li > a { font-size: 16px; }
}
