/* Keep every homepage gallery image flush with the height of its grid tile. */
.gallery-feature-tile {
	overflow: hidden;
}

.gallery-feature-tile > img.media-img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	min-height: 100%;
	max-height: 100%;
	object-fit: cover;
}

/*
 * Keep the homepage hero photo flush with the complete mobile hero. Elementor's
 * base image rule otherwise lets the landscape image fall back to its intrinsic
 * height while the text card makes the containing hero taller.
 */
@media (max-width: 767px) {
	body.home .elementor-95 [data-id="hd00009"] > img.hero-photo {
		display: block;
		width: 100% !important;
		height: 100% !important;
		min-width: 100%;
		min-height: 100%;
		max-width: none !important;
		max-height: none !important;
		object-fit: cover;
		object-position: center center;
	}
}

/* Mobile navigation: a viewport-filling Framer-style fade. */
@media (max-width: 921.98px) {
	body.ast-main-header-nav-open {
		overflow: hidden;
	}

	/* Keep the logo and close button above the full-screen menu layer. */
	#ast-mobile-header .ast-primary-header-bar {
		position: relative;
		z-index: 100001;
		background: #fff;
	}

	body.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content {
		position: fixed;
		inset: 0;
		z-index: 100000;
		box-sizing: border-box;
		width: 100%;
		height: 100vh;
		height: 100dvh;
		padding: 104px 28px 36px;
		overflow-y: auto;
		background: var(--color-surface, #f8f8f6);
		display: flex !important;
		align-items: center;
		justify-content: center;
		animation: homedia-mobile-menu-fade-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
		will-change: opacity;
	}

	body.admin-bar.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content {
		top: 32px;
		height: calc(100dvh - 32px);
	}

	#ast-mobile-header .ast-mobile-header-content .ast-builder-menu-mobile,
	#ast-mobile-header .ast-mobile-header-content .ast-main-header-bar-alignment,
	#ast-mobile-header .ast-mobile-header-content .main-header-bar-navigation,
	#ast-mobile-site-navigation,
	#ast-hf-mobile-menu {
		width: 100%;
	}

	#ast-mobile-site-navigation > .main-navigation > .main-header-menu {
		width: min(100%, 520px);
		margin: 0 auto;
		background: transparent;
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	#ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item {
		width: 100%;
		border: 0;
		text-align: center;
	}

	#ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item > .menu-link {
		min-height: 0;
		padding: 12px 0;
		border: 0;
		color: var(--color-ink, #14284a);
		font-family: var(--font-display, inherit);
		font-size: clamp(28px, 8vw, 42px);
		font-weight: 600;
		line-height: 1.15;
		justify-content: center;
	}

	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item {
		animation: homedia-mobile-menu-item-fade-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
	}

	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(1) { animation-delay: 35ms; }
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(2) { animation-delay: 65ms; }
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(3) { animation-delay: 95ms; }
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(4) { animation-delay: 125ms; }
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(5) { animation-delay: 155ms; }
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item:nth-child(6) { animation-delay: 185ms; }

	/* Portfolio is a single destination on mobile; its child pages stay hidden. */
	#ast-mobile-site-navigation .page-item-97 > .sub-menu,
	#ast-mobile-site-navigation .page-item-97 > .ast-menu-toggle,
	#ast-mobile-site-navigation .page-item-97 > .menu-link .dropdown-menu-toggle {
		display: none !important;
	}
}

@media (max-width: 782px) {
	body.admin-bar.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content {
		top: 46px;
		height: calc(100dvh - 46px);
	}
}

@keyframes homedia-mobile-menu-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes homedia-mobile-menu-item-fade-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content,
	body.ast-main-header-nav-open #ast-mobile-site-navigation > .main-navigation > .main-header-menu > .menu-item {
		animation: none;
	}
}
