header.wp-block-template-part {
	position: fixed;
  top: 0;
	width: 100%;
  z-index: 999;
  height: 100px;

	transition: height 500ms cubic-bezier(0.4, 0, 0.2, 1);

	> .wp-block-group {
		transition: padding 500ms cubic-bezier(0.4, 0, 0.2, 1);
	}

	svg {
		overflow: visible;
		border-radius: 0 !important;
	}
	
	&::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 100%;
		background: #353535;
		opacity: 0;
		transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
		pointer-events: none;
	}

  &:has(.header-black) {
    &::before {
      background: #F2F2F2;
    }
  }

	&.scrolled {
		height: 72px !important;
		> .wp-block-group {
			padding-top: var( --wp--preset--spacing--40 ) !important;
			padding-bottom: var( --wp--preset--spacing--40 ) !important;

			> .wp-block-group {
				padding-top: 0 !important;
				padding-bottom: 0 !important;
			}
		}
		&::before {
			opacity: 1;
		}
	} 
	@media screen and ( max-width: 781px ) {
		height: 85px;
		.wp-block-group > .wp-block-columns { 
			gap: 0;
			.wp-block-column {
				flex: 1 1 auto !important;
				width: auto;
			}

			> .wp-block-column:first-child {
				display: none;
			}
		}
	}
}

.home svg {
	filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
	transition: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.home .scrolled {
	&::before {
		background: #F2F2F2;
		opacity: 1;
	}

	*:not(.fancy-logo *) {
		/* color: rgb(53, 53, 53); */
		transition: color 500ms cubic-bezier(0.4, 0, 0.2, 1);
	}

	#modal-1-content {
		* {
			color: rgb(53, 53, 53);
		}
	}

	svg {
		filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
	}
}

/* Admin bar adjustments */
.admin-bar header.wp-block-template-part {
	top: 32px;

	@media screen and ( max-width: 781px ) {
		top: 46px;

		&.scrolled {
			top: 0 !important;
		}
	}
}

.site-content {
	padding-top: 100px;

	@media screen and ( max-width: 781px ) {
		padding-top: 85px;
	}
}

/* Admin bar adjustments for site content */
.admin-bar .site-content {
	padding-top: 132px; /* 100px + 32px */

	@media screen and ( max-width: 781px ) {
		padding-top: 131px; /* 85px + 46px */
	}
}

.home {
	.wp-block-cover:first-child {
		margin-top: -100px;

		@media screen and ( max-width: 781px ) {
			margin-top: -85px;
		}
	}
}

/* Admin bar adjustments for home cover */
.admin-bar.home {
	.wp-block-cover:first-child {
		margin-top: -132px; /* -100px - 32px */

		@media screen and ( max-width: 781px ) {
			margin-top: -131px; /* -85px - 46px */
		}
	}
}

/* Navigation header wrapper styles */
.nav-header-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	max-width: calc( calc( 50dvw + 147px ) - var( --wp--preset--spacing--80 ) );
	width: 100%;

	@media screen and ( max-width: 901px ) {
		max-width: 100%;
	}
	
	/* margin-right: calc( -1 * var( --wp--preset--spacing--80 ) ); */
	/* padding-right: var( --wp--preset--spacing--80 ); */
	height: 24px !important;
}

.nav-logo-desktop,
.nav-logo-mobile {
	display: flex;
	justify-content: center;
	align-items: center;
	padding-top: 2.5px;
}

.nav-logo-desktop {
	display: block;
	height: 40px;

	img {
		width: 294px !important;
	}
}

.nav-logo-mobile {
	display: none;

	img {
		margin-top: 7px;
		width: 94px !important;
	}
}

.nav-logo-desktop img,
.nav-logo-mobile img {
	height: 40px;
	width: auto;
	filter: brightness( 0 ) invert( 1 );

	transition: filter 300ms ease-in-out;

	&:hover {
		filter: invert(83%) sepia(50%) saturate(0%) hue-rotate(147deg) brightness(89%) contrast(88%);
	}
}

@media screen and ( max-width: 781px ) {
	.nav-logo-desktop {
		display: none;
	}
	
	.nav-logo-mobile {
		display: block;
	}
	
	.nav-logo-mobile img {
		height: 32px;
	}
}

/* Mobile menu fade-in animation - animate background and content separately */
.wp-block-navigation__responsive-container.is-menu-open {
	animation: fadeInBackground 300ms ease-in-out;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	opacity: 0;
	animation: fadeInContent 300ms ease-in-out forwards;
}

/* Hide regular navigation elements when modal is open */
.wp-block-navigation:has(.wp-block-navigation__responsive-container.is-menu-open) .wp-block-navigation__responsive-container-open {
	opacity: 0;
}

/* Hide other header elements when any modal is open */
header.wp-block-template-part:has(.is-menu-open) .wp-block-column:not(:has(.is-menu-open)) {
	opacity: 0;
}

@keyframes fadeInMenu {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes fadeInBackground {
    from { 
        backdrop-filter: opacity(0); 
        background-color: rgba(var(--wp--preset--color--custom-sort-90-main), 0);
    }
    to { 
        backdrop-filter: opacity(1); 
        background-color: rgba(var(--wp--preset--color--custom-sort-90-main), 1);
    }
}

@keyframes fadeInContent {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Adjust the navigation block breakpoint */
@media screen and (max-width: 859px) {
	html:not( .has-modal-open ) {
		.wp-block-navigation {
			flex: 1 0 auto;
			justify-content: end;
			align-self: center;
			padding-top: 5px;
		}
	}

	.wp-block-navigation__responsive-container-open:not( :has( ~ #modal-1 ) ) {
		/* Important to overwrite FSE. */
		display: flex !important;
	}

	.site-header .wp-block-columns .wp-block-column:first-child {
		display: none;
	}

	.wp-block-navigation__responsive-container:not( .is-menu-open ) {
		/* Important to overwrite FSE. */
		display: none !important;
	}
}