/* Hover designs for the header menu. Add one nffat-nav-fx-<name> class to the navigation block; effects.js adds the sliding pill where one is needed. Desktop only: the phone overlay menu is untouched. */
[class*="nffat-nav-fx-"] {
	--nav-s: var(--nffat-hover-speed, 1.4);
	--nav-t: calc(300ms * var(--nav-s));
	--nav-ease: var(--nffat-motion-ease, cubic-bezier(0.23, 1, 0.32, 1));
	--nav-back: var(--nffat-motion-ease-back, cubic-bezier(0.34, 1.56, 0.64, 1));
	--nav-accent: var(--wp--preset--color--magenta-600);
	--nav-pill: var(--wp--preset--color--teal-50);
}

body.has-photo-hero [class*="nffat-nav-fx-"] {
	--nav-accent: var(--wp--preset--color--magenta-100);
}

.nffat-nav__pill {
	display: none;
}

@media (min-width: 1024px) {
	[class*="nffat-nav-fx-"] .wp-block-navigation__container {
		position: relative;
		isolation: isolate;
	}

	[class*="nffat-nav-fx-"] .wp-block-navigation__container > li > .wp-block-navigation-item__content {
		position: relative;
		transition: color var(--nav-t) var(--nav-ease), transform var(--nav-t) var(--nav-ease), opacity var(--nav-t) var(--nav-ease);
	}

	[class*="nffat-nav-fx-"] .wp-block-navigation__container > li > .wp-block-navigation-item__content::before,
	[class*="nffat-nav-fx-"] .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		transition: transform calc(380ms * var(--nav-s)) var(--nav-ease), opacity var(--nav-t) var(--nav-ease), clip-path calc(450ms * var(--nav-s)) var(--nav-ease);
	}

	[class*="nffat-nav-fx-"] .nffat-nav__pill {
		display: block;
		position: absolute;
		z-index: -1;
		left: -12px;
		top: -4px;
		width: calc(var(--pill-w, 0px) + 24px);
		height: calc(var(--pill-h, 0px) + 8px);
		border-radius: var(--nffat-radius-pill, 999px);
		background: var(--nav-pill);
		opacity: 0;
		pointer-events: none;
		transform: translate(var(--pill-x, 0px), var(--pill-y, 0px));
		transition: transform calc(340ms * var(--nav-s)) var(--nav-ease), width calc(340ms * var(--nav-s)) var(--nav-ease), opacity var(--nav-t) var(--nav-ease);
	}

	[class*="nffat-nav-fx-"] .nffat-nav__pill.is-shown {
		opacity: 1;
	}

	[class*="nffat-nav-fx-"] .nffat-nav__pill.is-vertical {
		left: 0;
		top: 0;
		width: var(--pill-w);
		height: var(--pill-h);
		border-radius: 16px;
		background: var(--wp--preset--color--magenta-50);
		transition: transform calc(300ms * var(--nav-s)) var(--nav-ease), opacity var(--nav-t) var(--nav-ease);
	}

	.nffat-nav-fx-underline .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 1px;
		height: 2px;
		border-radius: 1px;
		background: var(--nav-accent);
		transform: scaleX(0);
		transform-origin: 100% 50%;
	}

	.nffat-nav-fx-dot .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: calc(50% - 3px);
		bottom: -6px;
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: var(--nav-accent);
		transform: translateY(6px) scale(0);
		transition-timing-function: var(--nav-back);
	}

	.nffat-nav-fx-wave .wp-block-navigation__container > li > .wp-block-navigation-item__content::after,
	.nffat-nav-fx-pen .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: -2px;
		right: -2px;
		bottom: -4px;
		height: 6px;
		background: var(--nav-accent);
		mask: url("../shapes/wave.svg") 0 50% / 328px 6px repeat-x;
		clip-path: inset(0 100% 0 0);
	}

	.nffat-nav-fx-pen .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		bottom: -6px;
		height: 8px;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5c8-4 12 3 20 0s10-3 18 0 12 2 20-2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	}

	.nffat-nav-fx-marker .wp-block-navigation__container > li > .wp-block-navigation-item__content::before {
		content: "";
		position: absolute;
		inset: 2px -8px;
		z-index: -1;
		border-radius: 6px;
		background: var(--wp--preset--color--magenta-100);
		transform: scaleX(0) rotate(-2deg);
		transform-origin: 0 50%;
	}

	.nffat-nav-fx-roll .wp-block-navigation__container > li > .wp-block-navigation-item__content {
		overflow: hidden;
		border-radius: 0;
	}

	.nffat-nav-fx-roll .wp-block-navigation__container > li > .wp-block-navigation-item__content > .wp-block-navigation-item__label {
		display: block;
		text-shadow: 0 1.7em 0 var(--nav-accent);
		transition: transform calc(400ms * var(--nav-s)) var(--nav-ease);
	}

	.nffat-nav-fx-leaf .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		right: -11px;
		top: -8px;
		width: 12px;
		height: 15px;
		background: var(--wp--preset--color--leaf);
		mask: url("../shapes/leaf.svg") center / contain no-repeat;
		transform-origin: 0 100%;
		transform: scale(0) rotate(-50deg);
		transition-timing-function: var(--nav-back);
	}

	.nffat-nav-fx-outline .wp-block-navigation__container > li > .wp-block-navigation-item__content::before {
		content: "";
		position: absolute;
		inset: -3px -12px;
		border: 1.5px solid currentColor;
		border-radius: var(--nffat-radius-pill, 999px);
		opacity: 0;
		transform: scale(0.8);
		transition-timing-function: var(--nav-back);
	}

	.nffat-nav-fx-heart .wp-block-navigation__container > li > .wp-block-navigation-item__content::before {
		content: "";
		position: absolute;
		left: -15px;
		top: calc(50% - 5px);
		width: 11px;
		height: 10px;
		background: var(--wp--preset--color--magenta);
		mask: url("../shapes/heart.svg") center / contain no-repeat;
		transform: scale(0);
		transition-timing-function: var(--nav-back);
	}

	.nffat-nav-fx-fill .wp-block-navigation__container > li > .wp-block-navigation-item__content {
		isolation: isolate;
	}

	.nffat-nav-fx-fill .wp-block-navigation__container > li > .wp-block-navigation-item__content::before {
		content: "";
		position: absolute;
		inset: -3px -12px;
		z-index: -1;
		border-radius: var(--nffat-radius-pill, 999px);
		background: var(--wp--preset--color--teal);
		clip-path: inset(100% 0 0 0 round 999px);
	}

	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content::before,
	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		width: 8px;
		height: 8px;
		border: solid var(--nav-accent);
		opacity: 0;
	}

	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content::before {
		left: -9px;
		top: 0;
		border-width: 2px 0 0 2px;
		border-radius: 3px 0 0;
		transform: translate(5px, 5px);
	}

	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content::after {
		right: -9px;
		bottom: 0;
		border-width: 0 2px 2px 0;
		border-radius: 0 0 3px;
		transform: translate(-5px, -5px);
	}

	.nffat-nav-fx-thicken .wp-block-navigation__container > li > .wp-block-navigation-item__content > .wp-block-navigation-item__label {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		transition: font-weight var(--nav-t) var(--nav-ease);
	}

	.nffat-nav-fx-thicken .wp-block-navigation__container > li > .wp-block-navigation-item__content > .wp-block-navigation-item__label::after {
		content: attr(data-label);
		height: 0;
		overflow: hidden;
		visibility: hidden;
		font-weight: 800;
	}

	.nffat-nav-fx-follow-frosted {
		--nav-pill: rgb(255 255 255 / 0.2);
	}

	.nffat-nav-fx-follow-frosted .nffat-nav__pill {
		backdrop-filter: blur(10px);
	}

	.nffat-nav-fx-segmented .wp-block-navigation__container {
		gap: 0;
		padding: 4px;
		border-radius: var(--nffat-radius-pill, 999px);
		background: var(--wp--preset--color--teal-50);
	}

	.nffat-nav-fx-segmented .wp-block-navigation__container > li > .wp-block-navigation-item__content {
		padding: 10px 16px;
		color: var(--wp--preset--color--ink);
	}

	.nffat-nav-fx-segmented .nffat-nav__pill {
		left: 0;
		top: 0;
		width: var(--pill-w);
		height: var(--pill-h);
		background: var(--wp--preset--color--ink);
	}

	.nffat-nav-fx-segmented .wp-block-navigation__container > li > .wp-block-navigation-item__content.is-on {
		color: var(--wp--preset--color--white);
	}

	.nffat-nav-fx-islands {
		--nav-pill: var(--wp--preset--color--magenta-100);
		flex: 0 0 auto;
		margin-inline: auto;
	}

	.nffat-nav-fx-islands .wp-block-navigation__container {
		gap: 0;
		padding: 6px;
		border-radius: var(--nffat-radius-pill, 999px);
		background: var(--wp--preset--color--white);
	}

	.nffat-nav-fx-islands .wp-block-navigation__container > li > .wp-block-navigation-item__content {
		padding: 10px 14px;
		color: var(--wp--preset--color--ink);
	}

	.nffat-nav-fx-islands .nffat-nav__pill {
		left: 0;
		top: 0;
		width: var(--pill-w);
		height: var(--pill-h);
	}

	.nffat-nav-fx-islands .wp-block-navigation__container > li > .wp-block-navigation-item__content.is-on {
		color: var(--wp--preset--color--magenta-700);
	}

	.nffat-header:has(.nffat-nav-fx-islands) {
		padding: 0;
		background: transparent;
	}

	.nffat-header:has(.nffat-nav-fx-islands) .nffat-header__logo {
		display: flex;
		align-items: center;
		height: 60px;
		padding: 0 18px;
		border-radius: var(--nffat-radius-pill, 999px);
		background: var(--wp--preset--color--white);
	}

	body.has-photo-hero .nffat-header:has(.nffat-nav-fx-islands) .nffat-header__logo {
		--nffat-logo-leaf: initial;
		--nffat-logo-trunk: initial;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container,
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container {
		top: calc(100% + 14px);
		left: 50%;
		padding: 8px;
		border: 0;
		border-radius: 24px;
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--ink);
		box-shadow: 0 18px 40px rgb(4 41 39 / 0.16);
		transform-origin: 0 0;
		transform: translateX(-50%) translateY(-8px) scale(0.96);
		transition: transform calc(300ms * var(--nav-s)) var(--nav-ease), opacity calc(220ms * var(--nav-s)) var(--nav-ease), visibility 0s linear calc(300ms * var(--nav-s));
	}

	/* The 14px gap would close the menu on the way down; this invisible strip bridges it. */
	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container::before,
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 14px;
	}

	.nffat-nav-fx-panel-tiles .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container,
	.nffat-nav-fx-panel-list .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container {
		transform: translateX(-50%);
		transition-delay: 0s;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li,
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li {
		opacity: 0;
		transition: transform calc(420ms * var(--nav-s)) var(--nav-ease), opacity calc(300ms * var(--nav-s)) var(--nav-ease);
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li { transform: translateY(10px); }
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li { transform: translateX(-8px); }

	.nffat-nav-fx-panel-tiles .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container > li,
	.nffat-nav-fx-panel-list .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container > li {
		opacity: 1;
		transform: none;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:nth-child(2 of :not(.nffat-nav__pill)),
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li:nth-child(2 of :not(.nffat-nav__pill)) { transition-delay: calc(50ms * var(--nav-s)); }
	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:nth-child(3 of :not(.nffat-nav__pill)),
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li:nth-child(3 of :not(.nffat-nav__pill)) { transition-delay: calc(100ms * var(--nav-s)); }
	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:nth-child(n + 4 of :not(.nffat-nav__pill)),
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li:nth-child(n + 4 of :not(.nffat-nav__pill)) { transition-delay: calc(150ms * var(--nav-s)); }

	.nffat-nav-fx-panel-tiles .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container {
		display: flex;
		flex-direction: row;
		gap: 8px;
		width: max-content;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li {
		position: relative;
		overflow: hidden;
		width: 150px;
		height: 124px;
		border-radius: 18px;
		background: var(--wp--preset--color--magenta-100);
		--tile-shape: url("../shapes/heart.svg");
		--tile-shape-color: #F385B5;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:nth-child(3n + 2) {
		background: var(--wp--preset--color--mint);
		--tile-shape: url("../shapes/flame-leaf.svg");
		--tile-shape-color: #7FCBA2;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:nth-child(3n) {
		background: #BFE3DC;
		--tile-shape: url("../shapes/star.svg");
		--tile-shape-color: #4FAAA4;
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li::after {
		content: "";
		position: absolute;
		right: -10px;
		bottom: -12px;
		width: 72px;
		height: 72px;
		background: var(--tile-shape-color);
		mask: var(--tile-shape) center / contain no-repeat;
		pointer-events: none;
		transition: transform calc(450ms * var(--nav-s)) var(--nav-ease);
	}

	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content {
		position: relative;
		z-index: 1;
		align-items: flex-start;
		width: 100%;
		height: 100%;
		padding: 14px;
		font-family: var(--wp--preset--font-family--display);
		font-size: 18px;
		font-weight: 400;
		line-height: 1.05;
		white-space: normal;
		color: var(--wp--preset--color--ink);
	}

	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container {
		isolation: isolate;
		min-width: 240px;
	}

	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content {
		justify-content: space-between;
		padding: 12px 14px;
		border-radius: 16px;
		font-size: 15px;
		font-weight: 600;
		color: var(--wp--preset--color--ink);
	}

	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content::after {
		content: "";
		flex-shrink: 0;
		width: 16px;
		height: 16px;
		background: currentColor;
		mask: url("../icons/arrow-right.svg") center / contain no-repeat;
		opacity: 0;
		transform: translateX(-6px);
		transition: transform var(--nav-t) var(--nav-ease), opacity var(--nav-t) var(--nav-ease);
	}
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
	.nffat-nav-fx-underline .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after {
		transform: none;
		transform-origin: 0 50%;
	}

	.nffat-nav-fx-dot .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after,
	.nffat-nav-fx-heart .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::before,
	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::before,
	.nffat-nav-fx-corners .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after {
		opacity: 1;
		transform: none;
	}

	.nffat-nav-fx-wave .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after,
	.nffat-nav-fx-pen .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after {
		clip-path: inset(0);
	}

	.nffat-nav-fx-marker .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--ink); }
	.nffat-nav-fx-marker .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::before { transform: rotate(-2deg); }
	.nffat-nav-fx-roll .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover > .wp-block-navigation-item__label { transform: translateY(-1.7em); }
	.nffat-nav-fx-fade-others .wp-block-navigation__container:hover > li > .wp-block-navigation-item__content:not(:hover) { opacity: 0.35; }
	.nffat-nav-fx-leaf .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::after { transform: rotate(20deg); }
	.nffat-nav-fx-outline .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::before { opacity: 1; transform: none; }
	.nffat-nav-fx-heart .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover { transform: translateX(4px); }
	.nffat-nav-fx-hop .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover { animation: nffat-nav-hop calc(450ms * var(--nav-s)) var(--nav-ease); }
	.nffat-nav-fx-fill .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--white); }
	.nffat-nav-fx-fill .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover::before { clip-path: inset(0 round 999px); }
	.nffat-nav-fx-thicken .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover > .wp-block-navigation-item__label { font-weight: 800; }
	.nffat-nav-fx-panel-tiles .wp-block-navigation__submenu-container > li:hover::after { transform: scale(1.15) rotate(-8deg); }
	.nffat-nav-fx-panel-list .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content:hover::after { opacity: 1; transform: none; }
}

