.featured-posts-wrapper {
  margin-top: 180px;
  /* height: 40px; */
}

.posts-wrapper {
  margin-top: 48px;
  padding-bottom: 48px;
}

.posts-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.posts-header .filter-posts {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
}

#featured-posts {
  display: grid;
  grid-template-columns: 50% 25% 25%;
  gap: 24px;
  height: 400px; /* Set a fixed height for the container */
  transition: grid-template-columns 0.5s ease;
}

#featured-posts .post-item {
  transition: all 0.5s ease;
  aspect-ratio: auto; /* Override the aspect ratio */
  height: 100%;
  padding-bottom: 0; /* Remove the padding-bottom that was for aspect ratio */
}

#featured-posts .post-item-inner {
  height: 100%;
}

#featured-posts .post-item:hover {
  /* transform: scale(1.02); */
  z-index: 10;
}

/* Create a class for when item 2 or 3 is hovered */
#featured-posts:has(.post-item:nth-child(2):hover),
#featured-posts:has(.post-item:nth-child(3):hover) {
  grid-template-columns: 25% 50% 25%;
}

#featured-posts:has(.post-item:nth-child(3):hover) {
  grid-template-columns: 25% 25% 50%;
}

#posts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.pagination-wrapper {
  margin-top: 48px;
  text-align: center;
}

.pagination-container .page-numbers {
  display: inline-flex;
  list-style: none;
  padding: 0;
  gap: 0.5rem;
  justify-content: center;
}

.pagination-container .page-numbers li {
  display: inline-block;
}

.pagination-container .page-numbers a,
.pagination-container .page-numbers span {
  padding: 8px 16px;
  border-radius: 8px;
  /* border: 1px solid #ddd; */
  text-decoration: none;
  display: inline-block;
  color: var(--color-brown-dark);
  transition: all 0.2s ease-in-out;
}

.pagination-container .page-numbers .current {
  background-color: var(--color-brown-dark);
  color: var(--color-green-light);
  border-color: var(--color-brown-dark);
}

.pagination-container .page-numbers a:hover {
  background-color: var(--color-brown-dark);
  color: var(--color-green-light);
  border-color: var(--color-brown-dark);
}

.page-numbers .next,
.page-numbers .prev {
  display: none !important;
}

.post-item .post-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

/* Handle nested links properly */
.post-item .post-item-link .cat-links a {
  position: relative;
  z-index: 2;
}

.post-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1.1;
  /* Fallback for browsers that don't support aspect-ratio */
  height: 0;
  padding-bottom: 110%; /* 1.1 ratio (110%) */
  width: 100%;
}

.post-item-inner {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

/* Rest of the CSS stays the same */
.post-thumbnail-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-brown-dark);
  opacity: 0.5;
}

.cat-links {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.cat-links .btn-pil {
  width: fit-content;
}

.entry-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 24px;
  color: white;
}

.post-title a {
  text-decoration: none;
}

.post-title a {
  text-decoration: none;
}

.post-title .title-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.post-title h3 {
  transition: all 0.3s ease;
}

.post-title .chevron-icon {
  color: var(--color-green-light);
  font-size: 1.33rem;
  padding-bottom: 6px;
}

/* Desktop styles - show chevron on hover with animation */
@media (min-width: 769px) {
  .post-title .title-content {
    position: relative;
  }

  .post-title .chevron-icon {
    /* position: absolute;
    right: 20px; */
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
  }

  .entry-content:hover .post-title a .chevron-icon {
    opacity: 1;
    transform: translateX(-4px);
  }

  .entry-content:hover .post-title a h3 {
    transform: translateX(0px);
  }
}

/* XXL Screens (1800px and up) */
@media (min-width: 1800px) {
}

/* XL Screens (1600px-1799px) */
@media (min-width: 1600px) and (max-width: 1799px) {
}

/* Large Screens (1400px-1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
}

/* Medium-Large Screens (1200px-1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
}

/* Small-Medium Screens (max-width: 1199px) */
@media (max-width: 1199px) {
}

/* Small Screens (max-width: 992px) */
@media (max-width: 992px) {
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
  .featured-posts-wrapper {
    margin-top: 120px;
  }

  #featured-posts {
    grid-template-columns: 1fr;
    height: auto;
    /* Allow height to adapt on mobile */
  }

  .featured-posts-wrapper .posts-header {
    margin-bottom: 12px;
  }

  #featured-posts:has(.post-item:nth-child(2):hover),
  #featured-posts:has(.post-item:nth-child(3):hover) {
    grid-template-columns: 1fr;
  }

  .post-title .title-content {
    justify-content: space-between;
    width: 100%;
  }

  .post-title .chevron-icon {
    margin-left: 10px;
  }

  .posts-wrapper .posts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  #posts {
    grid-template-columns: 1fr;
  }

  #featured-posts .post-item,
  #posts .post-item {
    height: 240px;
    aspect-ratio: unset;
    padding-bottom: unset;
  }

  .pagination-wrapper {
    margin-top: 24px;
    text-align: center;
  }
}
