//
// Megamenu.
//
// @since    1.0.0
// @version  2.0.1
//

.is-style-megamenu:where( li:not( .open-always ) ) {

	.wp-block-navigation.has-child-selected &, // Always enable megamenu styles in editor.
	.wp-block-navigation.no-overlay-menu &,
	.has-overlay-menu .wp-block-navigation__responsive-container:not(.is-menu-open) & {
		@include media( 1025 ) { // 1024px breakpoint.

			// Columns container.
			> #{$selector} {
				flex-direction: row;
				align-items: flex-start;

				&[class] {
					gap: var(--wp--style--block-gap);
				}

				// Column.
				> .wp-block-navigation-item {
					flex: 0 1 14em;
					display: block;
					padding: 0;
					border-width: 0;
					vertical-align: top;

					.editor-styles-wrapper & {
						min-width: 14em;
					}

					// Column label.
					> .wp-block-navigation-item__content {
						border: 0 !important;
						font-size: var(--wp--preset--font-size--s);
						font-weight: 700;
						text-transform: uppercase;
						letter-spacing: var(--wp--custom--letter-spacing--heading);

						// Removing current (active) menu item styles/pointer (%current_menu_item).
						&::before {
							display: none;
						}
					}

					> .wp-block-navigation__submenu-icon {
						display: none;
					}

					// Content (sub-sub-menu).
					> #{$selector} {
						--theme--css--submenu-open-animation: none;

						display: block;
						position: static;
						min-width: clamp( 12em, 14vw, 240px ) !important;
						inset: 0;
						padding: 0;
						margin: 1em 0 0;
						background: none !important;
						border-width: 0;
						box-shadow: none;

						&::before {
							display: none;
						}

						#{$selector} {
							--theme--css--submenu-open-animation: showSubSubMenu .3s;
						}
					}
				}
			}
		}
	}
}
