/**
 * Nav Menu block: behaviour and structure only.
 * Every colour, size, spacing, offset and duration is a Style tab control default in block.php.
 * Desktop: hover / focus dropdowns. Below the breakpoint (lk-nmenu--bp-tablet ≤1024px,
 * lk-nmenu--bp-mobile ≤767px) the list sits in a dropdown card opened by the hamburger.
 */

.lk-nmenu__list,
.lk-nmenu__list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lk-nmenu__list a {
	display: flex;
	align-items: center;
	text-decoration: none;
}

.lk-nmenu__list li {
	position: relative;
}

/* Arrow of items with a dropdown: inside the link's right padding (it does not widen the item).
 * Size, offset and line width are Menu Items controls. */
.lk-nmenu__list > .menu-item-has-children > a {
	position: relative;
}

.lk-nmenu__list > .menu-item-has-children > a::after {
	content: "";
	position: absolute;
	top: 50%;
	box-sizing: border-box;
	transform: rotate(45deg);
}

/* Mega Menu items: the module's chevron toggle takes the place of the arrow above
 * (its box size and position follow the arrow controls). */
.lk-nmenu__list > li.lk-mm > .lk-mm__trigger {
	position: relative;
}

.lk-nmenu__list > li.lk-mm > .lk-mm__trigger > .lk-mm__toggle {
	position: absolute;
	top: 50%;
	width: auto;
	height: auto;
	padding: 0;
	margin: 0;
	transform: translateY(-50%);
	background: none;
}

.lk-nmenu__list > li.lk-mm > .lk-mm__trigger > .lk-mm__toggle svg {
	display: block;
}

/* Matches the arrow's 1.5px line: browsers draw that border as whole device pixels,
 * 1px on standard screens and 1.5px on 2x ones. */
.lk-nmenu__list > li.lk-mm > .lk-mm__trigger > .lk-mm__toggle svg path {
	stroke-width: 1px;
	vector-effect: non-scaling-stroke;
}

@media (min-resolution: 2dppx) {
	.lk-nmenu__list > li.lk-mm > .lk-mm__trigger > .lk-mm__toggle svg path {
		stroke-width: 1.5px;
	}
}

.lk-nmenu__toggle,
.lk-nmenu__close,
.lk-nmenu__overlay,
.lk-nmenu__head {
	display: none;
}

.lk-nmenu__toggle,
.lk-nmenu__close {
	background: none;
	color: inherit;
	line-height: 0;
}

.lk-nmenu__toggle svg {
	display: block;
}

/* Desktop dropdowns ------------------------------------------------------ */
.lk-nmenu__list .sub-menu {
	position: absolute;
	left: 0;
	z-index: 200;
	opacity: 0;
	visibility: hidden;
}

/* Bridge over the Distance from the item, so the pointer can reach the dropdown. */
.lk-nmenu__list > li > .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
}

.lk-nmenu__list .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}

.lk-nmenu__list li:hover > .sub-menu,
.lk-nmenu__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.lk-nmenu__list > .menu-item-has-children:hover > a::after {
	transform: translateY(40%) rotate(225deg);
}

