/*
 * Mega-menu panel for top-level nav items flagged with the "mega-menu"
 * CSS class in Appearance > Menus (Screen Options > CSS Classes).
 * Relies on GeneratePress's existing hover/click/keyboard dropdown
 * behaviour - this only restyles/repositions the resulting markup, it
 * does not replace GP's show/hide logic.
 *
 * .main-navigation.has-menu-bar-items only matches the desktop primary
 * nav (the off-canvas/mobile menu doesn't carry has-menu-bar-items), and
 * unlike #site-navigation it keeps matching after GeneratePress's
 * sticky-nav JS renames that id to #sticky-navigation while pinned. The
 * class combo also beats the specificity of the "li { position: relative }"
 * rule in style.css that we need to undo for the mega item specifically.
 */

@media (min-width: 1260px) {
	/* Un-anchor the mega item so the panel positions off .site-header
	   (position: relative in GP core) instead of off the trigger <li>,
	   letting it span the full header width edge-to-edge. */
	.main-navigation.has-menu-bar-items .menu > li.mega-menu {
		position: static;
	}

	.main-navigation.has-menu-bar-items .sub-menu.mega-menu-panel {
		position: absolute;
		left: 0;
		right: 0;
		width: auto;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		column-gap: 48px;
		row-gap: 0;
		padding: 40px 64px;
	}

	.main-navigation.has-menu-bar-items .sub-menu.mega-menu-panel > li {
		width: 100%;
	}

	/* Column headings (BTC / LWSOM / Resources) read as labels - their
	   lists are always expanded below them, not another hover flyout,
	   so they get no dropdown arrow. */
	.main-navigation.has-menu-bar-items .mega-menu-panel > li.menu-item-has-children > a {
		font-weight: 700;
		font-size: 16px;
		margin-bottom: 4px;
	}

	.main-navigation.has-menu-bar-items .mega-menu-panel .dropdown-menu-toggle {
		display: none;
	}

	.main-navigation.has-menu-bar-items .mega-menu-panel .sub-menu {
		position: static;
		left: auto;
		top: auto;
		opacity: 1;
		height: auto;
		overflow: visible;
		pointer-events: auto;
		box-shadow: none;
		width: 100%;
		float: none;
	}

	.main-navigation.has-menu-bar-items .mega-menu-panel .sub-menu a {
		padding: 6px 0 !important;
		font-size: 14px;
	}

	/* Feature (logo + tagline) sits on its own full-width row below the
	   three link columns. */
	.main-navigation.has-menu-bar-items .mega-menu-panel__feature {
		grid-column: 1 / -1;
		margin-top: 28px;
		padding-top: 24px;
		border-top: 1px solid rgba(23, 54, 107, 0.12);
	}
}

.mega-menu-panel__feature {
	display: flex;
	align-items: center;
}

.mega-menu-panel__feature-inner {
	display: flex;
	align-items: center;
	gap: 20px;
}

.mega-menu-panel__feature-logo {
	max-width: 140px;
	height: auto;
}

.mega-menu-panel__feature-inner p {
	font-size: 13px;
	line-height: 1.5;
	margin: 0;
	max-width: 420px;
}
