//
// Grid System (Inline Block Base)
//
// .c-row {
//   _ib-row();
//   &__col {
//     _ib-row__col();
//     &--1-3 {
//       _ib-row__col(1, 3);
//     }
//     &--offset-1-3 {
//       _ib-row__col--offset(1, 3);
//     }
//   }
// }
//
// <div class="c-row">
//   <div class="c-row__col">
//     ...
//   </div>
// </div>
//

_ib-row() {
  display: block;
  font-size: 0;
}

//
// Setting column width
//
// @param  int  columns      molecule column size
// @param  int  max-columns  denominator column size
//
_ib-row__col(columns = null, max-columns = null) {
  display: inline-block;
  font-size: _base-font-size;
  text-align: left;
  vertical-align: top;

  if (! _is-null(columns) && ! _is-null(max-columns)) {
    width = percentage(columns / max-columns);
    _ib-row__col--width(width);
  } else {
    _ib-row__col--width(100%);
  }
}

//
// Setting column width
//
// @param  length  width
//
_ib-row__col--width(width) {
  if (width == 'auto') {
    width: auto;
  } else {
    width: width;
  }
}

//
// Setting column offset
//
// @param  int  columns      molecule offset size
// @param  int  max-columns  denominator offset size
//
_ib-row__col--offset(columns = null, max-columns = null) {
  _row__col--offset(columns, max-columns);
}

//
// Adding margin for the column
//
// @param  int  coefficient
//
_ib-row__col--margin(coefficient) {
  _row__col--margin(coefficient);
}

//
// Adding margin for the row
//
// @param  int  coefficient
//
_ib-row--margin(coefficient) {
  _row--margin(coefficient);
}
