/**
 * Full-Width Homepage Fix
 * Makes LMCE homepage truly edge-to-edge
 */

/* FORCE remove all horizontal padding and margins */
body.page-template-page-no-title,
body.page-template-page-no-title .wp-site-blocks,
body.page-template-page-no-title main,
body.page-template-page-no-title .wp-block-group {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Remove top/bottom padding from main only */
body.page-template-page-no-title main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Override WordPress default padding variables */
body.page-template-page-no-title {
    --wp--style--root--padding-left: 0px !important;
    --wp--style--root--padding-right: 0px !important;
    --wp--preset--spacing--50: 0px !important;
}

/* Force full-width on ALL blocks marked as alignfull */
body.page-template-page-no-title .alignfull,
body.page-template-page-no-title .wp-block-group.alignfull,
body.page-template-page-no-title .wp-block-cover.alignfull {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove global padding class effects */
body.page-template-page-no-title .has-global-padding,
body.page-template-page-no-title .has-global-padding > .wp-block-group,
body.page-template-page-no-title .has-global-padding > * {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Ensure constrained blocks inside full-width sections work correctly */
body.page-template-page-no-title .alignfull > .wp-block-group.alignwide,
body.page-template-page-no-title .alignfull .has-layout-constrained {
    max-width: var(--wp--style--global--wide-size, 1400px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--wp--preset--spacing--50, 1.5rem);
    padding-right: var(--wp--preset--spacing--50, 1.5rem);
}

/* Override theme.json spacing */
body.page-template-page-no-title .wp-block-group.alignfull > .wp-block-group {
    padding-left: 0;
    padding-right: 0;
}

/* Ensure sections with background colors extend fully */
body.page-template-page-no-title .alignfull.has-background {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove border radius from full-width elements */
body.page-template-page-no-title .alignfull {
    border-radius: 0 !important;
}

/* Make absolutely sure cover blocks are edge-to-edge */
body.page-template-page-no-title .wp-block-cover {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* Fix for nested groups inside alignfull */
body.page-template-page-no-title .alignfull .wp-block-group.alignwide {
    margin-left: auto !important;
    margin-right: auto !important;
}
