/*! Copyright (C) 2015-2022 AIZAWA Hina | MIT License */

@use 'sass:math';

$label-width: 15em;
$v2-column-count: 4;
$v3-column-count: 5;

$small-screen-width: 991px;

.salmon-waves,
.salmon-v3-waves {
  table-layout: fixed;
  @media (max-width: $small-screen-width) {
    table-layout: auto !important;
  }

  thead {
    th {
      --label-width: #{$label-width};
      --column-count: #{$v2-column-count};

      width: calc((100% - var(--label-width)) / var(--column-count));
      @media (max-width: $small-screen-width) {
        width: auto !important;
      }

      &:first-child {
        width: var(--label-width);
        @media (max-width: $small-screen-width) {
          width: auto !important;
        }
      }
    }
  }
}

.salmon-v3-waves {
  thead {
    th {
      --column-count: #{$v3-column-count};
    }
  }
}

.apple {
  .salmon-waves,
  .salmon-v3-waves {
    table-layout: auto !important;
  }

  .salmon-waves {
    thead {
      th,
      th:first-child {
        width: math.div(100%, $v2-column-count + 1) !important;
      }
    }
  }

  .salmon-v3-waves {
    thead {
      th,
      th:first-child {
        width: math.div(100%, $v3-column-count + 1) !important;
      }
    }
  }
}
