/*
 * Situ Blocks v0.12.0 — Page Profile shell adapter.
 *
 * Principle: do not recreate the theme and do not patch WordPress/Gutenberg.
 * On the Situ Framework theme, the mature CC07 shell classes own Header,
 * Footer, Overlay and responsive behavior. This file only bridges Gutenberg.
 */

body.situ-blocks-page-profile{overflow-x:clip}
@supports not (overflow:clip){body.situ-blocks-page-profile{overflow-x:hidden}}

/* Native Gutenberg page content inside the CC07 composer shell. */
body.situ-blocks-gutenberg-shell .situ-page-builder-main,
body.situ-blocks-gutenberg-shell .situ-managed-page,
body.situ-blocks-gutenberg-shell .situ-blocks-managed-page{
  display:block;
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
body.situ-blocks-gutenberg-shell .situ-blocks-managed-page>:first-child{margin-top:0}
body.situ-blocks-gutenberg-shell .situ-blocks-managed-page>:last-child{margin-bottom:0}

/* Hero Page starts with the Hero itself. */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero .wp-block-situ-hero:first-child{
  margin-top:0!important;
}

/* Full-bleed Gutenberg blocks must not inherit a classic content width. */
body.situ-blocks-gutenberg-shell .wp-block-situ-hero,
body.situ-blocks-gutenberg-shell .alignfull{
  max-width:none;
}


/* Hide article-only sharing/chrome on a landing page if a plugin injects it. */
body.situ-blocks-gutenberg-shell .addtoany_share_save_container,
body.situ-blocks-gutenberg-shell .a2a_floating_style,
body.situ-blocks-gutenberg-shell .post-share,
body.situ-blocks-gutenberg-shell .author-description,
body.situ-blocks-gutenberg-shell .related-posts,
body.situ-blocks-gutenberg-shell .single-navigation,
body.situ-blocks-gutenberg-shell .entry-comments,
body.situ-blocks-gutenberg-shell .post-meta,
body.situ-blocks-gutenberg-shell .post-footer{display:none!important}


/* =========================================================
 * v0.12.1 — CC07 Overlay Header parity
 *
 * DevTools confirmed the pale "gap" is the actual .situ-header row
 * (it contains the Situ logo and hamburger). On Hero Page + Overlay,
 * that header must be transparent and sit on top of the first Hero,
 * exactly like the legacy /situ-page/hero-index/ page.
 *
 * Scoped only to Situ Blocks Hero Page. WordPress/Gutenberg/theme
 * source files are untouched.
 * ======================================================= */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
	position:absolute !important;
	top:0 !important;
	left:0 !important;
	right:0 !important;
	width:100% !important;
	margin:0 !important;
	padding:0 !important;
	z-index:1000 !important;
	background:transparent !important;
	background-color:transparent !important;
	background-image:none !important;
	border:0 !important;
	box-shadow:none !important;
	backdrop-filter:none !important;
	-webkit-backdrop-filter:none !important;
}

/* Some legacy/theme rules paint the inner row instead of the header. */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header > .situ-header-inner{
	background:transparent !important;
	background-color:transparent !important;
	background-image:none !important;
	border:0 !important;
	box-shadow:none !important;
}

/* Hero begins at the same visual origin; Header overlays it. */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay #situ-page-builder-main,
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay #situ-page-builder-main > .situ-blocks-managed-page,
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay #situ-page-builder-main .wp-block-situ-hero:first-child{
	margin-top:0 !important;
	padding-top:0 !important;
}

/* Logged-in WordPress admin bar remains owned by WordPress.
 * Only offset the overlay header below the real toolbar.
 */
body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
	top:32px !important;
}
@media (max-width:782px){
	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
		top:46px !important;
	}
}


/* =========================================================
 * v0.12.2 — ROOT GAP FIX
 * DevTools element picker selected <html> when clicking the pale
 * strip above the WordPress toolbar. The strip is therefore root
 * reserved space, not Gutenberg/Theme/Header content.
 * Scoped only to logged-in Situ Hero Page shells.
 * ======================================================= */
html:has(body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero){
    margin-top:0 !important;
    padding-top:0 !important;
}
body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #wpadminbar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
}
body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
    top:32px !important;
}
@media (max-width:782px){
    body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
        top:46px !important;
    }
}