/* Drawer (below the breakpoint) ------------------------------------------ */
@media (max-width: 1024px) {
	/* A dropdown card under the hamburger (the wb-menu__nav--collapsible style),
	   not an off-canvas drawer: no overlay, no close button, no drawer head.
	   Its look is in Style → Mobile Toggle & Drawer; top follows the toggle (nav-menu.js). */
	.lk-nmenu--bp-tablet {
		position: relative;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__toggle {
		display: inline-flex;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__drawer {
		display: none;
		position: fixed;
		top: var(--lk-nmenu-card-top, 76px);
		z-index: 100001;
	}

	.lk-nmenu--bp-tablet.is-open .lk-nmenu__drawer {
		display: block;
		max-height: calc(100vh - 100px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__list {
		flex-direction: column;
		align-items: stretch;
	}

	.lk-nmenu.lk-nmenu--bp-tablet .lk-nmenu__drawer .lk-nmenu__list .sub-menu {
		position: static;
		min-width: 0;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		background: transparent;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__list .sub-menu li:last-child {
		border-bottom: 0;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__list > .menu-item-has-children > a {
		justify-content: space-between;
	}

	/* Collapsible drawer (the wb-menu__nav--collapsible pattern): sub-menus are
	   closed until their item is opened, and the arrow turns over while open. */
	.lk-nmenu--bp-tablet .lk-nmenu__drawer .lk-nmenu__list li:not(.lk-mm) > .sub-menu {
		display: none;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__drawer .lk-nmenu__list li.is-open > .sub-menu {
		display: block;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__drawer .menu-item-has-children.is-open > a::after {
		transform: translateY(40%) rotate(225deg);
	}

	/* Mega menu item: label left, module chevron right, one full-width pill.
	   The whole pill opens the panel (nav-menu.js); the link is inert in the drawer.
	   The chevron's margin keeps it centred on the other items' arrows (arrow controls). */
	.lk-nmenu--bp-tablet .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > a {
		flex: 1 1 auto;
		pointer-events: none;
	}

	.lk-nmenu--bp-tablet .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > .lk-mm__toggle {
		position: static;
		transform: none;
		flex: 0 0 auto;
	}
}

@media (max-width: 767px) {
	/* A dropdown card under the hamburger (the wb-menu__nav--collapsible style),
	   not an off-canvas drawer: no overlay, no close button, no drawer head.
	   Its look is in Style → Mobile Toggle & Drawer; top follows the toggle (nav-menu.js). */
	.lk-nmenu--bp-mobile {
		position: relative;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__toggle {
		display: inline-flex;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__drawer {
		display: none;
		position: fixed;
		top: var(--lk-nmenu-card-top, 76px);
		z-index: 100001;
	}

	.lk-nmenu--bp-mobile.is-open .lk-nmenu__drawer {
		display: block;
		max-height: calc(100vh - 100px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__list {
		flex-direction: column;
		align-items: stretch;
	}

	.lk-nmenu.lk-nmenu--bp-mobile .lk-nmenu__drawer .lk-nmenu__list .sub-menu {
		position: static;
		min-width: 0;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		background: transparent;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__list .sub-menu li:last-child {
		border-bottom: 0;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__list > .menu-item-has-children > a {
		justify-content: space-between;
	}

	/* Collapsible drawer (the wb-menu__nav--collapsible pattern): sub-menus are
	   closed until their item is opened, and the arrow turns over while open. */
	.lk-nmenu--bp-mobile .lk-nmenu__drawer .lk-nmenu__list li:not(.lk-mm) > .sub-menu {
		display: none;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__drawer .lk-nmenu__list li.is-open > .sub-menu {
		display: block;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__drawer .menu-item-has-children.is-open > a::after {
		transform: translateY(40%) rotate(225deg);
	}

	/* Mega menu item: label left, module chevron right, one full-width pill.
	   The whole pill opens the panel (nav-menu.js); the link is inert in the drawer.
	   The chevron's margin keeps it centred on the other items' arrows (arrow controls). */
	.lk-nmenu--bp-mobile .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > a {
		flex: 1 1 auto;
		pointer-events: none;
	}

	.lk-nmenu--bp-mobile .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > .lk-mm__toggle {
		position: static;
		transform: none;
		flex: 0 0 auto;
	}
}

/* Above its breakpoint the drawer only wraps the list. The drawer width and padding and the
 * mega chevron's drawer margin are controls written without a breakpoint (so their tablet and
 * mobile values work); these turn them off there, one class stronger than the controls. */
@media (min-width: 1025px) {
	.lkf-block.lkf-nav-menu .lk-nmenu--bp-tablet .lk-nmenu__drawer {
		width: auto;
		padding: 0;
	}

	.lkf-block.lkf-nav-menu .lk-nmenu--bp-tablet .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > .lk-mm__toggle {
		margin-right: 0;
	}
}

@media (min-width: 768px) {
	.lkf-block.lkf-nav-menu .lk-nmenu--bp-mobile .lk-nmenu__drawer {
		width: auto;
		padding: 0;
	}

	.lkf-block.lkf-nav-menu .lk-nmenu--bp-mobile .lk-nmenu__drawer li.lk-mm > .lk-mm__trigger > .lk-mm__toggle {
		margin-right: 0;
	}
}

/* One class stronger than the Transition duration control. */
@media (prefers-reduced-motion: reduce) {
	.lkf-block.lkf-nav-menu .lk-nmenu__list a,
	.lkf-block.lkf-nav-menu .lk-nmenu__list .sub-menu,
	.lk-nmenu__drawer {
		transition: none;
	}
}
