/**
 * 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: 0 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, 72fr)
        minmax(270px, 28fr);

    column-gap: 8px;
}


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

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

    grid-template-columns:
        minmax(270px, 28fr)
        minmax(0, 72fr);

    column-gap: 8px;
}


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

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

    position: relative;
    padding-left: 10px;
    border-left: 0;
    box-sizing: border-box;
}


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

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

    position: relative;
    padding-right: 10px;
    border-right: 0;
    box-sizing: border-box;
}


/* =========================================================
   CONTENT / SIDEBAR ENGINEERING DIVIDER
========================================================= */
.bams-ppg-sidebar-right .bams-ppg-sidebar-column::before,
.bams-ppg-sidebar-left .bams-ppg-sidebar-column::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(180,135,45,.78) 0 8px,
        transparent 8px 16px
    );
    pointer-events: none;
}
.bams-ppg-sidebar-right .bams-ppg-sidebar-column::after,
.bams-ppg-sidebar-left .bams-ppg-sidebar-column::after {
    content: "✦";
    position: absolute;
    top: 48px;
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    color: #b4872d;
    background: #fff;
    border: 1px solid rgba(180,135,45,.55);
    border-radius: 50%;
    font-size: 9px;
    line-height: 1;
    box-shadow: 0 0 0 5px rgba(255,255,255,.94);
    pointer-events: none;
}
.bams-ppg-sidebar-right .bams-ppg-sidebar-column::before { left: 0; }
.bams-ppg-sidebar-right .bams-ppg-sidebar-column::after { left: -9px; }
.bams-ppg-sidebar-left .bams-ppg-sidebar-column::before { right: 0; }
.bams-ppg-sidebar-left .bams-ppg-sidebar-column::after { right: -9px; }

/* =========================================================
   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-sidebar-right .bams-ppg-sidebar-column::before,
    .bams-ppg-sidebar-right .bams-ppg-sidebar-column::after,
    .bams-ppg-sidebar-left .bams-ppg-sidebar-column::before,
    .bams-ppg-sidebar-left .bams-ppg-sidebar-column::after {
        display: none;
    }


    .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;
    }
}
/* =========================================================
   DYNAMIC SECTION FLOW
   Used only when a page has an explicit Section Manager order.
========================================================= */

.bams-ppg-section-flow {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-width: 0;
}

.bams-ppg-section-flow > * {
    min-width: 0;
    box-sizing: border-box;
}
