/**
 * Locations submenu flyout (header nav).
 * Duplicated in themes/puffafish/style.css — kept here so the menu styles
 * ship with the plugin when the theme on the server is not symlinked from git.
 *
 * Note: the zigzag clip-path fix (::before on .pf-site-header) lives in the
 * theme only; without it the flyout can still be clipped by the header teeth.
 */

.pf-site-header__nav .pf-menu > .menu-item {
	position: relative;
}

.pf-site-header__nav .menu-item-has-children > a {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.pf-site-header__nav .menu-item-has-children > a::after {
	content: "";
	display: block;
	width: 0.85em;
	height: 0.85em;
	flex-shrink: 0;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
	mask-repeat: no-repeat;
	mask-position: center;
	mask-size: contain;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	-webkit-mask-size: contain;
	transition: transform 0.22s ease;
}

.pf-site-header__nav .menu-item-has-children:hover > a::after,
.pf-site-header__nav .menu-item-has-children:focus-within > a::after {
	transform: rotate(180deg);
}

.pf-site-header__nav .pf-menu > .menu-item-has-children:hover,
.pf-site-header__nav .pf-menu > .menu-item-has-children:focus-within {
	z-index: 1200;
}

.pf-site-header__nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1200;
	list-style: none;
	margin: 0.35rem 0 0;
	padding: 0.35rem 0.75rem 0.35rem 0;
	min-width: 0;
	width: max-content;
	background-color: var( --wp--preset--color--dark-green, #183028 );
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba( 24, 48, 40, 0.28 );
	opacity: 0;
	visibility: hidden;
	transform: translateY( -10px );
	transition:
		opacity 0.22s ease,
		transform 0.22s ease,
		visibility 0.22s ease;
}

.pf-site-header__nav .menu-item-has-children:hover > .sub-menu,
.pf-site-header__nav .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
}

.pf-site-header__nav .sub-menu .menu-item {
	margin: 0;
}

.pf-site-header__nav .sub-menu a {
	display: block;
	padding: 0.55rem 0 0.55rem 0;
	font-weight: 700;
	color: var( --wp--preset--color--cream, #f5f0e8 );
	white-space: nowrap;
}

.pf-site-header__nav .sub-menu a:hover,
.pf-site-header__nav .sub-menu .current-menu-item > a {
	color: #fff;
}

@media ( max-width: 900px ) {
	.pf-site-header__nav .sub-menu {
		position: static;
		margin: 0.25rem 0 0 0.5rem;
		padding: 0;
		min-width: 0;
		background: transparent;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.pf-site-header__nav .sub-menu a {
		padding: 0.35rem 0;
		color: var( --wp--preset--color--dark-green, #183028 );
	}

	.pf-site-header__nav .menu-item-has-children > a::after {
		display: none;
	}
}