/* Current-page marks. Add one nffat-nav-on-<name> class beside the hover class. They sit on the list item, so they never clash with a hover effect drawn on the link. */
[class*="nffat-nav-on-"] {
	--nav-accent: var(--wp--preset--color--magenta-600);
}

body.has-photo-hero [class*="nffat-nav-on-"] {
	--nav-accent: var(--wp--preset--color--magenta-100);
}

@media (min-width: 1024px) {
	.nffat-nav-on-corners .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::before,
	.nffat-nav-on-corners .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after {
		content: "";
		position: absolute;
		width: 8px;
		height: 8px;
		border: solid var(--nav-accent);
		pointer-events: none;
	}

	.nffat-nav-on-corners .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::before { left: -9px; top: 0; border-width: 2px 0 0 2px; border-radius: 3px 0 0; }
	.nffat-nav-on-corners .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after { right: -9px; bottom: 0; border-width: 0 2px 2px 0; border-radius: 0 0 3px; }

	.nffat-nav-on-dot .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after,
	.nffat-nav-on-bar .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after,
	.nffat-nav-on-wave .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after {
		content: "";
		position: absolute;
		background: var(--nav-accent);
		pointer-events: none;
	}

	.nffat-nav-on-dot .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after { left: calc(50% - 3px); bottom: -6px; width: 6px; height: 6px; border-radius: 50%; }
	.nffat-nav-on-bar .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after { left: 0; right: 0; bottom: -3px; height: 3px; border-radius: 999px; }
	.nffat-nav-on-wave .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::after { left: -2px; right: -2px; bottom: -4px; height: 6px; mask: url("../shapes/wave.svg") 0 50% / 328px 6px repeat-x; }

	.nffat-nav-on-pill .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor) { isolation: isolate; }

	.nffat-nav-on-pill .wp-block-navigation__container > :is(.current-menu-item, .current-menu-ancestor)::before {
		content: "";
		position: absolute;
		inset: -3px -13px;
		z-index: -1;
		border-radius: 999px;
		background: color-mix(in srgb, var(--nav-accent) 14%, transparent);
		pointer-events: none;
	}
}

@keyframes nffat-nav-hop { 40% { transform: translateY(-5px); } 100% { transform: none; } }
