/*!
 * Page Templates by SG Group — compatibility styles for the old "Fullwidth Page Templates" layouts.
 *
 * Reproduces the CSS effects of "Fullwidth Page Templates" 1.2.0 by Brainstorm Force
 * (https://www.brainstormforce.com), files assets/css/fullwidth-template.css,
 * assets/css/fullwidth-template-no-sidebar.css and assets/css/fullwidth-template-no-header-footer.css.
 * Original work Copyright (C) Brainstorm Force, licensed under the GNU General Public License v2
 * or later. Adaptation by SG Group, also licensed under the GNU General Public License v2 or later
 * (https://www.gnu.org/licenses/gpl-2.0.html).
 *
 * Adaptation: the selectors are scoped to this plugin's body classes
 * (page-templates-by-sg-group-layout-legacy-*) instead of WordPress' page-template-template-page-builder-*
 * classes, which change once a post is migrated to the new keys. Theme conditions of the old file
 * (".fpt-template-{theme}") use this plugin's theme class (page-templates-by-sg-group-theme-{theme}).
 *
 * Old scope, kept faithfully:
 * - fullwidth-template.css was loaded only for "FW Fullwidth"            → legacy-full-width only.
 * - Its ".page-template-template-page-builder(-php)" selectors matched pages only → "body.page".
 * - Its ".fpt-template" selectors matched every post type using the template.
 * - fullwidth-template-no-sidebar.css only targeted the Sparkling theme on pages.
 * - fullwidth-template-no-header-footer.css only set a white background on pages.
 * - The selectors of fullwidth-template.css for the no-sidebar / no-header-footer templates never
 *   applied (the file was not loaded on those templates) and are therefore not reproduced.
 */

/* ------------------------------------------------------------------------
 * "FW Fullwidth" → legacy-full-width
 * --------------------------------------------------------------------- */

/* Every post type (old ".fpt-template" rules) and pages only (old page-template rules). */
body.page-templates-by-sg-group-layout-legacy-full-width,
body.page-templates-by-sg-group-layout-legacy-full-width #page,
body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-evolve > #wrapper,
body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-evolve .content > .row,
body.page.page-templates-by-sg-group-layout-legacy-full-width #content,
body.page.page-templates-by-sg-group-layout-legacy-full-width .content,
body.page.page-templates-by-sg-group-layout-legacy-full-width .site-inner,
body.page.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-generatepress #page,
body.page.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-storefront #content .col-full {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Twenty Sixteen (pages only). */
body.page.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-twentysixteen #page {
	margin: 0;
}

/* Fixed body frame bars (pages only, any theme). */
body.page.page-templates-by-sg-group-layout-legacy-full-width:not(.custom-background-image)::before,
body.page.page-templates-by-sg-group-layout-legacy-full-width:not(.custom-background-image)::after {
	height: 0;
}

/* Spacious (the old selector used the theme slug "Spacious" as written). */
body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Spacious #main {
	padding: 0;
}

body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Spacious .header-post-title-container {
	display: none;
}

body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Spacious #main .inner-wrap {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Sparkling (the old selector used the theme slug "Sparkling" as written). */
body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Sparkling .container.main-content-area {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Sparkling .container.main-content-area .row {
	margin: 0;
}

body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-Sparkling .container.main-content-area .main-content-inner {
	float: none;
	width: 100%;
	padding: 0;
}

/* Storefront. */
body.page-templates-by-sg-group-layout-legacy-full-width.page-templates-by-sg-group-theme-storefront.no-wc-breadcrumb .site-header {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------------
 * "FW No Sidebar" → legacy-no-sidebar (Sparkling, pages only)
 * --------------------------------------------------------------------- */

body.page.page-templates-by-sg-group-layout-legacy-no-sidebar .side-pull-left .main-content-inner {
	width: 100%;
	float: none;
}

/* ------------------------------------------------------------------------
 * "FW Fullwidth No Header Footer" → legacy-blank (pages only)
 * Same specificity as the old single-class selector, so a custom background still wins as before.
 * --------------------------------------------------------------------- */

:where(body.page).page-templates-by-sg-group-layout-legacy-blank {
	background: white;
}
