/* main site fishersin.gov */

:root {
	--js--header--height: 10rem;
	/* don't judge me */
	--js--wrapper--padding-left: 3rem;
	--js--wrapper--padding-right: var(--js--wrapper--padding-left);
	--js--wrapper--padding: 2em var(--js--wrapper--padding-left);
	--center-mark--bg: var(--wp--preset--color--primary), linear-gradient(white, white) no-repeat center center 2px 100%;
}

@keyframes grow {
	0% {
		height: 0;
	}
	100% {
		height: 100%;
	}
}

.megamenu {
	font-weight: 900;
	font-size: 1.2rem;
	letter-spacing: 0.015em;
}

.megamenu > p {
	display: none;
}

.megamenu a {
	display: inline-block;
}

.megamenu #primary-ul-wrapper .menu {
	margin: 0;
	padding: 0;
}

.megamenu #primary-ul-wrapper ul li {
	list-style-type: none;
}

.megamenu #primary-ul-wrapper ul ul {
	width: 100%;
}

.megamenu #primary-ul-wrapper ul ul ul {
	font-weight: 400;
}

.megamenu #primary-ul-wrapper ul ul li a {
	padding: 0.25em 0;
}

.menu-btn {
	background: transparent;
	border: none;
	display: block;
	cursor: pointer;
	padding: 0;
}

.wp-block-group.has-primary-background-color .menu-btn {
	border-radius: 0.7em 0.7em 0 0;
	padding: 1em 2em;
}

.menu-btn svg#fish-icon-menu {
	stroke-width: 3;
	display: block;
	width: 100%;
	min-width: 3em;
	max-width: 3.25em;
	min-height: 1em;
}

.wp-block-group.has-primary-background-color .megamenu {
	display: none;
}

.megamenu-section {
	padding-left: 0;
	padding-right: 0;
}

.megamenu-section .megamenu {
	display: block;
}

.sub-menu-btn {
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	max-height: 3.5em;
	overflow: hidden;
	-webkit-transition: 0.3s;
	position: absolute;
	right: 0;
	top: 0;
	transition: 0.3s;
	width: 2em;
	z-index: 200;
}

.sub-menu.toggled .sub-menu-btn {
	max-height: 2em;
}

.sub-menu-btn svg {
	height: 1em;
	width: 1em;
	fill: var(--wp--preset--color--secondary);
	transform: rotate(0deg);
	transition: transform 0.3s ease;
}

.sub-menu .sub-menu-btn svg {
	fill: var(--wp--preset--color--primary);
}

.sub-menu .sub-menu .sub-menu-btn svg {
	fill: var(--wp--preset--color--secondary);
}

.sub-menu-btn:active svg,
.sub-menu-btn:hover svg {
	fill: var(--wp--preset--color--base);
}

.menu-btn span,
.sub-menu-btn .menu-dropdown-more {
	display: block;
	text-align: center;
	text-indent: 100%;
	overflow: hidden;
	padding: 0;
	margin: 0;
	line-height: 0;
	height: 0;
	width: 0;
}

/* DESKTOP */