/* =========================================================
 * v0.12.3 — mobile/admin-bar residual gap normalization
 *
 * Desktop v0.12.2 proves the root reservation is the cause.
 * Mobile WordPress can additionally leave body/main top offsets,
 * especially around the 782px admin-bar breakpoint.
 *
 * Scope remains ONLY:
 * logged-in + Situ Gutenberg shell + Hero Page.
 * ======================================================= */
html:has(body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero),
html:has(body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero) body{
	margin-top:0 !important;
	padding-top:0 !important;
}

body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero{
	margin-top:0 !important;
	padding-top:0 !important;
}

body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #wpadminbar{
	position:fixed !important;
	top:0 !important;
	left:0 !important;
	right:0 !important;
	margin:0 !important;
}

body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main,
body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main > .situ-managed-page,
body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main > .situ-blocks-managed-page{
	margin-top:0 !important;
	padding-top:0 !important;
}

@media (max-width:782px){
	html:has(body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero),
	html:has(body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero) body,
	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero{
		margin-top:0 !important;
		padding-top:0 !important;
	}

	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay > header.situ-header{
		top:46px !important;
	}

	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main,
	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main > .situ-managed-page,
	body.admin-bar.situ-blocks-gutenberg-shell.situ-page-mode-hero #situ-page-builder-main .wp-block-situ-hero:first-child{
		margin-top:0 !important;
		padding-top:0 !important;
	}
}

/* Front-end visitors who are logged OUT have no admin-bar reservation. */
body:not(.admin-bar).situ-blocks-gutenberg-shell.situ-page-mode-hero{
	margin-top:0 !important;
	padding-top:0 !important;
}


/* =========================================================
 * v0.12.4 — Hamburger mode: remove desktop nav strip
 *
 * Latest front-end screenshot proves the remaining pale band
 * contains the full desktop navigation links. This is not
 * whitespace: .situ-nav is still being rendered as a horizontal
 * row while Page Profile is set to Hamburger mode.
 * ======================================================= */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header .situ-nav{
	display:none !important;
	position:absolute !important;
	top:calc(100% + 8px) !important;
	right:24px !important;
	left:auto !important;
	width:min(360px, calc(100vw - 48px)) !important;
	max-width:calc(100vw - 48px) !important;
	margin:0 !important;
	padding:18px 20px !important;
	flex-direction:column !important;
	align-items:stretch !important;
	background:rgba(20,28,36,.92) !important;
	border-radius:18px !important;
	box-shadow:0 18px 48px rgba(0,0,0,.28) !important;
	backdrop-filter:blur(12px) !important;
	-webkit-backdrop-filter:blur(12px) !important;
	z-index:1200 !important;
}

body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header .situ-mobile-btn{
	display:inline-flex !important;
}

body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header .situ-mobile-toggle:checked ~ .situ-nav{
	display:flex !important;
}

/* Header must never reserve an extra line for desktop nav in hamburger mode. */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header,
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header-inner{
	min-height:0 !important;
	height:auto !important;
}

/* Keep the actual overlay header row transparent and compact. */
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay.situ-page-header-menu-hamburger > header.situ-header,
body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay.situ-page-header-menu-hamburger > header.situ-header > .situ-header-inner{
	background:transparent !important;
	border:0 !important;
	box-shadow:none !important;
}

body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-header-layout-overlay.situ-page-header-menu-hamburger > header.situ-header > .situ-header-inner{
	display:flex !important;
	flex-direction:row !important;
	align-items:center !important;
	justify-content:space-between !important;
	flex-wrap:nowrap !important;
}

/* Mobile: menu is overlay panel, never a document-flow white block. */
@media (max-width:782px){
	body.situ-blocks-gutenberg-shell.situ-page-mode-hero.situ-page-header-menu-hamburger .situ-header .situ-nav{
		right:16px !important;
		width:calc(100vw - 32px) !important;
		max-width:calc(100vw - 32px) !important;
	}
}


/* v0.12.6 — Azure News Page Profile Footer OFF compatibility.
 * Azure's footer.php always emits #colophon even when both native footer
 * areas are disabled. Collapse only that empty theme-owned wrapper when
 * this page explicitly requests Footer OFF. */
body.wp-theme-azure-news.situ-blocks-page-profile.situ-blocks-hide-footer #colophon.site-footer,
body.wp-child-theme-azure-newspaper.situ-blocks-page-profile.situ-blocks-hide-footer #colophon.site-footer{
	display:none!important;
}
