.head {
  position: relative;
  margin-bottom: 0;
  padding-top: 2rem;
  margin-top: 0;
  padding-bottom: 60px;

  @media (max-width: 650px) {
    padding-bottom: 40px;
  }

  & .head-content {
    display: flex;
    justify-content: space-between;
    align-items: center;

    p {
      display: flex;
      align-items: center;
      font-weight: 500;
      font-size: 1rem;
      line-height: 24px;
      text-decoration: underline;
      color: #999999;
      cursor: pointer;
      transition: 0.3s ease;

      & .arrow-right {
        transform: rotateZ(-90deg);
        background-color: #999999;
      }

      &.descending {
        & .arrow-right {
          transform: rotateZ(90deg);
        }
      }
    }
  }
}

.articles-section {
  margin-top: 60px;
  padding-inline: 0;

  @media (max-width: 650px) {
    margin-top: 40px;
  }

  & .filter {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 5rem;
    list-style: none;
    padding: 0;
    padding-inline: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0;

    & li {
      font-weight: 400;
      padding: 0.5rem 1rem;
      border-radius: 8px;
      border: 1px solid #999999;
      transition: 0.3s ease;
      cursor: pointer;
      
      & a {
        color: black;
        text-decoration: none;
      }

      &:hover:not(.active) {
        border: 1px solid #cccccc;

        & a {
          color: #666666;
        }
      }
    }

    & li.active {
      background: linear-gradient(
        180deg,
        #8039e5 0%,
        #b939e5 50%,
        #e539bd 100%
      );
      border: 1px solid white;

      & a {
        color: white;
      }
    }

    @media (max-width: 650px) {
      flex-wrap: nowrap;
      overflow: auto;
      scrollbar-width: none;

      &::-webkit-scrollbar {
        display: none;
      }

      & li {
        text-wrap: nowrap;
      }
    }
  }

  & .articles-container .article-item {
    & h2 {
      overflow-wrap: anywhere;
    }
  }

  @media (min-width: 1100px) {
    & .articles-container .article-item {
      padding: 1.5rem;
      flex: initial;
      display: flex;
      flex-direction: row;
      color: black;
      text-decoration: none;
      gap: 1.5rem;
      width: 100%;

      & .article-item__container {
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;

        & .article-item__container-top {
          display: flex;
          gap: 1rem;
          justify-content: space-between;
          width: 100%;
        }
      }

      & .article-meta {
        height: fit-content;
        flex-shrink: 0;
      }

      & h2 {
        font-weight: 500;
        font-size: 32px;
        line-height: 48px;
        letter-spacing: 0%;
        margin-block: 0;
        flex-shrink: 3;
        flex-basis: calc(100% - 132.09px - 1rem);

        @media (max-width: 1240px) {
          font-size: 24px;
          line-height: 36px;
          margin-block: 0;
        }
      }

      & p {
        flex-shrink: 1;
        font-weight: 300;
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0%;
        margin-block: 0;
      }

      & img {
        flex-shrink: 2;
        width: 482px;
        object-fit: cover;
        border-radius: 8px;
        max-height: initial;
        height: auto;
        min-width: 482px;
      }

      &:hover {
        & .contact-btn {
          background: var(--black);
          color: white;

          & .arrow-right {
            background-color: white;
          }
        }
      }
    }
  }

  @media (max-width: 1099px) {
    .article-item {
      & .article-item__container {
        height: 100%;
        display: flex;
        flex-direction: column;
      }

      & .article-meta {
        margin-bottom: 1.5rem;
      }

      & p {
        display: none;
      }
    }
  }

  .article-item {
    & .contact-btn-mini {
      margin-top: auto;
      margin-left: auto;
      flex-shrink: 0;
      justify-self: end;
      align-self: end;
    }
  }

  & .articles-container {
    padding-inline: 1.5rem;
    display: flex;
    column-gap: 1.5rem;
    row-gap: 1.5rem;
    flex-wrap: wrap;

    @media (max-width: 800px) {
      flex-direction: column;
      align-items: center;
      row-gap: 1.5rem;

      & .article-item {
        width: 100%;
      }
    }

    & .contact-btn-mini {
      flex-basis: 64px;
      flex-shrink: 0;
    }
  }

  & .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5rem;

    & a,
    .disabled {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      text-decoration: none;
      font-weight: 400;
      text-align: center;
      color: black;

      @media (max-width: 475px) {
        width: 2rem;
        height: 2rem;
      }

      &.current {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
        color: white;
      }
    }

    & .pages-container {
      display: flex;
    }

    & a {
      cursor: pointer;

      &:hover:not(.current) {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
      }

      &.disabled {
        cursor: not-allowed;
        color: #999999;
        background-color: transparent;
        border-bottom: none;
        pointer-events: none;
        user-select: none;
        color: #cccccc;
      }
    }

    & .next-page i,
    .prev-page i {
      mask-image: url("../../img/arrow_small_down_24px.svg");
    }

    & .next-page i {
      transform: rotate(-90deg);
    }

    & .prev-page i {
      transform: rotate(90deg);
    }

    & .first-page i,
    .last-page i {
      mask-image: url("../../img/arrow_chevron_small_right_24px.svg");
    }

    & .first-page i {
      transform: rotate(180deg);
    }

    & .next-page,
    .prev-page,
    .first-page,
    .last-page {
      & i {
        display: block;
        width: 1.5rem;
        height: 1.5rem;
        mask-size: contain;
        background-color: #666666;
      }

      &.disabled i {
        background-color: #cccccc;
      }

      &:hover:not(.disabled) i {
        background: linear-gradient(
          180deg,
          #8039e5 0%,
          #b939e5 50%,
          #e539bd 100%
        );
      }
    }
  }
}
