/* ==========================================================================
   TipsTeam — main menu hover
   Animated gradient underline + dropdown slide-in (desktop only)
   ========================================================================== */

:root {
	--tt-accent-1: #ff6a13;
	--tt-accent-2: #ec3078;
	--tt-accent-grad: linear-gradient(90deg, var(--tt-accent-1), var(--tt-accent-2));
}

@media (min-width: 992px) {

	/* ---------- Top level items ---------- */

	#tie-body #main-nav .main-menu .menu > li > a {
		position: relative;
		background: transparent !important;
		transition: color .25s ease, text-shadow .25s ease, transform .25s ease;
	}

	/* remove the old current-item block */
	#tie-body #main-nav .main-menu .menu > li,
	#tie-body #main-nav .main-menu .menu > li.tie-current-menu {
		border-bottom: 0 !important;
		margin-bottom: 0 !important;
		background: transparent !important;
	}

	/* gradient bar under the item */
	#tie-body #main-nav .main-menu .menu > li > a::after {
		content: "";
		position: absolute;
		left: 14px;
		right: 14px;
		top: auto;
		bottom: calc(50% - 20px);
		width: auto;
		height: 3px;
		margin: 0;
		border-radius: 3px;
		background: var(--tt-accent-grad);
		box-shadow: 0 0 12px rgba(236, 48, 120, .55);
		transform: scaleX(0);
		transform-origin: center;
		opacity: 0;
		transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease;
		pointer-events: none;
	}

	/* hover / keyboard focus / current page */
	#tie-body #main-nav .main-menu .menu > li:hover > a,
	#tie-body #main-nav .main-menu .menu > li > a:focus-visible,
	#tie-body #main-nav .main-menu .menu > li.tie-current-menu > a {
		color: #fff;
		background: transparent !important;
		text-shadow: 0 0 18px rgba(255, 106, 19, .45);
	}

	#tie-body #main-nav .main-menu .menu > li:hover > a {
		transform: translateY(-2px);
	}

	#tie-body #main-nav .main-menu .menu > li:hover > a::after,
	#tie-body #main-nav .main-menu .menu > li > a:focus-visible::after,
	#tie-body #main-nav .main-menu .menu > li.tie-current-menu > a::after {
		transform: scaleX(1);
		opacity: 1;
	}

	/* dim the other items while one is hovered, so the hovered one stands out */
	#tie-body #main-nav .main-menu .menu:hover > li:not(:hover) > a {
		opacity: .7;
	}
	/* dropdown arrow follows the accent */
	#tie-body #main-nav .main-menu .menu > li:hover > a::before {
		border-top-color: var(--tt-accent-1) !important;
	}

	/* ---------- Dropdowns & mega menus ---------- */

	#tie-body #main-nav .main-menu .menu > li > .menu-sub-content {
		border-top: 0;
		border-radius: 0 0 10px 10px;
		box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
	}

	/* gradient top edge */
	#tie-body #main-nav .main-menu .menu > li > .menu-sub-content::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 3px;
		background: var(--tt-accent-grad);
		z-index: 2;
	}

	/* fade + slide in when opened */
	#tie-body #main-nav .main-menu .menu > li:hover > .menu-sub-content,
	#tie-body #main-nav .main-menu .menu > li[aria-expanded="true"] > .menu-sub-content {
		animation: tt-menu-drop .28s cubic-bezier(.2, .8, .3, 1) both;
	}

	/* regular dropdown links */
	#tie-body #main-nav .main-menu .menu ul.sub-menu li > a,
	#tie-body #main-nav .main-menu .menu .mega-link-column ul li > a {
		position: relative;
		border-radius: 6px;
		transition: padding .25s ease, color .2s ease, background-color .2s ease;
	}

	#tie-body #main-nav .main-menu .menu ul.sub-menu li > a::before,
	#tie-body #main-nav .main-menu .menu .mega-link-column ul li > a::before {
		content: "";
		position: absolute;
		left: 0;
		top: 50%;
		width: 3px;
		height: 0;
		border-radius: 3px;
		background: var(--tt-accent-grad);
		transform: translateY(-50%);
		transition: height .25s ease;
	}

	#tie-body #main-nav .main-menu .menu ul.sub-menu li:hover > a,
	#tie-body #main-nav .main-menu .menu ul.sub-menu li.current-menu-item > a,
	#tie-body #main-nav .main-menu .menu .mega-link-column ul li:hover > a {
		color: #fff !important;
		background-color: rgba(255, 255, 255, .06);
		padding-left: 18px;
	}

	#tie-body #main-nav .main-menu .menu ul.sub-menu li:hover > a::before,
	#tie-body #main-nav .main-menu .menu ul.sub-menu li.current-menu-item > a::before,
	#tie-body #main-nav .main-menu .menu .mega-link-column ul li:hover > a::before {
		height: 60%;
	}

	/* mega menu: sub-category tabs and post titles pick up the accent */
	#tie-body #main-nav .mega-menu .cats-horizontal a.is-active,
	#tie-body #main-nav .mega-menu .cats-horizontal a:hover,
	#tie-body #main-nav .mega-menu .cats-vertical a.is-active,
	#tie-body #main-nav .mega-menu .cats-vertical a:hover {
		color: var(--tt-accent-1) !important;
	}

	#tie-body #main-nav .mega-menu .post-title a,
	#tie-body #main-nav .mega-menu .mega-menu-post-title a {
		background-image: var(--tt-accent-grad);
		background-size: 0 2px;
		background-repeat: no-repeat;
		background-position: 0 100%;
		transition: background-size .3s ease, color .2s ease;
	}

	#tie-body #main-nav .mega-menu .post-title a:hover,
	#tie-body #main-nav .mega-menu .mega-menu-post-title a:hover {
		background-size: 100% 2px;
		color: #fff !important;
	}

	/* header icons (search, etc.) */
	#tie-body #main-nav .components > li > a {
		transition: color .2s ease, transform .2s ease;
	}
	#tie-body #main-nav .components > li:hover > a {
		color: var(--tt-accent-1) !important;
		transform: scale(1.12);
	}
}

@keyframes tt-menu-drop {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
	#tie-body #main-nav .main-menu .menu > li > a,
	#tie-body #main-nav .main-menu .menu > li > a::after,
	#tie-body #main-nav .main-menu .menu ul li > a,
	#tie-body #main-nav .main-menu .menu ul li > a::before {
		transition: none !important;
	}
	#tie-body #main-nav .main-menu .menu > li > .menu-sub-content {
		animation: none !important;
	}
	#tie-body #main-nav .main-menu .menu > li:hover > a {
		transform: none;
	}
}
