/* Only pages using the independent template are affected. */
body.ufw-layout-active .ufw-main,
body.ufw-layout-active .ufw-article,
body.ufw-layout-active .ufw-content {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Center the full-bleed main in BOTH RTL and LTR themes.
   Logical negative margins avoid the RTL half-screen shift caused by
   left:50% + margin-left:-50vw.  No transform or fixed positioning. */
body.ufw-layout-active .ufw-main {
    position: relative;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100vw !important;
    max-width: none !important;
    margin-inline: calc(50% - 50vw) !important;
}

/* The ABF calendar already implements its own 100vw breakout.
   Inside this full-bleed template that second breakout must be neutralized,
   or the entire calendar moves one half-viewport sideways. */
body.ufw-layout-active .ufw-main .abf-events-archive--full {
    position: relative;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    transform: none !important;
}

body.ufw-layout-active .ufw-main .alignfull,
body.ufw-layout-active .ufw-main .wp-block-group.alignfull {
    max-width: none;
}

/* Posts retain a readable title area, even when their content is edge-to-edge. */
body.ufw-layout-active .ufw-post-header,
body.ufw-layout-active .ufw-comments {
    width: min(92%, 1160px);
    margin: 32px auto;
}

body.ufw-layout-active .ufw-post-header h1 {
    margin: 0;
    line-height: 1.4;
}

body.ufw-layout-active .ufw-page-links {
    margin: 20px auto;
    padding: 0 24px;
    text-align: center;
}

@media (max-width: 767px) {
    body.ufw-layout-active .ufw-post-header,
    body.ufw-layout-active .ufw-comments {
        width: 94%;
    }
}
