.page-template-projects {
  main {
    position: relative;
    overflow: hidden;
  }

  main > h1 {
    font-family: "Poppins", serif;
    font-weight: 600;
    font-size: 38px;
    color: var(--dark-80);
    text-align: center;
    position: relative;
    margin-top: 80px;

    &::after {
      content: "";
      width: 64px;
      height: 1px;
      background-color: var(--green-primary);
      position: absolute;
      top: calc(100% + 24px);
      right: 50%;
      transform: translateX(50%);
    }
  }

  .projects-section {
    margin-block: 48px 64px;
    position: relative;
    z-index: 1;
  }

  .projects-section__cards-container {
    padding-top: 0;
  }
}

.projects__sorting-section {
  margin-top: 24px;
  width: 100%;
  height: 20px;
  max-width: 1440px;
  padding-inline: 48px;
  margin-inline: auto;
  position: relative;
}

.projects-section__sorting-btn {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
  background-color: transparent;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--dark-80);
  position: absolute;
  right: 40px;
  cursor: pointer;

  &::after {
    content: url(../../../images/icons/sort-icon.svg);
    width: 16px;
    height: 16px;
  }

  &.disabled {
    pointer-events: none;
    opacity: 50%;
  }
}

.projects-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 64px;

  h2 {
    font-family: "Inter", sans-serif;
    text-align: center;
    font-weight: 600;
    font-size: 24px;
    position: relative;
    color: var(--dark-80);

    &::after {
      content: "";
      width: 64px;
      height: 1px;
      background-color: var(--green-primary);
      position: absolute;
      top: calc(100% + 24px);
      right: 50%;
      transform: translateX(50%);
    }
  }

  .btn-default {
    margin: 32px auto 0;
  }
}

.projects-section__cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(433px, 1fr));
  justify-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1440px;
  gap: 30px;
  padding-inline: 40px;
  font-family: "Inter", sans-serif;
  position: relative;
}

.projects-section__card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 300ms;
  text-decoration: none;
  color: var(--dark-80);
  box-shadow: 0px 12px 100px 0px #c7c7c740;
  overflow-wrap: break-word;
  width: 433px;
  height: 580px;

  .card__img {
    width: 100%;
    height: 298px;
    min-height: 298px;
    object-fit: cover;
    object-position: center;
  }

  .card__info {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 20px;
  }

  .card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 24px;
    transition: border-color 300ms;
  }

  .card__description {
    padding-top: 20px;
    border-top: 1px solid var(--blue-gray);
    min-height: 60px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    font-size: 14px;
    line-height: 19.6px;
  }

  .card__bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  &:hover {
    box-shadow: 0px 4px 100px 0px #00000029;
    color: var(--dark-100);

    .card__title {
      border-color: var(--green-primary);
    }

    .card__technologies {
      opacity: 1;
    }

    .btn-round {
      border-color: var(--green-primary);
      background-color: var(--green-primary);

      &::after {
        filter: invert(1) brightness(2);
      }
    }
  }
}

@media (max-width: 1438px) {
  .projects__sorting-section {
    padding-inline: 128px;
  }
}

@media (max-width: 1280px) {
  .projects-section__card {
    .card__info {
      padding: 32px 32px 20px;
    }
  }
}

@media (max-width: 1024px) {
  .projects__sorting-section {
    justify-content: center;
    padding-inline: 0;
  }
}

@media (max-width: 768px) {
  .page-template-projects {
    main > h1 {
      margin-top: 56px;
      font-size: 32px;
    }

    .projects-section {
      margin-block: 24px 64px;
    }

    .btn-default {
      margin-block: 48px 0;
    }
  }

  .projects__sorting-section {
    margin: 56px 0 0;
    width: 100%;
    place-self: center;
    padding-inline: 24px;
  }

  .projects-section {
    margin-top: 32px;
  }

  .projects-section__cards-container {
    padding-inline: 48px;
    gap: 48px;
  }

  .projects-section__card:hover {
    .btn-round {
      border-color: var(--blue-gray);
      background-color: inherit;

      &::after {
        filter: none;
      }
    }
  }
}

@media (max-width: 560px) {
  .page-template-projects {
    h1 {
      margin-top: 32px;
      font-size: 32px;
    }

    .btn-default {
      margin-block: 16px 0;
    }
  }

  .projects__sorting-section {
    padding-inline: 16px;
  }

  .projects-section__cards-container {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    width: 100%;
    padding-inline: 0;
    gap: 16px;
  }

  .projects-section__card {
    width: 100%;

    .card__info {
      padding: 24px 16px 20px;
    }
  }
}
