/*
Theme Name: IronMassLite Left Sidebar Child
Template: ironmasslite
Version: 1.1.0
Description: Adds a site-wide 250px left widget sidebar and right-hand content layout for IronMassLite.
*/

/* Site-wide layout for templates that render #primary and the theme sidebar. */
#content .row:has(> #primary):has(> #secondary) {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 30px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#content .row > #secondary.site-wide-left-sidebar,
#content .row > #secondary.widget-area {
    order: 1 !important;
    display: block !important;
    flex: 0 0 250px !important;
    width: 250px !important;
    max-width: 250px !important;
    min-width: 250px !important;
    box-sizing: border-box !important;
    float: none !important;
}

#content .row > #primary {
    order: 2 !important;
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

#content #primary .site-main,
#content #primary .entry-content {
    width: 100% !important;
    max-width: 800px !important;
    box-sizing: border-box !important;
}

#content #primary img,
#content #primary video,
#content #primary iframe,
#content #primary embed {
    max-width: 100%;
}

#content #secondary .widget {
    max-width: 100%;
    overflow-wrap: anywhere;
    margin-bottom: 24px;
}

/* Dedicated template from the earlier child-theme version. */
.page-template-template-left-sidebar-800 .left-sidebar-800-layout {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
}
.page-template-template-left-sidebar-800 .left-sidebar-800-widgets {
    flex: 0 0 250px;
    width: 250px;
    min-width: 250px;
    box-sizing: border-box;
}
.page-template-template-left-sidebar-800 .left-sidebar-800-main {
    flex: 1 1 0;
    width: 100%;
    max-width: 800px;
    min-width: 0;
    box-sizing: border-box;
}
.page-template-template-left-sidebar-800 .left-sidebar-800-main img,
.page-template-template-left-sidebar-800 .left-sidebar-800-main video,
.page-template-template-left-sidebar-800 .left-sidebar-800-main iframe {
    max-width: 100%;
}
.page-template-template-left-sidebar-800 .left-sidebar-800-widgets .widget {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    #content .row:has(> #primary):has(> #secondary) {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
    }
    #content .row > #secondary.site-wide-left-sidebar,
    #content .row > #secondary.widget-area {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        order: 1 !important;
    }
    #content .row > #primary {
        width: 100% !important;
        max-width: 100% !important;
        order: 2 !important;
    }
    #content #primary .site-main,
    #content #primary .entry-content {
        max-width: 100% !important;
    }
    .page-template-template-left-sidebar-800 .left-sidebar-800-layout {
        display: block;
    }
    .page-template-template-left-sidebar-800 .left-sidebar-800-widgets {
        width: 100%;
        min-width: 0;
        margin-bottom: 24px;
    }
    .page-template-template-left-sidebar-800 .left-sidebar-800-main {
        max-width: 100%;
    }
}
