/** Mixins */
@mixin xs {
  @media (max-width: #{$screen-xs-max}) {
    @content;
  }
}

@mixin sm {
  @media (max-width: #{$screen-sm-max}) {
    @content;
  }
}

@mixin md {
  @media (max-width: #{$screen-md-max}) {
    @content;
  }
}

@mixin tablet {
  @media (max-width: #{$screen-tablet-max}) {
    @content;
  }
}

@mixin mdx {
  @media (max-width: #{$screen-mdx-max}) {
    @content;
  }
}

@mixin lg {
  @media (max-width: #{$screen-lg-max}) {
    @content;
  }
}

@mixin xs-up {
  @media (min-width: #{$screen-xs-max + 1px}) {
    @content;
  }
}

@mixin sm-up {
  @media (min-width: #{$screen-sm-max}) {
    @content;
  }
}

@mixin image-aspect-ratio($maxWidth, $aspectRatio) {
  margin: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: $maxWidth;

  &::before {
    content: "";
    display: block;
    padding-bottom: $aspectRatio;
  }

  img,
  iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
  }
}

@mixin rich-content-system {
  color: $primary-color;
  line-height: 1.5;

  p {
    margin: 2.4rem 0;
    font-size: 1.8rem;

    @include sm {
      font-size: 1.6rem;
    }

    &:first-child {
      margin-top: 0;
    }

    &.paragraph-big {
      font-size: 2.4rem;

      @include sm {
        font-size: 2.1rem;
      }
    }

    &.paragraph-medium {
      font-size: 2.1rem;

      @include sm {
        font-size: 1.8rem;
      }
    }
  }

  ol {
    padding: revert;
    margin: revert;
  }

  ul, li {
    padding: revert;
    margin: revert;
    list-style: inherit;

    ul, ol {
      margin-top: 1rem;
    }
  }

  li {
    margin-bottom: 1rem;
  }

  a {
    text-decoration: underline;
  }

  h2, h3 {
    > a {
      text-decoration: none;
    }
  }

  h1, .heading1 {
    margin-bottom: 2.4rem;
    margin-top: 4.8rem;

    &:first-child {
      margin-top: 0;
    }
  }

  h2, .heading2 {
    margin-bottom: 2.4rem;
    margin-top: 4.8rem;

    &:first-child {
      margin-top: 0;
    }
  }

  h3, .heading3 {
    margin-bottom: 2.4rem;
    margin-top: 4.8rem;

    &:first-child {
      margin-top: 0;
    }
  }

  h4, .heading4 {
    margin-bottom: 2.4rem;
    margin-top: 4.8rem;

    &:first-child {
      margin-top: 0;
    }
  }

  &__objective {
    margin-bottom: 3rem;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    height: 100%;
    margin: 3.2rem 0;
    padding: 0px;

    tr:nth-child(odd){
      background-color: $gray-bluish;
    }

    tr:nth-child(even){
      background-color:$white;
    }

    td{
      vertical-align: middle;
      border: 2px solid #EBF1F4;
      border-width: 0px 2px 0px 0px;
      text-align: left;
      padding: 1.3rem .9rem 1.1rem;
      font-size: 16px;
      font-weight: normal;
      color: $primary-color;
    }

    tr:last-child td{
      border-width: 0px 2px 0px 0px;
    }

    tr td:last-child{
      border-width:0px 0px 0px 0px;
    }

    tr:last-child td:last-child{
      border-width:0px 0px 0px 0px;
    }

    tr:nth-child(2) th{
      background-color: $white;
      border: 0px solid #E2E2E3;
      border-width: 0px 0px 0px 2px;
      font-size: 1.6rem;
      font-weight: bold;
      letter-spacing: 0.023rem;
      color: $primary-color;
      padding: 1.2rem .9rem 1rem;
      text-align: left;
    }

    tr:nth-child(2):hover th{
      background-color:$white;
    }

    tr:nth-child(2) th:first-child{
      border-width:0px 0px 2px 0px;
    }

    tr:nth-child(2) th:last-child{
      border-width:0px 0px 2px 2px;
    }

    tr:first-child {
      th {
        padding: 1.9rem .9rem 1.8rem;
        font-size: 1.8rem;
        font-weight: bold;
        letter-spacing: 0.026rem;
        background-color: $white;
        border: 2px solid #E2E2E3;
        border-width: 0px 0px 2px 2px;
        text-align: left;

        &:first-child {
          border-width:0px 0px 2px 0px;
        }

        &:last-child {
          border-width:0px 0px 2px 2px;
        }
      }
    }
  }

  blockquote {
    margin: 3.2rem 5rem 3.2rem;
    font-size: 2.1rem;
    color: $medium-color;
    font-weight: 400;
    font-style: italic;

    &:before {
      content: "“";
      margin-right: 8px;
    }

    &:after {
      content: "”";
      margin-left: 8px;
    }

    p {
      display: inline;
      margin-left: -6px;
      margin-right: -6px;
    }
  }

  .quote-name {
    margin: -1.6rem 0 3.2rem 5rem;
    color: $primary-color;

    &:before {
      content: "-";
    }
  }

  .big-check {
    position: relative;
    font-size: 2.1rem;
    list-style: none;

    @include sm {
      font-size: 1.8rem;
    }

    &::before {
      content: '';
      position: absolute;
      left: -38px;
      display: block;
      width: 25px;
      height: 25px;
      background: url("../img/svg/ico_check.svg") no-repeat center;
      background-size: 25px;
    }
  }

  ol {
    counter-reset: item;
  }

  .ol-big-numbers {
    position: relative;
    list-style: none !important;
    font-size: 1.8rem;
    margin: 2.4rem 0;

    &::before {
      content: counter(item) " ";
      position: absolute;
      left: -3.6rem;
      top: -1px;
      counter-increment: item;
      font-size: 23px;
      font-weight: 700;
      color: $medium-color;
      margin-right: 1rem;
    }
  }

  .text-medium {
    font-size: 2.1rem;

    @include sm {
      font-size: 1.8rem;
    }
  }
}

@mixin chevron-right-blog {
  position: relative;
  padding-right: 32px;

  @include sm {
    padding-right: 0;
  }

  &::after {
    content: " ";
    width: 12px;
    height: 12px;
    display: block;
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -6px;
    border-right: 2px solid;
    border-top: 2px solid;
    border-radius: 1px;
    transform: rotate(45deg);
  }
}
