/* Projects title on the home page */
.home-projects-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-projects-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.page_category-home .main-content .featured-posts {
  display: flex;
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically (if needed) */
  flex-wrap: wrap; /* Allows items to wrap onto multiple lines */
  gap: 2rem; /*adds gap between the flex items, adjust the value as needed*/
}

/* Elements button styling */
.page_category-home .elements-button {
  border: solid 1px var(--wp--preset--color--ar-color-primary-04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  max-width: 520px; /* Consistent max-width across screen sizes */
  min-height: 480px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.page_category-home .elements-button img {
  width: 100%;
  height: 400px;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  -o-object-fit: cover;
  object-fit: cover;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.page_category-home .elements-button img:hover {
  -webkit-filter: grayscale(0);
  filter: grayscale(0);
  transition: all 0.3s ease;
}

.page_category-home .elements-button::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: calc(100% - 32px);
  height: 400px;
  background-color: #6F8BFF;
  opacity: 0.2;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 4px;
}

.page_category-home .elements-button:hover::after {
  opacity: 0;
  -webkit-filter: grayscale(0);
  filter: grayscale(0);
}

.page_category-home .elements-button h2 {
  margin: 16px 0 0 0;
  padding: 0 8px;
  font-size: 24px;
  line-height: 32px;
  font-family: 'Trench Slab Variable', serif;
  font-weight: 300;
  color: var(--wp--preset--color--ar-color-secondary-05);
  min-height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  word-wrap: break-word;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Media queries for responsive layout */
@media (min-width: 1300px) {
  .page_category-home .featured-posts {
    display: grid;
    grid-template-columns: repeat(4, minmax(300px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 1200px) {
  .page_category-home .featured-posts {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .page_category-home .featured-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .page_category-home .elements-button img,
  .page_category-home .elements-button::after {
    height: 370px;
  }

  .page_category-home .elements-button h2 {
    font-size: 20px;
    line-height: 28px;
  }
}

/* Ensure individual buttons stay centered */
.page_category-home .elements-button {
  justify-self: center;
  width: 100%;
  max-width: 520px;
}