@media (min-width: 1233px) {
	.megamenu {
		flex: 2;
	}

	.megamenu #primary-ul-wrapper .menu {
		display: flex;
		justify-content: flex-end;
		width: 100%;
	}

	.megamenu > .menu-btn,
	.megamenu .sub-menu-btn {
		display: none;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item {
		background: white;
		padding: 1.5em 1.5em;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item:focus-within,
	.megamenu #primary-ul-wrapper .menu > .menu-item:hover {
		/* background: var(--wp--preset--color--primary), linear-gradient(white, white) no-repeat center center 2px 100%; */
		background: var(--wp--preset--color--primary);
		border-radius: 15px;
		color: var(--wp--preset--color--base);
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item-has-children:focus-within,
	.megamenu #primary-ul-wrapper .menu > .menu-item-has-children:hover {
		border-radius: 15px 15px 0 0;
	}

	/* make the centering make sense visually */

	/* .megamenu #primary-ul-wrapper .menu > .menu-item-has-children .menu-item-has-children > a {
        border-bottom: 1px solid #ffffff80;
    } */

	.megamenu #primary-ul-wrapper .menu > .menu-item > a {
		line-height: 1.1;
		text-align: center;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item:focus-within a,
	.megamenu #primary-ul-wrapper .menu > .menu-item:hover a,
	.megamenu #primary-ul-wrapper .menu .sub-menu a {
		color: var(--wp--preset--color--base);
		display: block;
	}

	.megamenu #primary-ul-wrapper .menu .sub-menu a {
		line-height: 1.25;
		margin-bottom: 0.5em;
	}

	.megamenu #primary-ul-wrapper .menu-item .sub-menu {
		visibility: hidden;
		display: none;
		opacity: 0;
		overflow: hidden;
		transition-property: opacity;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item:focus .sub-menu,
	.megamenu #primary-ul-wrapper .menu > .menu-item:focus-within .sub-menu,
	.megamenu #primary-ul-wrapper .menu > .menu-item:hover .sub-menu {
		visibility: visible;
		display: block;
		opacity: 1;
		padding: 0;
		overflow: inherit;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item:focus > .wrapper,
	.megamenu #primary-ul-wrapper .menu > .menu-item:focus-within > .wrapper,
	.megamenu #primary-ul-wrapper .menu > .menu-item:hover > .wrapper {
		background-color: var(--wp--preset--color--primary);
		display: block;
		left: 0;
		padding: var(--js--wrapper--padding);
		position: absolute;
		right: 0;
		top: var(--js--header--height);
		width: 100%;
		z-index: 999;
	}

	.megamenu .fit-content .sub-menu,
	.megamenu .fit-content .sub-menu li {
		max-width: fit-content;
	}

	/* troubleshoot centering */
	/* 
    .megamenu #primary-ul-wrapper .menu > .menu-item-has-children:hover {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .megamenu #primary-ul-wrapper .menu > .menu-item-has-children:hover::after {
        content: '▼';
    } 
    
    .megamenu #primary-ul-wrapper .menu > .menu-item:hover > .wrapper > .sub-menu {
        background: linear-gradient(white, white) no-repeat center / 2px 100%;
        background-position-x: calc(50% - 1px);
    }
    */

	.megamenu #primary-ul-wrapper .menu > .menu-item:focus > .wrapper > .sub-menu,
	.megamenu #primary-ul-wrapper .menu > .menu-item:focus-within > .wrapper > .sub-menu,
	.megamenu #primary-ul-wrapper .menu > .menu-item:hover > .wrapper > .sub-menu {
		display: flex;
		gap: 1em;
		width: fit-content;
	}

	.megamenu #primary-ul-wrapper .sub-menu .menu-item .sub-menu {
		font-weight: 200;
		padding-left: 0;
	}

	.megamenu #primary-ul-wrapper .sub-menu .menu-item .sub-menu li {
		align-items: center;
		display: flex;
		gap: 5px;
		list-style-type: none;
		transform: inherit;
		transition: transform 0.4s;
	}

	.megamenu #primary-ul-wrapper .sub-menu .menu-item .sub-menu li::before {
		content: "•";
		margin-bottom: auto;
	}

	.megamenu li.active > a {
		opacity: 0.8;
		cursor: default;
		pointer-events: none;
	}

	.megamenu #primary-ul-wrapper ul ul ul.all-childfree {
		padding-left: 0;
	}

	/* differentiate has-children vs childfree */

	.megamenu #primary-ul-wrapper .wrapper > .sub-menu .menu-item-has-children,
	.megamenu #primary-ul-wrapper .wrapper > .sub-menu .menu-item-has-children {
		min-width: 25ch;
		width: 25ch;
	}

	/* .megamenu #primary-ul-wrapper > ul > li > ul > li.menu-item-has-children > a, */
	.megamenu #primary-ul-wrapper .sub-menu .menu-item .sub-menu li.childfree {
		font-weight: 900;
	}

	.megamenu #primary-ul-wrapper .sub-menu .menu-item .sub-menu li.childfree::before {
		content: "";
	}

	.megamenu #primary-ul-wrapper li.childfree a {
		font-weight: bolder;
		max-width: 35ch;
	}

	.megamenu .hide-desktop {
		display: none;
		visibility: hidden;
		height: 0;
		width: 0;
		overflow: hidden;
	}
}

/* MOBILE */

