/*
 * Sticky site header (Elementor Theme Builder header, every page).
 *
 * Native sticky, so it can sit under whatever is fixed at the top of the viewport:
 *   --sah-top-offset  height of the Juvo Leads "Call Now / Text Us" bar on phones
 *                     (0 when it isn't there), measured by header.js
 *   --sah-header-h    the header's own height, measured by header.js; sticky page
 *                     sections (e.g. the case-page jump bar) stack below it
 * The admin bar is added on top when logged in.
 */
.elementor-location-header {
	position: sticky;
	top: var(--sah-top-offset, 0px);
	z-index: 100; /* dropdown menus open over sticky page sections */
}
body.admin-bar .elementor-location-header {
	top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--sah-top-offset, 0px));
}
@media (max-width: 600px) {
	/* The admin bar scrolls away at this width. */
	body.admin-bar .elementor-location-header {
		top: var(--sah-top-offset, 0px);
	}
}

/* Page starts below the Juvo bar, so at the top the bar doesn't cover the header and the
   sticky header doesn't slide over the content. */
body {
	padding-top: var(--sah-top-offset, 0px);
}

/* Mobile/tablet menu (toggle dropdown) opens inside the stuck header: cap it to the space
   left on screen (--sah-menu-max, set by header.js) and let it scroll. */
.elementor-location-header .elementor-menu-toggle.elementor-active + .elementor-nav-menu__container {
	max-height: min(var(--menu-height, 100vh), var(--sah-menu-max, 100vh));
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* In-page #anchor links land below the sticky header. */
html {
	scroll-padding-top: calc(var(--sah-top-offset, 0px) + var(--sah-header-h, 0px) + 16px);
}
