/*
 * Header navigation dropdowns (Services, Ressourcen).
 *
 * The child theme makes `.light-nav .sub-menu` transparent and colours the
 * links --dark-4 (#ADB0B8, ~2.1:1 on white), so on pages with a hero image the
 * entries sit unreadable on the photo. This gives every desktop dropdown in the
 * header an opaque panel. Selectors are deliberately long to outrank the child
 * theme's `.light-nav .sub-menu .menu-item:hover a` without !important where
 * possible.
 *
 * Contrast on white: title #323C4B ≈ 11:1, description #5B636F ≈ 6.2:1.
 * On the current-page tint (#DEDEF7): title ≈ 8.4:1, description ≈ 4.6:1.
 */

/*
 * Home page: the child theme stacks its full-screen `.home-section`s
 * (position: fixed, z-index 1000) above the sticky header (999), so the white
 * hero headline would paint over an open dropdown. Lift the header only while
 * SmartMenus has a submenu open (it marks the parent link `.highlighted`),
 * staying under the home page's loading view (1100).
 */
.elementor-location-header .is-sticky:has(.elementor-nav-menu--main a.highlighted) {
	z-index: 1050;
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu {
	--mc-nav-ink: var(--dark-1, #323C4B);
	--mc-nav-muted: var(--dark-2, #5B636F);
	/* Tints of --blue-1, the open-FAQ colour, so the menu matches the page. */
	--mc-nav-hover: #EFEFFB;
	--mc-nav-current: var(--blue-5, #DEDEF7);
	--mc-nav-accent: var(--blue-1, #5A5FD7);

	width: 330px !important;
	min-width: 0 !important;
	max-width: calc(100vw - 32px) !important;
	padding: 10px !important;
	/* Sit below the header row; the ::before bridge keeps the hover alive. */
	translate: -16px 16px;
	background-color: #fff !important;
	border: 1px solid var(--dark-5, #D6D9DB);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(50, 60, 75, 0.18);
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu::before {
	content: "";
	position: absolute;
	inset: -17px 0 auto 0;
	height: 17px;
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item {
	padding: 0;
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item > a.elementor-sub-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 8px;
	background-color: transparent;
	color: var(--mc-nav-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: 0;
	text-transform: none;
	white-space: normal;
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item > a.elementor-sub-item:hover,
.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item > a.elementor-sub-item:focus-visible {
	padding: 10px 12px;
	background-color: var(--mc-nav-hover);
	color: var(--mc-nav-ink);
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item > a.elementor-sub-item:focus-visible {
	outline: 2px solid var(--mc-nav-accent);
	outline-offset: -2px;
}

/* Current page: WordPress marks the <li>, Elementor the link. */
.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .current-menu-item > a.elementor-sub-item,
.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu > .menu-item > a.elementor-sub-item.elementor-item-active {
	background-color: var(--mc-nav-current);
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu .mc-menu-title {
	display: block;
}

.elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu .mc-menu-desc {
	display: block;
	color: var(--mc-nav-muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
}
