.blog {
  padding-top: 29px;
  padding: 60px $gutter 0;

  @include sm {
    padding: 40px calc(#{$gutter-mobile * 2});
  }

  &__content {
    max-width: $projects-detail-width;
    margin: auto;
  }

  &__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 24px;

    @include sm {
      flex-direction: column;
    }
  }

  &__intro-content {
    display: flex;
    flex-direction: column;

    @include sm {
      width: 100%;
    }
  }

  &__intro-title {
    position: relative;
    font-size: 3.8rem;
    line-height: 4.2rem;
    letter-spacing: -0.02em;
    color: $primary-color;
    margin: 0;
    text-indent: 80px;

    @include sm {
      font-size: 2.6rem;
      line-height: 3rem;
      letter-spacing: -0.01em;
      text-indent: 0px;
    }

    &::before {
      content: "";
      width: 64px;
      height: 1px;
      background: linear-gradient(
        270deg,
        #f39200 0%,
        #{$yellow} 22.66%,
        #{$green} 47.98%,
        #{$blue}  76.13%,
        #{$gray-70} 100%
      );
      display: inline-block;
      position: absolute;
      top: 21px;
      left: 0;

      @include sm {
        top: -15px;
      }
    }
  }

  &__intro-count {
    display: block;
    font-size: 1.8rem;
    line-height: 2.5rem;
    letter-spacing: -0.01em;
    color: $primary-color;
    margin-top: 16px;
  }

  &__filter-label {
    @include sm {
      display: none;
    }

    &--mobile {
      display: none;

      @include sm {
        display: inline;
      }
    }
  }

  &.js-sticky-filter {
    .blog__filter {
      position: fixed;
      width: 100%;
      top: 100px;
      z-index: 9900;
      background: #fff;
      box-shadow: 0 7px 7px -5px rgba(21, 38, 68, 0.25);

      @include md {
        top: 54px;
      }

      .js-scroll-down & {
        top: 70px;
      }

      @include md {
        top: 54px;

        .js-scroll-down & {
          top: 54px;
        }
      }
    }
  }

  &__filter {
    top: 0;
    -webkit-transition: top 0.3s ease-out;
    transition: top 0.3s ease-out;
  }

  &__filter-bar {
    max-width: $max-width;
    margin: 0 auto;
  }

  &__filter-control {
    display: flex;
    padding: 16px $gutter;
  }

  &__filter-toggle {
    position: relative;
    padding-right: 20px;
    margin-right: 14px;

    a {
      font-weight: 700;
      line-height: 2.5rem;
      display: block;
      cursor: default;

      .js-sticky-filter & {
        padding-left: 20px;
        cursor: pointer;
      }

      &::before {
        content: "";
        position: absolute;
        left: 4px;
        top: 5px;
        transform: rotate(-45deg);
        width: 8px;
        height: 8px;
        border-left: 1px solid $primary-color;
        border-bottom: 1px solid $primary-color;
        transition: transform 250ms ease-out;
        transform-origin: 3px 6px;
        display: none;

        .js-sticky-filter & {
          display: block;
        }

        .js-open & {
          transform: rotate(135deg);
        }
      }
    }

    &::after {
      content: "";
      position: absolute;
      top: 3px;
      right: 0;
      height: 16px;
      width: 1px;
      background-color: $gray-border;
    }
  }

  &__filter-items {
    display: flex;
    flex-wrap: wrap;
    padding: 0 $gutter 6px;

    @include mdx {
      overflow-x: auto;
    }
  }

  &__filter-item {
    position: relative;
    margin-right: 7px;
    margin-bottom: 8px;
    font-weight: 700;
    white-space: nowrap;
    color: $primary-color;
    font-size: 1.4rem;
    padding: 10px 16px;
    height: 40px;
    background-color: $gray-bluish;
    border-radius: 22px;
    cursor: pointer;

    &:hover {
      color: $secondary-color;
    }

    &.js-active {
      background-color: $secondary-color;
      color: #fff;
    }

    &:first-child {
      margin-right: 16px;
    }

    input {
      width: 100%;
      height: 100%;
      opacity: 0;
      top: 0;
      position: absolute;
      left: 0;
      cursor: pointer;
    }

    label {
      transition: color 0.2s linear;
    }
  }

  &__list-container {
    max-width: $projects-detail-width;
    margin: 80px auto 0;

    @include sm {
      margin: 40px auto 0;
    }
  }

  &__page {
    // height: 2190px;
    height: calc((350px * 3) + (48px * 2));
    opacity: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 48px;
    row-gap: 48px;
    margin-bottom: 48px;
    transition: opacity 0.25s ease-out;

    &:last-child {
      height: auto !important;
    }

    @include md {
      grid-template-columns: 1fr 1fr 1fr;
      height: calc((340px * 4) + (48px * 3));
    }

    @include sm {
      grid-template-columns: 1fr 1fr;
      height: calc((345px * 6) + (48px * 5));
    }

    @include xs {
      grid-template-columns: 1fr;
      height: calc((460px * 12) + (48px * 11));
    }
  }

  &__nav {
    max-width: $projects-detail-width;
    text-align: center;
    margin: 0 auto 80px;

    a {
      display: inline-flex;
      padding-left: 160px;
      padding-right: 160px;

      @include sm {
        padding-left: 60px;
        padding-right: 60px;
      }

      .js-blog-loading & {
        opacity: 0.6;
        pointer-events: none;
      }
    }
  }

  .loading {
    text-align: center;
  }

  &.js-blog-loading .loading {
    display: block;
  }

  &__filter-holder {
    margin-bottom: 6px;
  }

  &__filter-items-wrapper {
    overflow: hidden;
    transition: height 250ms ease-out;
  }

  &__search {
    width: 100%;
    max-width: 324px;
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid $gray-bluish;

    @include sm {
      max-width: 100%;
      margin-top: 24px;
    }
  }

  &__icon-search {
    width: 17px;
    height: 17px;

    svg,
    g,
    path {
      fill: $primary-color;
    }
  }

  &__search-input {
    flex: 1;
    height: 44px;
    padding-left: 10px;
    color: $primary-color;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 2rem;
    letter-spacing: -0.01em;

    &::placeholder {
      color: $primary-color;
    }
  }

  &__featured-post-date {
    line-height: 2.3rem;
    font-size: 1.6rem;
    letter-spacing: 0.23px;
  }
}
