// ===========================================
// Utility ユーティリティ
// ===========================================

/* Container
====================================== */
.mm-container {
  box-sizing: content-box;
  margin-inline: auto;
  padding-inline: 15px;
  max-width: $max-width-m;
  @include mq-up('s') {
    padding-inline: 25px;
  }
  &-xsmall {
    max-width: $max-width-xs;
  }
  &-small {
    max-width: $max-width-s;
  }
  &-large {
    max-width: $max-width-l;
  }
  &-expand {
    max-width: none;
    &-left {
      margin-left: 0;
    }
    &-right {
      margin-right: 0;
    }
  }
  &-remove-p {
    padding-inline: 0;
  }
}

/* Grid
====================================== */
.mm-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 45px;
  $column_arr: (1, 2, 3, 4, 5, 6, 7, 10);
  @each $num in $column_arr {
    &-column-1-#{$num} {
      grid-template-columns: repeat(#{$num}, 1fr);
    }
  }
  @each $key, $val in $breakpoint-up {
    @include mq-up($key) {
      @each $num in $column_arr {
        &-column-1-#{$num}\@#{$key} {
          grid-template-columns: repeat(#{$num}, 1fr);
        }
      }
    }
  }

  &-gap-collapse {
    gap: normal;
    @each $key, $val in $breakpoint-up {
      &\@#{$key} {
        @include mq-up($key) {
          gap: normal;
        }
      }
    }
  }
}

@for $i from 0 through 20 {
  .mm-gap-#{$i * 5} {
    gap: 5px * $i;
    @each $key, $val in $breakpoint-up {
      @include mq-up($key) {
        &\@#{$key} {
          gap: 5px * $i;
        }
      }
    }
  }
}

/* section
====================================== */
.com-sec-01 {
  padding-block: 60px;
  @include mq-up('s') {
    padding-block: 100px;
  }
}

/* Gap between sections or blocks
/* セクションやブロック間の隙間
--------------------------------- */
.com-mt-s {
  margin-top: 20px;
  @include mq-up('s') {
    margin-top: 30px;
  }
}

.com-mt-m {
  margin-top: 40px;
  @include mq-up('s') {
    margin-top: 60px;
  }
}

.com-mt-l {
  margin-top: 90px;
  @include mq-up('s') {
    margin-top: 120px;
  }
}

// Margin for one line
.com-mt-1em {
  margin-top: 1em;
}

.com-mt-half {
  margin-top: 0.5em;
}

/* font-size フォントサイズ
--------------------------------- */
@for $i from 10 through 30 {
  .com-fz-#{$i} {
    @include font($i);
  }
}

/* Visibility 表示/非表示
--------------------------------- */
.mm-hidden {
  display: none !important;
  @each $key, $val in $breakpoint-up {
    &\@#{$key} {
      @include mq-up($key) {
        display: none !important;
      }
    }
  }
}

.mm-visible {
  @each $key, $val in $breakpoint-up {
    &\@#{$key} {
      @include mq-down($key) {
        display: none !important;
      }
    }
  }
}

/* Centering
--------------------------------- */
.com-center {
  display: grid;
  place-items: center;
}

.com-center-block {
  display: grid;
  align-content: center;
}

/* margin auto 中央寄せ
--------------------------------- */
.mm-margin-auto {
  margin-inline: auto;
}

/* display
--------------------------------- */
.mm-inline-block {
  display: inline-block;
}

/* text
--------------------------------- */
.mm-text-bold {
  font-weight: bold;
}

/* Margin class in 5px steps
/* 余白調整用のクラス　5px刻みで20回処理を繰り返し
====================================== */
@for $i from 0 through 20 {
  .mt#{$i * 5} {
    margin-top: 5px * $i !important;
  }
  .mb#{$i * 5} {
    margin-bottom: 5px * $i !important;
  }
  .pt#{$i * 5} {
    padding-top: 5px * $i !important;
  }
  .pb#{$i * 5} {
    padding-bottom: 5px * $i !important;
  }
}

/* Color classes
====================================== */
@each $color-name, $color-value in $colors {
  .com-txt-color-#{'' + $color-name} {
    color: #{$color-value} !important;
  }
  .com-bg-#{'' + $color-name} {
    background-color: #{$color-value} !important;
  }
}

/* アクセント色
--------------------------------- */
.com-accent-01 {
}
