//
//  Grid
//  Flexible responsive content grid
//  _____________________________________________

// this code is common so use only once in mobile css
& when (@media-common = true) {

.se-grid{
    margin-left: -3%;
    max-width: 105%;
}
.se-col,
.se-grid{
    box-sizing: border-box;
    margin-bottom: 1em;
}

.se-grid50-20 .se-col,
.se-grid50-25 .se-col,
.se-grid50-33 .se-col,
.se-grid100-50 .se-col,
.se-grid50-100 .se-col,
.se-col {
    display: inline-block;
    *display: inline;
    *zoom: 1;
    vertical-align: top;
    margin-left: 3%;
    margin-right: -.25em;

    .vertical-center & {
        vertical-align: middle;
    }

    &.empty {
        display: none;
    }
}

.se-grid .se-col:last-child{
    margin-bottom: 0;
}

/* Grid with cols starting at 100% width, ending at 25% of width */
.se-grid25 .se-col{
    /*nothing*/
}

/* Grid with cols starting at 100% width, ending at 25% of width */
.se-grid33 .se-col{
    /*nothing*/
}

/* Grid with cols starting at 100% width, ending at 50% of width */
.se-grid100-50 .se-col{
    width: 100%;
}

/* Grid with cols starting at 50% width, ending at 100% of width */
.se-grid50-100 .se-col{
    width: 47%;
}

.se-grid.no-margins{
    margin-left: 0;
    max-width: none;
}
.se-grid.no-margins .se-col,
.se-grid50-20.no-margins .se-col,
.se-grid50-25.no-margins .se-col,
.se-grid50-33.no-margins .se-col,
.se-grid100-50.no-margins .se-col {
    margin-bottom: 0;
    margin-left: 0;
}

@media screen and (min-width: 499px) {
    .se-grid100-50 .se-col {
        width: 47%;

        &.empty {
            display: inline-block;
        }
    }
}


@media screen and (min-width: 768px) {

    .se-grid50-20 .se-col.empty,
    .se-grid50-25 .se-col.empty,
    .se-grid50-33 .se-col.empty,
    .se-grid100-50 .se-col.empty,
    .se-grid50-100 .se-col.empty,
    .se-col.empty {
        display: inline-block;
    }

    .se-grid .se-col1-1 { width: 97%; }

    .se-grid .se-col1-2 { width: 47%; }

    .se-grid .se-col1-3 { width: 30.36%; }
    .se-grid .se-col2-3 { width: 63.6666666%; }

    .se-grid .se-col1-4 { width: 22%; }
    .se-grid .se-col3-4 { width: 72%; }

    .se-grid .se-col1-5 { width: 17.07%; }
    .se-grid .se-col2-5 { width: 37%; }
    .se-grid .se-col3-5 { width: 57%; }
    .se-grid .se-col4-5 { width: 77%; }

    .se-grid .se-col1-6 { width: 13.6%; }
    .se-grid .se-col2-6 { width: 30.3%; }
    .se-grid .se-col3-6 { width: 47%; }
    .se-grid .se-col4-6 { width: 63.6%; }
    .se-grid .se-col5-6 { width: 80.3%; }

    .se-grid .se-col1-7 { width: 11.2%; }
    .se-grid .se-col2-7 { width: 25.5%; }
    .se-grid .se-col3-7 { width: 39.8%; }
    .se-grid .se-col4-7 { width: 54.1%; }
    .se-grid .se-col5-7 { width: 68.4%; }
    .se-grid .se-col6-7 { width: 82.7%; }

    .se-grid .se-col1-8 { width: 9.5%; }
    .se-grid .se-col2-8 { width: 22%; }
    .se-grid .se-col3-8 { width: 34.5%; }
    .se-grid .se-col4-8 { width: 47%; }
    .se-grid .se-col5-8 { width: 59.5%; }
    .se-grid .se-col6-8 { width: 72%; }
    .se-grid .se-col7-8 { width: 84.5%; }

    .se-grid.no-margins .se-col1-1 { width: 100%; }

    .se-grid.no-margins .se-col1-2 { width: 50%; }

    .se-grid.no-margins .se-col1-3 { width: 33.3%; }
    .se-grid.no-margins .se-col2-3 { width: 66.6%; }

    .se-grid.no-margins .se-col1-4 { width: 25%; }
    .se-grid.no-margins .se-col3-4 { width: 75%; }

    .se-grid.no-margins .se-col1-5 { width: 20%; }
    .se-grid.no-margins .se-col2-5 { width: 40%; }
    .se-grid.no-margins .se-col3-5 { width: 60%; }
    .se-grid.no-margins .se-col4-5 { width: 80%; }

    .se-grid.no-margins .se-col1-6 { width: 16.6%; }
    .se-grid.no-margins .se-col2-6 { width: 33.3%; }
    .se-grid.no-margins .se-col3-6 { width: 50%; }
    .se-grid.no-margins .se-col4-6 { width: 66.6%; }
    .se-grid.no-margins .se-col5-6 { width: 83.3%; }

    .se-grid.no-margins .se-col1-7 { width: 14.2%; }
    .se-grid.no-margins .se-col2-7 { width: 28.5%; }
    .se-grid.no-margins .se-col3-7 { width: 42.8%; }
    .se-grid.no-margins .se-col4-7 { width: 57.1%; }
    .se-grid.no-margins .se-col5-7 { width: 71.4%; }
    .se-grid.no-margins .se-col6-7 { width: 85.7%; }

    .se-grid.no-margins .se-col1-8 { width: 12.5%; }
    .se-grid.no-margins .se-col2-8 { width: 25%; }
    .se-grid.no-margins .se-col3-8 { width: 37.5%; }
    .se-grid.no-margins .se-col4-8 { width: 50%; }
    .se-grid.no-margins .se-col5-8 { width: 62.5%; }
    .se-grid.no-margins .se-col6-8 { width: 75%; }
    .se-grid.no-margins .se-col7-8 { width: 87.5%; }

    /* Fixed flexible */

    .se-grid50-20 .se-col,
    .se-grid50-25 .se-col,
    .se-grid50-33 .se-col{
        width: 30.36%;
    }
    .se-grid25 .se-col{
        width: 47%;
    }
    .se-grid33 .se-col{
        width: 47%;
    }

    .se-grid100-50 .se-col {
        width: 47%;
    }

    .se-grid50-100 .se-col {
        width: 100%;
    }

    .se-grid50-20.no-margins .se-col,
    .se-grid50-25.no-margins .se-col,
    .se-grid50-33.no-margins .se-col{
        width: 33.3%;
    }
    .se-grid25.no-margins .se-col{
        width: 50%;
    }
    .se-grid33.no-margins .se-col{
        width: 50%;
    }
}

@media screen and (min-width: 1024px) {

    /* Fixed flexible */
    .se-grid50-20 .se-col {
        width: 17.00%;
    }
    .se-grid50-25 .se-col{
        /*width: 22.05%;*/ /* seems to give problems from time to time */
        width: 22.00%;
    }

    .se-grid25 .se-col{
        width: 22.05%;
    }

    .se-grid33 .se-col{
        width: 30.36%;
    }

    .se-grid50-20.no-margins .se-col{
        width: 20%;
    }
    .se-grid50-25.no-margins .se-col{
        width: 25%;
    }
    .se-grid25.no-margins .se-col{
        width: 25%;
    }
    .se-grid33.no-margins .se-col{
        width: 33.33%;
    }
}

@media screen and (max-width: 767px) {
    .se-grid {
        margin-left: 0;
        max-width: none;
    }
    .se-grid50-20,
    .se-grid50-25{
        margin-left: -3%;
        max-width: 105%;
    }
    .se-grid50-20.no-margins,
    .se-grid50-25.no-margins{
        margin-left: 0;
        max-width: none;
    }

    .se-col {
        width: auto;
        margin-left: 0;
        display: block;
    }

    .se-grid50-20 .se-col,
    .se-grid50-25 .se-col,
    .se-grid50-33 .se-col{
        width: 47%;
    }
    .se-grid50-20.no-margins .se-col,
    .se-grid50-25.no-margins .se-col,
    .se-grid50-33.no-margins .se-col{
        margin-left: 0;
        width: 50%;
    }
}


} // end when common




