/* Services mega menu (4 Dec 2026). Loaded only while NOVITY_MEGA_MENU is true (see inc/mega-menu.php).
   Desktop/tablet only: the phone overlay menu keeps WordPress's plain list. */

.nv-mega { display: none; }

@media (min-width: 600px) {
	/* Let the panel anchor to the full-width header rather than the menu item. */
	.nv-nav:not(:has(.is-menu-open)),
	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open),
	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-dialog,
	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .nv-has-mega {
		position: static;
	}

	/* The plain drop-down list is replaced by the panel here. */
	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .nv-has-mega > .wp-block-navigation__submenu-container {
		display: none !important;
	}

	/* Invisible bridge between "Services" and the panel so it doesn't close as the pointer moves down. */
	.nv-nav .nv-has-mega > .wp-block-navigation-item__content::before {
		content: ""; position: absolute; left: -14px; right: -14px; top: 100%; height: 48px;
	}

	.nv-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .nv-mega {
		display: block;
		position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
		background: var(--nv-cold);
		color: #E9E3F3;
		border-top: 1px solid rgba(255, 255, 255, .06);
		box-shadow: 0 30px 60px rgba(28, 23, 54, .35);
		white-space: normal; text-align: left; font-size: 1rem; font-weight: 400;
		opacity: 0; visibility: hidden; transform: translateY(-8px);
		transition: opacity .2s ease, transform .3s var(--nv-ease), visibility 0s linear .3s;
	}
	.nv-nav .nv-has-mega:hover > .nv-mega,
	.nv-nav .nv-has-mega:focus-within > .nv-mega,
	.nv-nav .nv-has-mega > .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .nv-mega {
		opacity: 1; visibility: visible; transform: none;
		transition: opacity .2s ease, transform .3s var(--nv-ease), visibility 0s;
	}
	.nv-nav .nv-has-mega.nv-mega-dismissed > .nv-mega { opacity: 0; visibility: hidden; transform: translateY(-8px); }

	/* Layout */
	.nv-mega__inner {
		max-width: 1200px; margin: 0 auto;
		padding: 2.25rem clamp(1rem, 4vw, 2rem) 2.5rem;
		display: grid; grid-template-columns: minmax(220px, 290px) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
	}
	.nv-mega__intro > * { margin: 0 0 .75rem; }
	.nv-mega__eyebrow { font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #D8C4EC; }
	.nv-mega__title { font-size: 1.45rem; font-weight: 300; line-height: 1.25; color: #fff; letter-spacing: -.01em; }
	.nv-mega__text { font-size: .95rem; line-height: 1.55; color: rgba(233, 227, 243, .75); }
	.nv-nav .nv-mega__btn {
		display: inline-block; margin-top: .25rem; padding: .6em 1.2em; border-radius: 999px;
		background: #fff; color: var(--nv-brand); font-weight: 500; font-size: .92rem; text-decoration: none;
		transition: background .25s, transform .25s var(--nv-ease);
	}
	.nv-nav .nv-mega__btn:hover { background: var(--nv-warm); transform: translateY(-1px); }
	.nv-mega__help { margin-top: 1.5rem !important; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .88rem; line-height: 1.6; color: rgba(233, 227, 243, .65); }
	.nv-mega__help > * { margin: 0 0 .6rem; }
	.nv-mega__help-q { font-size: 1rem; font-weight: 500; color: #fff; }
	.nv-nav .nv-mega__quiz {
		display: inline-flex; align-items: center; gap: .45rem; padding: .55em 1.1em; border-radius: 999px;
		border: 1.5px solid rgba(216, 196, 236, .7); color: #fff; font-weight: 500; font-size: .92rem; text-decoration: none;
		transition: background .25s, border-color .25s, transform .25s var(--nv-ease);
	}
	.nv-nav .nv-mega__quiz:hover, .nv-nav .nv-mega__quiz:focus-visible { background: rgba(255, 255, 255, .12); border-color: #fff; transform: translateY(-1px); }
	.nv-nav .nv-mega__help-alt a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 3px; }

	/* Service grid */
	.nv-nav .nv-mega__grid {
		list-style: none; margin: 0; padding: 0;
		display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem .9rem;
	}
	.nv-mega__item { margin: 0; }
	.nv-nav .nv-mega__item > a {
		display: flex; align-items: flex-start; gap: .8rem;
		padding: .7rem .75rem; border-radius: 12px;
		color: #fff; text-decoration: none;
		transition: background .2s ease;
	}
	.nv-nav .nv-mega__item > a:hover,
	.nv-nav .nv-mega__item > a:focus-visible { background: rgba(255, 255, 255, .08); }
	.nv-nav .nv-mega__item > a:focus-visible { outline: 2px solid #D8C4EC; outline-offset: 0; }
	.nv-mega__item--featured > a { background: rgba(153, 97, 209, .18); }
	.nv-nav .nv-mega__item--featured > a:hover { background: rgba(153, 97, 209, .28); }

	.nv-mega__icon {
		flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
		display: grid; place-items: center;
		background: linear-gradient(135deg, #F3ECFA, #EADCF7);
		transition: transform .35s var(--nv-ease);
	}
	.nv-mega__icon img { width: 22px; height: 22px; display: block; }
	.nv-nav .nv-mega__item > a:hover .nv-mega__icon { transform: rotate(-6deg) scale(1.06); }
	.nv-mega__label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
	.nv-mega__name { font-weight: 500; font-size: .97rem; line-height: 1.3; }
	.nv-mega__desc { font-size: .84rem; line-height: 1.4; color: rgba(233, 227, 243, .68); }

	/* Grid items rise in one after another when the panel opens. */
	@media (prefers-reduced-motion: no-preference) {
		.nv-nav .nv-has-mega:hover > .nv-mega .nv-mega__item,
		.nv-nav .nv-has-mega:focus-within > .nv-mega .nv-mega__item,
		.nv-nav .nv-has-mega > .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .nv-mega .nv-mega__item {
			animation: nv-mega-in .35s var(--nv-ease) both;
		}
		.nv-mega__item:nth-child(2) { animation-delay: .02s !important; }
		.nv-mega__item:nth-child(3) { animation-delay: .04s !important; }
		.nv-mega__item:nth-child(4) { animation-delay: .06s !important; }
		.nv-mega__item:nth-child(5) { animation-delay: .08s !important; }
		.nv-mega__item:nth-child(6) { animation-delay: .10s !important; }
		.nv-mega__item:nth-child(n+7) { animation-delay: .12s !important; }
	}
}

@keyframes nv-mega-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Tablets and small laptops: compact intro on top, grid across the full width (2 columns, 3 from 900px). */
@media (min-width: 600px) and (max-width: 1149px) {
	.nv-mega__inner { grid-template-columns: 1fr; gap: 1.25rem; }
	.nv-mega__intro { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
	.nv-mega__intro > * { margin: 0; }
	.nv-mega__text, .nv-mega__help-q, .nv-mega__help-alt { display: none; }
	.nv-mega__help { margin: 0 !important; padding: 0; border: 0; }
	.nv-mega__help > * { margin: 0; }
	.nv-nav .nv-mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) and (max-width: 1149px) {
	.nv-nav .nv-mega__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
