/* Services mega menu — linked sub-items.

   Plain-text sub-items (the existing `.mega-sub li`) are styled in style.css.
   The hand-edited menu can also link a sub-item, which puts an <a> inside
   `.mega-sub` — and a bare link there would pick up the nav's link rules:
   `.submenu a` (12px 16px padding, block, rounded, grey hover fill) and
   `.nav-links a` (1px letter-spacing). These rules strip that back so a
   linked sub-item is the same size, colour and position as a plain one, and
   only reveals itself on hover. Prefixed with .mega-menu to beat both rules
   on specificity rather than needing !important. */
.mega-menu .mega-sub a {
	display: inline;
	padding: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	letter-spacing: 0;
	transition: color 0.18s ease;
}
.mega-menu .mega-sub a:hover {
	background: none;
	color: var(--accent-deep);
}

/* Mobile: a linked sub-item sits one step in from its programme and reads
   a notch quieter, so the accordion keeps a clear programme → sub-item
   hierarchy. The vertical padding stays ≥ 8px each side to keep a usable
   tap target. */
.mobile-sub a.mobile-sub-link {
	padding: 8px 0 8px 14px;
	border-left: 1px solid var(--line);
}
.mobile-sub a.mobile-sub-link .submenu-label {
	font-size: 13px;
	color: var(--ink-mute);
}

/* Services mega menu — keep the panel on screen.

   style.css centres the 1180px panel on the "Services" item (left: 50% of
   .nav-item). That only fits when the item sits near the middle of the
   viewport; on the English nav (shorter labels) at ~1300px the item is left
   of centre and half the panel ran off the left edge. A tiny script beside
   theme.js (inc/mega-menu-render.php) measures the item and writes the
   correction into --mega-shift; without it the variable is unset and the
   panel behaves exactly as before. Same selectors and specificity as the
   style.css rules they replace; this file loads after it. */
.mega-menu {
	transform: translateX(calc(-50% + var(--mega-shift, 0px))) translateY(10px);
}
.nav-item:hover .mega-menu {
	transform: translateX(calc(-50% + var(--mega-shift, 0px))) translateY(0);
}

/* The pointer (.submenu::before, centred on the panel in style.css) has to
   stay over the "Services" item when the panel is shifted, so it moves the
   same distance the other way. --mega-shift is inherited from .mega-menu;
   unset, this is the original left: 50%. */
.mega-menu::before {
	left: calc(50% - var(--mega-shift, 0px));
}
