/*
 * XGene Stage 8 Shell Root-Cause Correction 1.13.7
 *
 * Goal: make the homepage and every inner-page family share the same header
 * geometry without negative margins or duplicated WordPress admin-bar offsets.
 *
 * Root cause addressed here: residual top spacing on Astra's intermediate
 * desktop/mobile header wrappers. The 1.13.6 above-header suppression did not
 * reach these wrapper layers, so internal routes could still reserve an empty
 * band above the primary XGene navigation.
 */

/* --------------------------------------------------------------------------
   01. ONE HEADER GEOMETRY CONTRACT
   Astra may emit several nested header wrappers. None of these wrappers owns
   vertical reserve above the primary XGene navigation. Their children still
   own the intended header height and internal alignment.
   -------------------------------------------------------------------------- */
#masthead,
#masthead .ast-desktop-header-content,
#ast-desktop-header,
#ast-desktop-header .ast-main-header-wrap,
#ast-desktop-header .main-header-bar-wrap,
#ast-desktop-header .ast-builder-grid-row-container,
#ast-desktop-header .ast-primary-header-bar,
#ast-desktop-header .site-primary-header-wrap,
.ast-mobile-header-wrap,
.ast-mobile-header-wrap .ast-main-header-wrap,
.ast-mobile-header-wrap .main-header-bar-wrap,
.ast-mobile-header-wrap .ast-builder-grid-row-container,
.ast-mobile-header-wrap .ast-primary-header-bar,
.ast-mobile-header-wrap .site-primary-header-wrap {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Any unused Astra above-header builder row remains fully collapsed. */
#masthead .ast-above-header-wrap,
#masthead .ast-above-header-bar,
#ast-desktop-header .ast-above-header-wrap,
#ast-desktop-header .ast-above-header-bar,
.ast-mobile-header-wrap .ast-above-header-wrap,
.ast-mobile-header-wrap .ast-above-header-bar {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Primary header remains the only visible shell row. Do not alter its height. */
#ast-desktop-header .ast-primary-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
	position: relative;
	top: auto !important;
}

/* --------------------------------------------------------------------------
   02. WORDPRESS ADMIN BAR OWNERSHIP
   WordPress alone owns the logged-in top reserve. This release deliberately
   does not change html margin-top, #wpadminbar position, or admin-bar height.
   -------------------------------------------------------------------------- */
body.admin-bar #page,
body.admin-bar .site,
body.admin-bar #masthead,
body.admin-bar #ast-desktop-header,
body.admin-bar .ast-mobile-header-wrap {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* --------------------------------------------------------------------------
   03. PAGE-TO-HEADER BOUNDARY
   Prevent inherited inner-page shell spacing without moving content upward.
   This is a zero-reserve rule, not a negative-margin compensation.
   -------------------------------------------------------------------------- */
body.xg-foundation-161 #page,
body.xg-foundation-161 .site,
body.xg-foundation-161 #masthead,
body.xg-foundation-161 #ast-desktop-header,
body.xg-foundation-161 .ast-mobile-header-wrap {
	margin-block-start: 0 !important;
	padding-block-start: 0 !important;
}

/* --------------------------------------------------------------------------
   04. LIGHT-HERO SECONDARY CTA CONTRAST
   Service/About light heroes were inheriting the dark-hero ghost treatment,
   resulting in near-white text/border on a pale background. Keep dark-hero
   ghost buttons untouched and repair only light-background hero families.
   -------------------------------------------------------------------------- */
.xg-home-hero .xg-button--ghost-light,
.xg-service-hub-hero .xg-button--ghost-light,
.xg-service-detail-hero .xg-button--ghost-light,
.xg-enterprise-hero:not(.xg-enterprise-hero--audience) .xg-button--ghost-light,
.xg-contact-hero:not([class*="--dark"]) .xg-button--ghost-light {
	color: var(--xg-deep-blue) !important;
	border-color: #c9d7e5 !important;
	background: rgb(255 255 255 / 92%) !important;
	box-shadow: 0 5px 16px rgb(15 42 74 / 6%) !important;
}

.xg-home-hero .xg-button--ghost-light:hover,
.xg-home-hero .xg-button--ghost-light:focus-visible,
.xg-service-hub-hero .xg-button--ghost-light:hover,
.xg-service-hub-hero .xg-button--ghost-light:focus-visible,
.xg-service-detail-hero .xg-button--ghost-light:hover,
.xg-service-detail-hero .xg-button--ghost-light:focus-visible,
.xg-enterprise-hero:not(.xg-enterprise-hero--audience) .xg-button--ghost-light:hover,
.xg-enterprise-hero:not(.xg-enterprise-hero--audience) .xg-button--ghost-light:focus-visible,
.xg-contact-hero:not([class*="--dark"]) .xg-button--ghost-light:hover,
.xg-contact-hero:not([class*="--dark"]) .xg-button--ghost-light:focus-visible {
	color: #fff !important;
	border-color: var(--xg-deep-blue) !important;
	background: var(--xg-deep-blue) !important;
	box-shadow: 0 10px 24px rgb(10 45 132 / 18%) !important;
}

/* --------------------------------------------------------------------------
   05. MOBILE SAFETY
   Preserve the approved mobile header and mobile-economy behavior. No fixed or
   negative offsets are introduced at any viewport width.
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
	#ast-desktop-header {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
	.ast-mobile-header-wrap,
	.ast-mobile-header-wrap .ast-main-header-wrap,
	.ast-mobile-header-wrap .main-header-bar-wrap,
	.ast-mobile-header-wrap .ast-builder-grid-row-container,
	.ast-mobile-header-wrap .ast-primary-header-bar {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
}
