/**
 * Bhairav Page / Post Generator
 * Frontend Content Layout
 *
 * Bhairav AMS Presentation System
 *
 * Controls:
 * - Overall page width
 * - Page gutters
 * - Main content / sidebar proportions
 * - Column spacing
 * - Sidebar position
 * - Responsive stacking
 */


/* =========================================================
   PPG CONTENT LAYOUT
========================================================= */

.bams-ppg-layout {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;

    padding: 36px 32px 0;

    box-sizing: border-box;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr);

    align-items: start;

    min-width: 0;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.bams-ppg-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}


/* =========================================================
   SIDEBAR COLUMN
========================================================= */

.bams-ppg-sidebar-column {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}


/* =========================================================
   THEME DEFAULT WIDTH
========================================================= */

.bams-ppg-width-theme_default {
    width: 100%;
    max-width: 1400px;

    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   FLUID BOXED
========================================================= */

.bams-ppg-width-fluid_boxed {
    width: 100%;
    max-width: 1400px;

    margin-left: auto;
    margin-right: auto;

    padding-left: 32px;
    padding-right: 32px;

    box-sizing: border-box;
}


/* =========================================================
   CONTAINED
========================================================= */

.bams-ppg-width-contained {
    width: 100%;
    max-width: 1200px;

    margin-left: auto;
    margin-right: auto;

    padding-left: 32px;
    padding-right: 32px;

    box-sizing: border-box;
}


/* =========================================================
   FULL WIDTH
========================================================= */

.bams-ppg-width-full_width {
    width: 100%;
    max-width: none;

    margin-left: auto;
    margin-right: auto;

    padding-left: 32px;
    padding-right: 32px;

    box-sizing: border-box;
}


/* =========================================================
   RIGHT SIDEBAR
========================================================= */

.bams-ppg-has-sidebar.bams-ppg-sidebar-right {

    grid-template-columns:
        minmax(0, 72%)
        minmax(0, 28%);

    column-gap: 48px;
}


/* =========================================================
   LEFT SIDEBAR
========================================================= */

.bams-ppg-has-sidebar.bams-ppg-sidebar-left {

    grid-template-columns:
        minmax(0, 28%)
        minmax(0, 72%);

    column-gap: 48px;
}


/* =========================================================
   SIDEBAR — RIGHT
========================================================= */

.bams-ppg-sidebar-right
.bams-ppg-sidebar-column {

    padding-left: 32px;

    border-left: 1px solid #cbd9e6;

    box-sizing: border-box;
}


/* =========================================================
   SIDEBAR — LEFT
========================================================= */

.bams-ppg-sidebar-left
.bams-ppg-sidebar-column {

    padding-right: 32px;

    border-right: 1px solid #cbd9e6;

    box-sizing: border-box;
}


/* =========================================================
   FULL WIDTH CONTENT
========================================================= */

.bams-ppg-layout:not(.bams-ppg-has-sidebar)
.bams-ppg-main {

    grid-column: 1 / -1;
}


/* =========================================================
   SIDEBAR WIDTH SAFETY
========================================================= */

.bams-ppg-sidebar-column > * {

    width: 100%;
    max-width: 100%;
}


/* =========================================================
   CONTENT WIDTH SAFETY
========================================================= */

.bams-ppg-main > * {

    max-width: 100%;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .bams-ppg-layout {

        max-width: 100%;

        padding-left: 24px;
        padding-right: 24px;
    }


    .bams-ppg-has-sidebar.bams-ppg-sidebar-right,
    .bams-ppg-has-sidebar.bams-ppg-sidebar-left {

        grid-template-columns:
            minmax(0, 1fr);

        row-gap: 36px;
    }


    .bams-ppg-sidebar-right
    .bams-ppg-sidebar-column,
    .bams-ppg-sidebar-left
    .bams-ppg-sidebar-column {

        padding-left: 0;
        padding-right: 0;

        border-left: 0;
        border-right: 0;
    }


    .bams-ppg-main,
    .bams-ppg-sidebar-column {

        grid-column: 1;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .bams-ppg-layout {

        width: 100%;
        max-width: 100%;

        padding: 24px 16px 0;
    }


    .bams-ppg-width-fluid_boxed,
    .bams-ppg-width-contained,
    .bams-ppg-width-full_width {

        padding-left: 16px;
        padding-right: 16px;
    }


    .bams-ppg-has-sidebar.bams-ppg-sidebar-right,
    .bams-ppg-has-sidebar.bams-ppg-sidebar-left {

        row-gap: 28px;
    }
}