@media (max-width: 1232px) {
	.wp-block-group.has-primary-background-color .megamenu {
		display: none;
	}

	.megamenu-section .megamenu {
		display: block;
	}

	.megamenu #primary-ul-wrapper ul {
		padding-left: 0;
		margin-left: 0;
	}
	.megamenu #primary-ul-wrapper ul li {
		position: relative;
		padding-left: 0;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item .sub-sub-menu,
	.megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu,
	.megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu,
	.megamenu #primary-ul-wrapper {
		display: none;
	}

	.megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu.toggled,
	.megamenu #primary-ul-wrapper.toggled .menu > .menu-item > .sub-menu.toggled,
	.megamenu #primary-ul-wrapper.toggled {
		display: block;
		background-color: var(--wp--preset--color--base);
	}

	.megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu.toggled {
		color: var(--wp--preset--color--primary);
		padding-left: calc(var(--wp--style--root--padding-left) + 2em);
	}

	.megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu.toggled li {
		list-style-type: disc;
	}

	.menu-btn svg#fish-icon-menu {
		stroke: var(--wp--preset--color--primary);
	}

	.sub-menu.toggled ~ .sub-menu-btn svg {
		transform: rotate(90deg);
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item > a,
	.megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item > a {
		padding-left: var(--wp--style--root--padding-left);
		padding-right: var(--wp--style--root--padding-right);
	}

	.megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu.toggled a,
	.megamenu #primary-ul-wrapper.toggled .menu > .menu-item > .sub-menu.toggled a {
		color: var(--wp--preset--color--primary);
	}

	.megamenu #primary-ul-wrapper.toggled {
		background-color: var(--wp--preset--color--base);
		left: 0;
		position: absolute;
		right: 0;
		z-index: 999;
	}

	.megamenu-section #primary-ul-wrapper.toggled {
		margin-top: 1em;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item {
		background-color: var(--wp--preset--color--primary);
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item {
		background-color: var(--wp--preset--color--secondary);
	}

	.megamenu .toggled a {
		color: var(--wp--preset--color--base);
		padding: 1em 0;
	}

	.megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item > a {
		color: var(--wp--preset--color--base) !important;
	}

	.site-id-2.site-name-fishers-fire-department .megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item > a {
		color: black !important;
	}

	.megamenu .hide-desktop {
		display: block;
		visibility: visible;
		height: auto;
		width: auto;
		overflow: initial;
	}
}

/* X SMALL MOBILE */

@media (max-width: 700px) {
	.wp-block-group.has-primary-background-color .megamenu {
		display: block;
	}

	.main-site .megamenu-section .megamenu {
		display: none;
	}

	.wp-block-group.has-primary-background-color #primary-ul-wrapper.toggled {
		margin-top: 0.67em;
	}

	.main-site .menu-btn svg#fish-icon-menu {
		stroke: var(--wp--preset--color--base);
	}

	.main-site .menu-btn.is-active {
		background-color: var(--wp--preset--color--base);
		margin-bottom: -0.9rem;
		padding: 1em 2em !important;
	}

	.menu-btn.is-active svg#fish-icon-menu {
		stroke: var(--wp--preset--color--primary);
	}

	.sub-menu-btn {
		min-width: 4em;
	}
}

/**
 * some of the parks style variation sites use black (the contrast color) for the menu
 * instead of the primary style variation color. 
 * rather than add new duplicate lines for every site that goes this way,
 * add the blackout class to the site via functions.php
 */

.blackout .menu.primary-ul > li > a {
	color: var(--wp--preset--color--contrast);
}
.blackout .megamenu .toggled a {
	color: var(--wp--preset--color--base) !important;
}

.blackout .megamenu #primary-ul-wrapper .menu .sub-menu .sub-menu.toggled {
	color: var(--wp--preset--color--contrast);
}

.blackout .megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item {
	background-color: var(--wp--preset--color--contrast);
}

.blackout .sub-menu-btn svg {
	fill: var(--wp--preset--color--base);
}

.blackout .sub-menu .sub-menu-btn svg {
	fill: var(--wp--preset--color--base);
}

.blackout .sub-menu .sub-menu .sub-menu-btn svg {
	fill: var(--wp--preset--color--base);
}

/* DESKTOP */

@media (min-width: 1233px) {
	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item:focus-within,
	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item:hover {
		background: var(--wp--preset--color--contrast);
	}

	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item:focus > .wrapper,
	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item:focus-within > .wrapper,
	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item:hover > .wrapper {
		background-color: var(--wp--preset--color--contrast);
	}
}

/* MOBILE */

@media (max-width: 1232px) {
	.blackout .menu-btn svg#fish-icon-menu {
		stroke: var(--wp--preset--color--contrast);
	}

	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item {
		background-color: var(--wp--preset--color--contrast);
	}

	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item {
		background-color: var(--wp--preset--color--base);
	}

	.blackout .megamenu #primary-ul-wrapper .menu > .menu-item > .sub-menu > .menu-item > a {
		color: var(--wp--preset--color--contrast) !important;
	}
}
