/*
 * GDwB Header Page Fix
 *
 * Applies ONLY to:
 * - Home
 * - About Brad
 * - Personal Styling
 * - Media
 *
 * It deliberately does not target WooCommerce product/cart/checkout pages.
 */

/* =========================================================
   1. STOP THE KADENCE HEADER FROM SITTING UNDER/OVER HEROES
   ========================================================= */

body.gdwb-header-overlap-fix #masthead,
body.gdwb-header-overlap-fix .site-header,
body.gdwb-header-overlap-fix .site-main-header-wrap,
body.gdwb-header-overlap-fix .site-main-header-inner-wrap {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;

	z-index: 100000 !important;

	transform: none !important;
}

/*
 * Kadence transparent-header layouts can position the header absolutely
 * over the first image/hero. On these four pages we want a normal header.
 */
body.gdwb-header-overlap-fix.transparent-header #masthead,
body.gdwb-header-overlap-fix.has-transparent-header #masthead,
body.gdwb-header-overlap-fix .transparent-header #masthead,
body.gdwb-header-overlap-fix #masthead.site-header {
	position: relative !important;
}

/* =========================================================
   2. GIVE THE MENU ITS OWN SOLID LAYER
   ========================================================= */

body.gdwb-header-overlap-fix #masthead,
body.gdwb-header-overlap-fix .site-header,
body.gdwb-header-overlap-fix .site-main-header-wrap,
body.gdwb-header-overlap-fix .site-main-header-inner-wrap,
body.gdwb-header-overlap-fix .site-header-row-container-inner {
	background: #ffffff !important;
	background-image: none !important;
}

/* Ensure header/menu elements remain visually above page imagery */
body.gdwb-header-overlap-fix #masthead *,
body.gdwb-header-overlap-fix .site-header * {
	position: relative;
	z-index: 2;
}

/* =========================================================
   3. PREVENT PAGE CONTENT / BLUE HERO FROM ENTERING HEADER
   ========================================================= */

body.gdwb-header-overlap-fix #inner-wrap,
body.gdwb-header-overlap-fix #primary,
body.gdwb-header-overlap-fix main#main,
body.gdwb-header-overlap-fix .content-area,
body.gdwb-header-overlap-fix .site-main {
	position: relative !important;
	z-index: 1 !important;

	clear: both !important;

	margin-top: 0 !important;
}

/*
 * Remove negative offsets commonly used with transparent headers.
 * Do NOT remove the page's intended hero/content itself.
 */
body.gdwb-header-overlap-fix #inner-wrap,
body.gdwb-header-overlap-fix .content-container,
body.gdwb-header-overlap-fix .entry-content-wrap,
body.gdwb-header-overlap-fix .site-container {
	top: auto !important;
	transform: none !important;
}

/* =========================================================
   4. PAGE TITLE / BLUE HERO MUST STAY BELOW THE HEADER
   ========================================================= */

body.gdwb-header-overlap-fix .entry-hero-container,
body.gdwb-header-overlap-fix .entry-hero,
body.gdwb-header-overlap-fix .page-header,
body.gdwb-header-overlap-fix .hero-section,
body.gdwb-header-overlap-fix .content-title-style-above {
	position: relative !important;

	top: auto !important;

	z-index: 1 !important;

	margin-top: 0 !important;
}

/* =========================================================
   5. NAVIGATION SAFETY
   ========================================================= */

body.gdwb-header-overlap-fix .main-navigation,
body.gdwb-header-overlap-fix .primary-menu-container,
body.gdwb-header-overlap-fix .site-header-section,
body.gdwb-header-overlap-fix .header-navigation {
	position: relative !important;
	z-index: 100001 !important;
}

/* Dropdowns must always appear above page images */
body.gdwb-header-overlap-fix .main-navigation ul ul,
body.gdwb-header-overlap-fix .header-menu-container ul ul,
body.gdwb-header-overlap-fix .sub-menu {
	z-index: 100002 !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1024px) {
	body.gdwb-header-overlap-fix #masthead,
	body.gdwb-header-overlap-fix .site-header {
		position: relative !important;
		width: 100% !important;
	}

	body.gdwb-header-overlap-fix .mobile-navigation,
	body.gdwb-header-overlap-fix .drawer-inner,
	body.gdwb-header-overlap-fix .popup-drawer {
		z-index: 100003 !important;
	}
}


/* =========================================================
   v1.0.1 — REMOVE EMPTY BLUE HERO BOX
   PERSONAL STYLING + MEDIA ONLY
   ========================================================= */

/*
 * These two pages have an empty Kadence page-title/hero region
 * directly below the navigation. Remove the whole container,
 * including its reserved height and background.
 */

body.page-personal-styling .entry-hero-container,
body.page-personal-styling .entry-hero,
body.page-personal-styling .entry-hero-container-inner,
body.page-personal-styling .page-header,
body.page-personal-styling .hero-section,
body.page-personal-styling .content-title-style-above,

body.page-media .entry-hero-container,
body.page-media .entry-hero,
body.page-media .entry-hero-container-inner,
body.page-media .page-header,
body.page-media .hero-section,
body.page-media .content-title-style-above {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

/* Remove any gap left behind by the hidden hero. */
body.page-personal-styling #inner-wrap,
body.page-personal-styling #primary,
body.page-personal-styling main#main,
body.page-media #inner-wrap,
body.page-media #primary,
body.page-media main#main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}


/* =========================================================
   v1.0.2 — EXPLICIT EMPTY HERO REMOVAL
   PERSONAL STYLING + MEDIA
   ========================================================= */

/*
 * PHP adds .gdwb-remove-empty-page-hero directly to the body on
 * Personal Styling and Media. This avoids depending on guessed
 * WordPress page-slug body classes.
 */

body.gdwb-remove-empty-page-hero .entry-hero-container,
body.gdwb-remove-empty-page-hero .entry-hero,
body.gdwb-remove-empty-page-hero .entry-hero-container-inner,
body.gdwb-remove-empty-page-hero .page-header,
body.gdwb-remove-empty-page-hero .page-title,
body.gdwb-remove-empty-page-hero .hero-section,
body.gdwb-remove-empty-page-hero .kadence-page-title,
body.gdwb-remove-empty-page-hero .content-title-style-above,
body.gdwb-remove-empty-page-hero .page-title-wrap,
body.gdwb-remove-empty-page-hero .entry-header {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	background-image: none !important;
}

/*
 * Kadence commonly uses an outer title container immediately
 * before #primary. Remove any empty title container there too.
 */
body.gdwb-remove-empty-page-hero #inner-wrap > .entry-hero-container,
body.gdwb-remove-empty-page-hero #inner-wrap > .page-header,
body.gdwb-remove-empty-page-hero #inner-wrap > .page-title {
	display: none !important;
}

/* Pull actual page content directly underneath the navigation. */
body.gdwb-remove-empty-page-hero #inner-wrap,
body.gdwb-remove-empty-page-hero #primary,
body.gdwb-remove-empty-page-hero main#main,
body.gdwb-remove-empty-page-hero .content-area,
body.gdwb-remove-empty-page-hero .site-main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}
