/**
 * Divi + Theme Builder — mega nav overlays the page (no white band above the hero).
 * Not loaded in Visual Builder (see functions.php) — these rules break the FB layout.
 */

/* Visual Builder safety net if this file is ever bundled elsewhere */
body.et_fb > .nav.hatoum-mega-nav,
body.et_fb > nav.hatoum-mega-nav {
	display: none !important;
}

body.et_fb.hatoum-mega-nav-pad #et-boc > header,
body.et_fb.hatoum-mega-nav-pad header.et-l,
body.et_fb.hatoum-mega-nav-pad .et-l--header,
body.et_fb.hatoum-mega-nav-pad #main-header {
	display: block !important;
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	margin: revert !important;
	padding: revert !important;
	overflow: visible !important;
}

/* TB header shell is empty; nav is injected on wp_body_open */
body.hatoum-mega-nav-pad:not(.et_fb) #et-boc > header,
body.hatoum-mega-nav-pad:not(.et_fb) header.et-l,
body.hatoum-mega-nav-pad:not(.et_fb) .et-l--header,
body.hatoum-mega-nav-pad:not(.et_fb) #main-header {
	display: none !important;
	height: 0 !important;
	max-height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Divi layout: do not reserve a white band on the wrapper — hero starts at the top */
body.hatoum-mega-nav-pad #page-container,
body.hatoum-mega-nav-pad #et-main-area,
body.hatoum-mega-nav-pad #et-boc,
body.hatoum-mega-nav-pad main,
body.hatoum-mega-nav-pad main#main {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.hatoum-mega-nav-pad.hatoum-has-hero-pull #page-container,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull #et-main-area,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull main,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull main#main {
	padding-top: 0 !important;
}

/* Inner pages (no full-bleed hero): pad content below the fixed pill */
body.hatoum-mega-nav-pad.hatoum-content-below-pill:not(.admin-bar) #page-container,
body.hatoum-mega-nav-pad.hatoum-content-below-pill:not(.admin-bar) #et-main-area,
body.hatoum-mega-nav-pad.hatoum-content-below-pill:not(.admin-bar) main#main {
	padding-top: calc(var(--mega-pill-top) + var(--mega-pill-stack-dynamic, 5.5rem) + var(--mega-pill-gap)) !important;
}

body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill #page-container,
body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill #et-main-area,
body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill main#main {
	padding-top: calc(32px + var(--mega-pill-top) + var(--mega-pill-stack-dynamic, 5.5rem) + var(--mega-pill-gap)) !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill #page-container,
	body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill #et-main-area,
	body.admin-bar.hatoum-mega-nav-pad.hatoum-content-below-pill main#main {
		padding-top: calc(46px + var(--mega-pill-top) + var(--mega-pill-stack-dynamic, 5.5rem) + var(--mega-pill-gap)) !important;
	}
}

/* Hero / first section: flush to top; background runs under the floating pill */
body.hatoum-mega-nav-pad.hatoum-has-hero-pull .hatoum-hero-pull-under-nav,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull #et-main-area > .et_pb_section:first-child,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull #page-container > .et_pb_section:first-child,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull #et-main-area > .et_pb_section.hatoum-hero-pull-under-nav,
body.hatoum-mega-nav-pad.hatoum-has-hero-pull #page-container > .et_pb_section.hatoum-hero-pull-under-nav {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Block-theme `main` padding from mega-nav.css must not stack on Divi */
body.hatoum-mega-nav-pad:not(.admin-bar) main,
body.hatoum-mega-nav-pad.admin-bar main,
body.hatoum-mega-nav-pad #page-container main,
body.hatoum-mega-nav-pad #et-main-area main {
	padding-top: 0 !important;
}
