/**
 * COBB sticky header — Astra #masthead
 *
 * Transparent header: Astra uses position:absolute on #masthead at the top so the hero shows through.
 * Applying sticky immediately would override that and create an opaque “strip” (often white).
 * Sticky positioning is only applied after scroll (.cobb-sticky--scrolled).
 */

/* ---------- Admin bar offset ---------- */

body.admin-bar:not(.ast-theme-transparent-header) #masthead.cobb-sticky-enabled {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar:not(.ast-theme-transparent-header) #masthead.cobb-sticky-enabled {
		top: 46px;
	}
}

body.admin-bar.ast-theme-transparent-header #masthead.cobb-sticky-enabled.cobb-sticky--scrolled {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.ast-theme-transparent-header #masthead.cobb-sticky-enabled.cobb-sticky--scrolled {
		top: 46px;
	}
}

/* ---------- Non–transparent header: sticky from first paint ---------- */

body:not(.ast-theme-transparent-header) #masthead.cobb-sticky-enabled {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 99998;
	transition: box-shadow var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Non-transparent header pages: add a little space below header */
body:not(.ast-theme-transparent-header) .site-content {
	padding-top: var(--cobb-header-content-gap, 18px);
}

/* ---------- Transparent header: sticky only after user scrolls ---------- */

.ast-theme-transparent-header #masthead.cobb-sticky-enabled.cobb-sticky--scrolled {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99998;
	transition: box-shadow var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
}

#masthead.cobb-sticky-enabled.cobb-sticky--scrolled {
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07), 0 10px 28px rgba(0, 0, 0, 0.08);
}

/* Primary row: compact padding only when scrolled */
#masthead.cobb-sticky-enabled .main-header-bar {
	transition: padding-top var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1),
		padding-bottom var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
}

#masthead.cobb-sticky-enabled.cobb-sticky--scrolled .main-header-bar {
	padding-top: var(--cobb-sticky-pad, 10px);
	padding-bottom: var(--cobb-sticky-pad, 10px);
}

/* Transparent: smooth handoff to solid bar background (inline rules) after scroll */
.ast-theme-transparent-header #masthead.cobb-sticky-enabled .ast-primary-header-bar {
	transition: background-color var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1),
		background-image var(--cobb-sticky-dur, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Header typography tweaks ---------- */

/* Increase visual weight for header text (menu + site title). */
#masthead .main-header-menu .menu-link,
#masthead .ast-builder-menu .menu-link,
#masthead .ast-site-identity .site-title a {
	font-weight: var(--cobb-header-font-weight, 600);
}

/* Dropdown menu text color (force black like theme). */
#masthead .main-header-menu .sub-menu .menu-link,
#masthead .ast-builder-menu .sub-menu .menu-link {
	color: #000 !important;
}

#masthead .main-header-menu .sub-menu .menu-item:hover > .menu-link,
#masthead .main-header-menu .sub-menu .menu-item.focus > .menu-link,
#masthead .main-header-menu .sub-menu .current-menu-item > .menu-link,
#masthead .main-header-menu .sub-menu .current-menu-ancestor > .menu-link,
#masthead .ast-builder-menu .sub-menu .menu-item:hover > .menu-link,
#masthead .ast-builder-menu .sub-menu .menu-item.focus > .menu-link,
#masthead .ast-builder-menu .sub-menu .current-menu-item > .menu-link,
#masthead .ast-builder-menu .sub-menu .current-menu-ancestor > .menu-link {
	background-color: var(--wp--preset--color--ast-global-color-0, #000) !important;
	color: #fff !important;
}

/* ---------- Mobile menu dropdown UX tweaks ---------- */
@media (max-width: 921px) {
	/* Hide the left arrow/marker before submenu items (Astra mobile). */
	.ast-header-break-point .main-navigation ul.sub-menu .menu-item .menu-link::before,
	.ast-header-break-point .main-header-menu .sub-menu .menu-item .menu-link::before,
	.ast-header-break-point .ast-builder-menu .sub-menu .menu-item .menu-link::before {
		content: none !important;
		display: none !important;
	}

	/* Also hide chevrons/markers on top-level items (e.g. “Category 3” in mobile menu). */
	.ast-header-break-point .main-navigation .menu-item > .menu-link::before,
	.ast-header-break-point .main-header-menu .menu-item > .menu-link::before,
	.ast-header-break-point .ast-builder-menu .menu-item > .menu-link::before,
	.ast-header-break-point .main-navigation .menu-item > .menu-link::after,
	.ast-header-break-point .main-header-menu .menu-item > .menu-link::after,
	.ast-header-break-point .ast-builder-menu .menu-item > .menu-link::after,
	.ast-header-break-point .main-navigation .menu-item > .menu-link .icon-arrow,
	.ast-header-break-point .main-header-menu .menu-item > .menu-link .icon-arrow,
	.ast-header-break-point .ast-builder-menu .menu-item > .menu-link .icon-arrow {
		content: none !important;
		display: none !important;
	}

	/* Remove border/background from the right-side submenu toggle button. */
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle {
		border: 0 !important;
		border-left: 0 !important;
		border-right: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	/* Remove the tap/click focus ring border that appears after opening a submenu. */
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle:focus,
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle:focus-visible,
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle:active,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle:focus,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle:focus-visible,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle:active,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle:focus,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle:focus-visible,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle:active {
		outline: none !important;
		border-color: transparent !important;
		box-shadow: none !important;
		background: transparent !important;
	}

	/* Some Astra mobile layouts add a separator line on toggle pseudo elements / wrappers. */
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle::before,
	.ast-header-break-point .main-navigation .menu-item-has-children > .ast-menu-toggle::after,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle::before,
	.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle::after,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle::before,
	.ast-header-break-point .ast-builder-menu .menu-item-has-children > .ast-menu-toggle::after {
		border: 0 !important;
	}

	/* Make submenu items progressively smaller than their parents. */
	.ast-header-break-point .main-navigation .menu-item > .menu-link {
		font-size: 15px;
	}
	.ast-header-break-point .main-navigation .sub-menu .menu-item > .menu-link {
		font-size: 14px;
	}
	.ast-header-break-point .main-navigation .sub-menu .sub-menu .menu-item > .menu-link {
		font-size: 13px;
	}
}
