/// Adaptive Columns
///
/// @author [@esr360](http://twitter.com/esr360)
/// @access public
/// @group Kayzen-GS
/// @param {string} $col-type ['default] - the type of columns to be generated
/// @outputs styles for adaptive columns
@mixin kgs-adaptive-columns($col-type: 'default') {

    // Reverse $breakpoints map
    // This is to allow the generated CSS to override when scaling
    $reverse-breakpoints: if(
        kgs-setting('mobile-first'),
        kayzenGS('breakpoints'),
        map-reverse(kayzenGS('breakpoints'))
    );

    > [class*="#{kgs-option('col-namespace')}"] {

        &[class*="break"] {
            @include kgs-column-core;
            @include kgs-gutter($flush: false);
        }

        @each $bp, $width in $reverse-breakpoints {
            @media (#{$kgs-scale}-width: $width) {
                @each $name, $fraction in kayzenGS('fractions') {
                    &.#{$bp}-#{$name} {
                        @if $col-type == 'default' {
                            width: kgs-flow-width(nth($fraction, 1), nth($fraction, 2));
                        } @else if $col-type == 'no-gutter' {
                            width: kgs-no-gutter-width(nth($fraction, 1), nth($fraction, 2));
                        }
                    }
                }
            }
        }

    }

}