/* Hide theme header/footer when YouMind global templates are active (TT5 + classic). */

body.ymct-has-custom-header .site-header,
body.ymct-has-custom-header header#masthead,
body.ymct-has-custom-header .mindscale-theme-header-builder,
body.ymct-has-custom-header .mindscale-default-header,
body.ymct-has-custom-header .wp-block-template-part[data-area="header"],
body.ymct-has-custom-header header.wp-block-template-part,
body.ymct-has-custom-header .wp-site-blocks > header,
body.ymct-has-custom-header .wp-site-blocks > .wp-block-template-part:first-child {
	display: none !important;
}

body.ymct-has-custom-footer .site-footer,
body.ymct-has-custom-footer footer#colophon,
body.ymct-has-custom-footer .mindscale-default-footer,
body.ymct-has-custom-footer .wp-block-template-part[data-area="footer"],
body.ymct-has-custom-footer footer.wp-block-template-part,
body.ymct-has-custom-footer .wp-site-blocks > footer,
body.ymct-has-custom-footer .wp-site-blocks > footer.wp-block-group,
body.ymct-has-custom-footer .wp-site-blocks > .wp-block-template-part:last-child {
	display: none !important;
}

/* Twenty Twenty-Five often wraps chrome in groups — hide by position when marked */
body.ymct-has-custom-header.ymct-has-custom-footer .wp-site-blocks > header,
body.ymct-has-custom-footer .wp-site-blocks > footer {
	display: none !important;
}

.ymct-site-header,
.ymct-site-footer {
	width: 100%;
	position: relative;
	z-index: 50;
}

.ymct-site-footer {
	z-index: 10;
}

/* Classic MindScale single/archive: keep content clear of the floating header */
body.ymct-has-custom-header .mindscale-single,
body.ymct-has-custom-header .mindscale-archive,
body.ymct-has-custom-header .mindscale-page,
body.ymct-has-custom-header .mindscale-search-results {
	padding-top: 32px;
}

body.ymct-has-custom-header .ymct-site-header + .mindscale-site .mindscale-site-content,
body.ymct-has-custom-header .mindscale-site-content {
	position: relative;
	z-index: 1;
}

/*
 * Mint must paint html + body so there is no white strip under the WP admin bar
 * (html{margin-top:32px}) and so theme body{background-color:var(--base)} cannot win.
 */
html:has(body.ymct-has-hero),
body.ymct-has-hero {
	background-color: #cafdf9 !important;
	background-image: none !important;
}

html:has(body.ymct-has-post-hero),
html:has(body:has(.ymct-post-hero--under-header)),
body.ymct-has-post-hero,
body:has(.ymct-post-hero--under-header) {
	background-color: #cafdf9 !important;
	background-image: none !important;
}

/* Header chrome floats on mint — never a solid white band */
body.ymct-has-hero .ymct-site-header,
body.ymct-has-hero .ymct-header,
body.ymct-has-post-hero .ymct-site-header,
body.ymct-has-post-hero .ymct-header,
body:has(.ymct-post-hero--under-header) .ymct-site-header,
body:has(.ymct-post-hero--under-header) .ymct-header,
body:has(.ymct-hero--under-header) .ymct-site-header,
body:has(.ymct-hero--under-header) .ymct-header {
	background: transparent !important;
	box-shadow: none !important;
}

body.ymct-has-hero .wp-site-blocks,
body.ymct-has-post-hero .wp-site-blocks,
body:has(.ymct-post-hero--under-header) .wp-site-blocks,
body:has(.ymct-hero--under-header) .wp-site-blocks {
	background: transparent !important;
}

/* Empty blocks left in header templates create a white strip */
.ymct-site-header > p:empty,
.ymct-site-header > .wp-block-paragraph:empty,
.ymct-site-header > .wp-block-paragraph:not(:has(*)):not(:has(img)) {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}

@media (max-width: 768px) {
	html:has(body.ymct-has-hero),
	body.ymct-has-hero {
		background-color: #ffffff !important;
	}
}
