/**
 * Frankpress Builder frontend shell.
 */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body.fpb-document {
	margin: 0;
	padding: 0;
	min-width: 320px;
}

.fpb-document-root,
.fpb-page-content,
.fpb-global-region,
.fpb-block,
.fpb-html-widget,
.fpb-shortcode-widget {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.fpb-page-content {
	display: block;
	min-height: 1px;
}

.fpb-global-header,
.fpb-global-footer {
	position: relative;
	z-index: 10;
}

body.fpb-global-part-preview .fpb-page-content:empty::before {
	content: "Área global vacía";
	display: grid;
	place-items: center;
	min-height: 220px;
	padding: 24px;
	font: 600 16px/1.5 Montserrat, Arial, sans-serif;
	color: #667085;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
}

/* Keep short pages visually complete: header at the top, footer at the bottom. */
body.fpb-document {
	min-height: 100vh;
	min-height: 100dvh;
}

.fpb-document-root {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.fpb-page-content {
	flex: 1 0 auto;
}

.fpb-global-header,
.fpb-global-footer {
	flex: 0 0 auto;
}

.fpb-global-footer {
	margin-top: auto;
}

/* Header behavior is controlled per global header template. */
.fpb-global-header.is-sticky {
	position: sticky;
	top: 0;
	z-index: 1000;
}


.fpb-global-header.is-sticky.has-sticky-background {
	transition: background-color .22s ease;
}

.fpb-global-header.is-sticky.has-sticky-background.is-scrolled {
	background-color: var(--fpb-sticky-background);
}

@media (prefers-reduced-motion: reduce) {
	.fpb-global-header.is-sticky.has-sticky-background { transition: none; }
}

/* WordPress adds the admin bar above the public page. */
@media (min-width: 783px) {
	body.admin-bar.fpb-document .fpb-document-root {
		min-height: calc(100vh - 32px);
		min-height: calc(100dvh - 32px);
	}

	body.admin-bar .fpb-global-header.is-sticky {
		top: 32px;
	}
}

@media (min-width: 601px) and (max-width: 782px) {
	body.admin-bar.fpb-document .fpb-document-root {
		min-height: calc(100vh - 46px);
		min-height: calc(100dvh - 46px);
	}

	body.admin-bar .fpb-global-header.is-sticky {
		top: 46px;
	}
}

/* Frankpress Base pages that use global parts but not the standalone template. */
body.fpb-global-parts-active:not(.fpb-document) {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

body.fpb-global-parts-active:not(.fpb-document) > main#primary,
body.fpb-global-parts-active:not(.fpb-document) > .fp-site-main {
	flex: 1 0 auto;
}

body.fpb-global-parts-active:not(.fpb-document) > .fpb-global-footer {
	margin-top: auto;
}

@media (min-width: 783px) {
	body.admin-bar.fpb-global-parts-active:not(.fpb-document) {
		min-height: calc(100vh - 32px);
		min-height: calc(100dvh - 32px);
	}
}

@media (min-width: 601px) and (max-width: 782px) {
	body.admin-bar.fpb-global-parts-active:not(.fpb-document) {
		min-height: calc(100vh - 46px);
		min-height: calc(100dvh - 46px);
	}
}

/* Native page titles are hidden by default and can be enabled per page. */
body.fpb-hide-page-title .fp-entry-title,
body.fpb-hide-page-title h1.entry-title,
body.fpb-hide-page-title h1.page-title,
body.fpb-hide-page-title .wp-block-post-title {
	display: none !important;
}

/*
 * Responsive content overlap for transparent headers.
 * Positive values in the editor move the first page content upward without
 * changing the hero's internal height or forcing one value on every device.
 */
body.fpb-has-content-offset .fpb-page-content,
body.fpb-has-content-offset main#primary.fp-site-main,
body.fpb-has-content-offset main#primary.site-main,
body.fpb-has-content-offset #primary.site-main {
	position: relative;
	z-index: 1;
	margin-top: calc(-1 * var(--fpb-page-offset-desktop, 0px)) !important;
}

@media (max-width: 1024px) {
	body.fpb-has-content-offset .fpb-page-content,
	body.fpb-has-content-offset main#primary.fp-site-main,
	body.fpb-has-content-offset main#primary.site-main,
	body.fpb-has-content-offset #primary.site-main {
		margin-top: calc(-1 * var(--fpb-page-offset-tablet, 0px)) !important;
	}
}

@media (max-width: 767px) {
	body.fpb-has-content-offset .fpb-page-content,
	body.fpb-has-content-offset main#primary.fp-site-main,
	body.fpb-has-content-offset main#primary.site-main,
	body.fpb-has-content-offset #primary.site-main {
		margin-top: calc(-1 * var(--fpb-page-offset-mobile, 0px)) !important;
	}
}

/* Visual editing cues are restricted to the authenticated iframe preview. */
body.fpb-editor-preview [data-fpb-block] {
	position: relative;
	min-height: 1px;
	cursor: pointer !important;
	outline: 1px solid transparent !important;
	outline-offset: -1px;
}

body.fpb-editor-preview [data-fpb-block]:hover {
	outline-color: #2563eb !important;
}

/*
 * Theme shell layout.
 * The active WordPress theme owns header/footer; Frankpress owns only the
 * content between them. Do not force the builder content itself to fill the
 * viewport, otherwise short pages create an artificial gap before the theme
 * footer.
 */
body.fpb-layout-theme .fpb-theme-document-root,
body.fpb-layout-theme .fpb-document-root {
	display: block;
	min-height: 0 !important;
	height: auto;
}

body.fpb-layout-theme .fpb-theme-page-content,
body.fpb-layout-theme .fpb-page-content {
	display: block;
	flex: none;
	min-height: 1px;
}

/* The theme header/footer remain outside the Frankpress document root. */
body.fpb-layout-theme .fpb-theme-document-root {
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: none;
}
