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

.news {
  width: 100%;
  margin-top: 2rem;
  &__grid {
    display: grid;

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

    gap: 1.5rem;

    width: 100%;
  }
}

/* ====================================
   SKELETON CARD
==================================== */

.skeletonCard {
  position: relative;

  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: 390px;

  &::before {
    content: "";

    position: absolute;

    inset: 0;

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

    transform: translateX(-100%);

    animation:
      shimmer 1.8s infinite;
  }

  &__image {
    height: 210px;

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

  &__body {
    padding: 1.35rem;

    display: flex;

    flex-direction: column;

    gap: .85rem;
  }

  &__tag {
    width: 95px;

    height: 26px;

    border-radius: 999px;

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

  &__date {
    width: 120px;

    height: 12px;

    border-radius: 8px;

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

  &__title {
    width: 100%;

    height: 16px;

    border-radius: 8px;

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

  &__titleShort {
    width: 75%;

    height: 16px;

    border-radius: 8px;

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

  &__button {
    margin-top: auto;

    height: 42px;

    border-radius: 14px;

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

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

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

/* ====================================
   MOBILE
==================================== */

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

      gap: 1rem;

      margin-top: 1.25rem;
    }
  }

  .skeletonCard {
    min-height: 360px;

    &__image {
      height: 190px;
    }
  }
}