/* ASPO layout correction v4. Load AFTER aspo-layout-v3.css. */
:root { --aspo-main-width: 1140px; }

/* Center the page's inner content. Full-bleed backgrounds remain full width. */
body.home #content > .wrapper.cf,
body.home #content .wrapper.cf,
#footer > .wrapper.cf {
    width: min(var(--aspo-main-width), calc(100% - 40px)) !important;
    max-width: var(--aspo-main-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* Intro copy under the hero image, matching the original centered 1140px area. */
body.home #pl-11 #pg-11-1 {
    padding-top: 30px !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
}
body.home #pl-11 #pg-11-1 .widget_sow-editor,
body.home #pl-11 #pg-11-1 .siteorigin-widget-tinymce,
body.home #pl-11 #pg-11-1 .siteorigin-widget-tinymce p {
    text-align: center !important;
}
body.home #pl-11 #pg-11-1 .siteorigin-widget-tinymce p {
    max-width: 1140px;
    margin: 0 auto !important;
    line-height: 1.5;
}

/* The rows themselves can extend across the viewport for background color;
   the contents (images/text/columns) may not exceed the legacy wrapper width. */
body.home #pl-11 #pg-11-2 > .panel-row-style,
body.home #pl-11 #pg-11-3 > .panel-row-style,
body.home #pl-11 #pg-11-5 > .panel-row-style,
body.home #pl-11 #pg-11-7 > .panel-row-style {
    box-sizing: border-box !important;
    padding-left: max(20px, calc((100vw - var(--aspo-main-width)) / 2)) !important;
    padding-right: max(20px, calc((100vw - var(--aspo-main-width)) / 2)) !important;
}
/* Headings, dividers and copy should share the advantages block's inner width. */
body.home #pl-11 #pg-11-4,
body.home #pl-11 #pg-11-6 {
    width: 100% !important;
    max-width: var(--aspo-main-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}
body.home #pl-11 #pg-11-4 .widget_sow-editor,
body.home #pl-11 #pg-11-6 .widget_sow-editor,
body.home #pl-11 #pg-11-4 .so-widget-sow-headline,
body.home #pl-11 #pg-11-6 .so-widget-sow-headline {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.home #pl-11 #pg-11-4 .sow-headline-container .decoration,
body.home #pl-11 #pg-11-6 .sow-headline-container .decoration {
    max-width: 840px !important;
}
body.home #pl-11 #pg-11-7 > .panel-row-style {
    width: 100vw !important;
    max-width: none !important;
}

/* Footer: explicitly pin all four widgets to one row; avoid any legacy floats,
   auto-placement and forced grid positions left by prior patches. */
#footer > .wrapper.cf {
    display: block !important;
    float: none !important;
    clear: both !important;
}
#footer .footer-margin-left.cf {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: both !important;
    align-items: start !important;
}
#footer .footer-margin-left.cf > .footer-box {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    grid-row: 1 !important;
    box-sizing: border-box;
}
#footer .footer-margin-left.cf > .footer-box:nth-child(1) { grid-column: 1 !important; }
#footer .footer-margin-left.cf > .footer-box:nth-child(2) { grid-column: 2 !important; }
#footer .footer-margin-left.cf > .footer-box:nth-child(3) { grid-column: 3 !important; }
#footer .footer-margin-left.cf > .footer-box:nth-child(4) {
    grid-column: 4 !important;
    text-align: right !important;
}
#footer .footer-margin-left.cf > .footer-box:nth-child(4) p {
    text-align: right !important;
}
#footer .footer-margin-left.cf > .footer-box img { max-width:100%; height:auto; }

@media (max-width: 780px) {
    #footer .footer-margin-left.cf {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        row-gap: 26px !important;
    }
    #footer .footer-margin-left.cf > .footer-box:nth-child(1) { grid-column: 1 !important; grid-row: 1 !important; }
    #footer .footer-margin-left.cf > .footer-box:nth-child(2) { grid-column: 2 !important; grid-row: 1 !important; }
    #footer .footer-margin-left.cf > .footer-box:nth-child(3) { grid-column: 1 !important; grid-row: 2 !important; }
    #footer .footer-margin-left.cf > .footer-box:nth-child(4) { grid-column: 2 !important; grid-row: 2 !important; }
}
@media (max-width: 480px) {
    #footer .footer-margin-left.cf { grid-template-columns: minmax(0, 1fr) !important; }
    #footer .footer-margin-left.cf > .footer-box:nth-child(n) {
        grid-column: 1 !important;
        grid-row: auto !important;
        text-align: left !important;
    }
    #footer .footer-margin-left.cf > .footer-box:nth-child(4) p { text-align:left !important; }
}
