.post-cards {
  display: grid;
  column-gap: 1rem;
  row-gap: 3rem;

  @container (min-width: 801px) {
    grid-template-columns: repeat(auto-fill, minmax(40%, 1fr));
  }
}

.posts .post-card {
  border-radius: var(--border-radius-lg);

  article {
    @container (min-width: 801px) {
      flex-direction: row;
    }
  }
}

.post-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--neutral-300);
  transition: all 0.2s ease;

  &:hover {
    cursor: pointer;

    .post-card-image img {
      transform: scale(1.1);
    }

    .post-card-read-more-text {
      transform: translateX(0px);
      opacity: 1;
      display: block;
    }

    .post-card-read-more svg {
      transform: translateX(400%);
    }
  }

  article {
    display: grid;
    height: 100%;
    grid-template-rows: min-content;
  }
}

.post-card-link {
  text-decoration: none;
  color: inherit;

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
}

.post-card-image {
  overflow: hidden;
  aspect-ratio: 312 / 210;

  .posts & {
    aspect-ratio: 300 / 180;
  }

  img {
    object-fit: cover;
    transition: transform 0.2s ease-out;
    will-change: transform;
    height: 100%;
  }
}

.post-card-title {
  margin-bottom: var(--block-space-sm);
  font-size: 2rem;
  font-weight: 600;
}

.post-card-content {
  padding: var(--block-space-sm);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  a {
    text-decoration: none;
  }

  .post-card-content-title {
    /* font-size: clamp(1.25rem, 2vw, 1.5rem); */
    font-size: 18px;
    color: var(--neutral-800);
  }
}

.post-card-read-more {
  margin-top: auto;
  font-weight: 600;
  align-items: center;
  display: flex;
  overflow: hidden;
  width: 100%;
  position: relative;

  svg {
    transform: translateX(0);
    transition: transform 0.3s ease-out;
  }
}

.post-card-read-more-text {
  display: inline-block;
  opacity: 0;
  transition:
    opacity 0.3s ease-out,
    transform 0.3s ease-out;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  position: absolute;
  transform: translateX(-100%);
}

.posts-section {
  .section-title {
    text-align: center;
  }
}

.posts {
  display: grid;
  gap: var(--block-space-sm);

  .post-card:not(.sticky):not(.featured) {
    article {
      .post-card-image {
        width: 100%;

        /* @container (min-width: 801px) {
          max-width: 300px;
        } */
      }
    }
  }

  @container (min-width: 801px) {
    grid-template-columns: repeat(3, 1fr);
  }

  /* @container (min-width: 801px) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, minmax(180px, auto));
  } */
}

/* Posts carousel */
.posts-carousel {
  overflow: hidden;
  position: relative;
  container-type: inline-size;
}

.posts-carousel .posts {
  flex-wrap: nowrap;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;

  @container (min-width: 801px) {
    display: flex;
  }
}

.posts-carousel .posts > .post-card {
  @container (min-width: 801px) {
    flex: 0 0 calc((100% - 2 * var(--block-space-sm)) / 3);
    min-width: 0;
  }
}

.posts-carousel-nav {
  display: none;

  @container (min-width: 801px) {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: var(--block-space-sm);
  }
}

.posts-carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--neutral-300);
  background: transparent;
  cursor: pointer;
  color: var(--neutral-800);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;

  &:hover:not(:disabled) {
    background: var(--neutral-100);
    border-color: var(--neutral-400);
  }

  &:disabled {
    opacity: 0.35;
  }
}

.posts-carousel-btn--prev {
  transform: rotate(180deg);
}

.sticky,
.featured {
  grid-column: 1 / 2;
  grid-row: 1 / -1;

  article {
    flex-direction: column !important;

    .post-card-image {
      aspect-ratio: 630 / 390;
    }
  }
}
