@use "../../../../styles/abstracts/variables" as *;

.news {
  width: 100%;

  &__grid {
    display: grid;

    grid-template-columns:
      repeat(
        auto-fill,
        minmax(
          300px,
          1fr
        )
      );

    gap: 1.5rem;

    align-items: stretch;

    margin-top: 2rem;
  }
}

/* ===================================
   PAGINATION
=================================== */

.pagination {
  margin-top: 2rem;

  display: flex;

  justify-content: center;
}

/* ===================================
   SHIMMER
=================================== */

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@mixin skeletonBase {
  position: relative;

  overflow: hidden;

  background:
    rgba(
      255,
      255,
      255,
      .04
    );

  &::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
      linear-gradient(
        90deg,
        transparent,
        rgba(
          255,
          255,
          255,
          .08
        ),
        transparent
      );

    transform: translateX(-100%);

    animation:
      shimmer 1.8s infinite;
  }
}

/* ===================================
   PREMIUM BLOG CARD SKELETON
=================================== */

.blogSkeleton {
  display: flex;

  flex-direction: column;

  overflow: hidden;

  border-radius: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(22,22,24,.98) 0%,
      rgba(15,15,18,1) 100%
    );

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      .05
    );

  min-height: 470px;

  &__image {
    @include skeletonBase;

    height: 220px;
  }

  &__body {
    padding: 1.5rem;

    flex: 1;
  }

  &__meta {
    display: flex;

    justify-content: space-between;

    margin-bottom: 1rem;
  }

  &__chip {
    @include skeletonBase;

    width: 90px;
    height: 28px;

    border-radius: 999px;
  }

  &__date {
    @include skeletonBase;

    width: 80px;
    height: 14px;

    border-radius: 4px;
  }

  &__title {
    @include skeletonBase;

    width: 90%;

    height: 22px;

    margin-bottom: .75rem;

    border-radius: 6px;
  }

  &__titleShort {
    @include skeletonBase;

    width: 65%;

    height: 22px;

    margin-bottom: 1rem;

    border-radius: 6px;
  }

  &__text {
    @include skeletonBase;

    width: 100%;

    height: 12px;

    margin-bottom: .75rem;

    border-radius: 4px;
  }

  &__textShort {
    @include skeletonBase;

    width: 75%;

    height: 12px;

    border-radius: 4px;
  }

  &__footer {
    display: grid;

    grid-template-columns:
      1fr
      48px
      48px;

    gap: .75rem;

    padding: 1.25rem;

    border-top:
      1px solid
      rgba(
        255,
        255,
        255,
        .05
      );
  }

  &__button {
    @include skeletonBase;

    height: 48px;

    border-radius: 16px;
  }

  &__icon {
    @include skeletonBase;

    width: 48px;
    height: 48px;

    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .news {
    &__grid {
      grid-template-columns: 1fr;

      gap: 1rem;
    }
  }

  .blogSkeleton {
    min-height: auto;

    &__image {
      height: 200px;
    }
  }

  .pagination {
    margin-top: 1.5rem;
  }
}