@use "../custom" as *;

.blog {
  background-color: $background;
  padding: 6.25rem 0;

  &__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;

    .btn-success {
      color: $white !important;
      border-radius: 0.25rem;
      font-size: 1.125rem;
      font-weight: 700;
      padding: 0.75rem 1.5rem;
      width: max-content;

      @include media-breakpoint-down(md) {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
      }
    }

    @include media-breakpoint-down(md) {
      flex-direction: column;
      align-items: start;
    }
  }

  &__headline {
    font-family: $roobert;
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    color: $label;
    line-height: 1;
    margin-bottom: 0.75rem;
    span {
      font-family: $roobert;
      color: $success;
    }
  }

  &__description {
    color: $label-200;
    font-family: $roobert;
    font-weight: 400;
    font-size: 1rem;
    margin: 0;
    max-width: 51.5rem;
  }

  &__wrapper {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1.5rem;
  }

  &__item {
    position: relative;
    border-radius: 1.875rem;
    overflow: hidden;
    height: 31.25rem;

    &:hover {
      .blog__item-img img {
        object-position: center -0.625rem;
      }

      .blog__item-content {
        background: rgba(0, 0, 0, 0.35);
      }
    }

    &-img {
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: 1;
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transition: all ease-in-out 200ms;
      }
    }

    &-content {
      position: absolute;
      width: 100%;
      left: 0;
      bottom: 0;
      backdrop-filter: blur(4.375rem);
      background: rgba(0, 0, 0, 0.3);
      padding: 2.5rem 1.5rem;
      height: 12.8125rem;
      z-index: 2;
      transition: all ease-in-out 200ms;
    }

    &-title {
      color: $white;
      font-size: 1.25rem;
      font-weight: 600;
      font-family: $inter;
      display: block;
      margin-bottom: 0.75rem;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      margin: 0;
    }

    &-description {
      font-family: $roobert;
      font-size: 0.875rem;
      color: $white;
      font-weight: 400;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      margin: 0;
    }
  }
}
