/* Grid Layout */
#projectContainer {
  display: grid;
  grid-template-columns: repeat(3, 20rem); /* Reduced from 26.25rem */
  gap: 2rem; /* Reduced from 3rem */
  overflow: visible;
  height: 100% !important;
  justify-content: center;
  align-content: center;
  max-width: 75rem; /* 1200px */
}

/* Project Card Styles */
.grid-item {
  position: relative;
  width: 20rem !important; /* Reduced from 25rem */
  height: 25rem !important; /* Reduced from 31.25rem */
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  padding: 2rem; /* Reduced from 3rem */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.grid-item:hover {
  transform: translateY(-0.3125rem); /* -5px */
  box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.15); /* 0 8px 25px */
}

.grid-item img {
  display: block;
  width: 14rem !important; /* Reduced from 18.75rem */
  height: 10rem !important; /* Reduced from 12.5rem */
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-left: auto;
  margin-right: auto;
}

.grid-item:hover img {
  opacity: 1;
  transform: scale(1.05);
}

.grid-item article {
  position: relative;
  padding: 0;
  background: none;
  color: #fff;
  width: 100%;
  overflow: hidden;
}

.grid-item h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #333333;
  text-shadow: none;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
  min-height: 2.4em;
  padding-bottom: 2rem;
}

.grid-item h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 520;
  color: #666666;
  line-height: 1.6;
  text-shadow: none;
  overflow: hidden;
}

/* Large Screens */
@media (min-width: 87.5rem) {
  /* 1400px */
  #projectContainer {
    grid-template-columns: repeat(3, 22rem);
    gap: 3rem;
    max-width: 75rem;
  }

  .grid-item {
    width: 26.25rem !important;
    height: 31.25rem !important;
    padding: 3rem;
  }

  .grid-item img {
    width: 18.75rem !important;
    height: 12.5rem !important;
  }
}

/* Medium Screens */
@media (max-width: 71.25rem) {
  /* 1140px */
  #projectContainer {
    grid-template-columns: repeat(2, 22.5rem);
    gap: 1.5rem;
  }

  .grid-item {
    height: 25rem !important;
    padding: 1.5rem;
  }

  .grid-item img {
    width: 16.25rem !important;
    height: 11.25rem !important;
  }

  .grid-item h2 {
    font-size: 1.6rem;
    min-height: 2.2em;
  }
}

/* Small Screens */
@media (max-width: 47.9375rem) {
  /* 767px */
  #projectContainer {
    grid-template-columns: 22.5rem;
    gap: 1rem;
    max-width: 100%;
    padding: 0 1rem;
  }

  .grid-item {
    width: 100% !important;
    max-width: 22.5rem;
    height: 23.75rem !important;
    padding: 1.25rem;
    margin: 0 auto;
  }

  .grid-item img {
    width: 15rem !important;
    height: 10rem !important;
  }

  .grid-item h2 {
    font-size: 1.4rem;
    min-height: 2em;
  }

  .grid-item h4 {
    font-size: 0.95rem;
  }
}

#projectcontent,
#pageContainer {
  overflow: visible; /* Ensure overflow is not hidden */
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.page-item {
  margin: 0 5px;
}

.page-a {
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
}

.page-a:hover {
  background-color: #f5f5f5;
}

.page-a.active {
  background-color: #39c0ba;
  color: #fff;
  border-color: #39c0ba;
}
