@use "sass:math";
@use "../../variables/index" as *;
@use "clearfix";

// Grid system

// Centered container element
@mixin container-fixed($gutter: $grid-gutter-width) {
  margin-right: auto;
  margin-left: auto;
  padding-right: calc($gutter / 2);
  padding-left: calc($gutter / 2);

  @include clearfix.clearfix();
}

// Creates a wrapper for a series of columns
@mixin make-row($gutter: $grid-gutter-width) {
  margin-right: calc($gutter * -0.5);
  margin-left: calc($gutter * -0.5);

  @include clearfix.clearfix();
}

// Generate the extra small columns
@mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
  position: relative;
  float: left;
  padding-right: math.div($gutter, 2);
  padding-left: math.div($gutter, 2);
  min-height: 1px;
  width: math.percentage(math.div($columns, $grid-columns));
}
@mixin make-xs-column-offset($columns) {
  margin-left: math.percentage(math.div($columns, $grid-columns));
}
@mixin make-xs-column-push($columns) {
  left: math.percentage(math.div($columns, $grid-columns));
}
@mixin make-xs-column-pull($columns) {
  right: math.percentage(math.div($columns, $grid-columns));
}

// Generate the small columns
@mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
  position: relative;
  padding-right: math.div($gutter, 2);
  padding-left: math.div($gutter, 2);
  min-height: 1px;

  @media (min-width: $screen-sm-min) {
    float: left;
    width: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-sm-column-offset($columns) {
  @media (min-width: $screen-sm-min) {
    margin-left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-sm-column-push($columns) {
  @media (min-width: $screen-sm-min) {
    left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-sm-column-pull($columns) {
  @media (min-width: $screen-sm-min) {
    right: math.percentage(math.div($columns, $grid-columns));
  }
}

// Generate the medium columns
@mixin make-md-column($columns, $gutter: $grid-gutter-width) {
  position: relative;
  padding-right: math.div($gutter, 2);
  padding-left: math.div($gutter, 2);
  min-height: 1px;

  @media (min-width: $screen-md-min) {
    float: left;
    width: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-md-column-offset($columns) {
  @media (min-width: $screen-md-min) {
    margin-left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-md-column-push($columns) {
  @media (min-width: $screen-md-min) {
    left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-md-column-pull($columns) {
  @media (min-width: $screen-md-min) {
    right: math.percentage(math.div($columns, $grid-columns));
  }
}

// Generate the large columns
@mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
  position: relative;
  padding-right: math.div($gutter, 2);
  padding-left: math.div($gutter, 2);
  min-height: 1px;

  @media (min-width: $screen-lg-min) {
    float: left;
    width: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-lg-column-offset($columns) {
  @media (min-width: $screen-lg-min) {
    margin-left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-lg-column-push($columns) {
  @media (min-width: $screen-lg-min) {
    left: math.percentage(math.div($columns, $grid-columns));
  }
}
@mixin make-lg-column-pull($columns) {
  @media (min-width: $screen-lg-min) {
    right: math.percentage(math.div($columns, $grid-columns));
  }
}
