.masonry-gallery {
  /* Limits the maximum width and centers the gallery */
  max-width: 90rem;
  margin: 0 auto;
  
  /* Creates the 3-column masonry layout */
  column-count: 3;
  column-gap: 1.5rem;
  padding: 1.5rem; /* Optional: prevents images from touching the screen edges */
}

.masonry-item {
  display: inline-block;
  width: 100%; 
  position: relative;
  break-inside: avoid;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background-color: #ff8c8c; /* Placeholder color while loading */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.masonry-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hover Overlay Setup */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(77, 77, 77, 0.528); /* Darkens the image */
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

.masonry-text {
  color: #ffffff;
  text-align: center;
  padding: 1rem;
  font-family: Montserrat;

}

.project-name {
  display: block;
  font-weight: 400;
  font-size: 1 rem;
  margin-bottom: 0.5rem;
  
}

.project-role {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
}

/* Responsive Breakpoints */
@media screen and (max-width: 1024px) {
  .masonry-gallery {
    column-count: 2;
  }
}

@media screen and (max-width: 600px) {
  .masonry-gallery {
    column-count: 1;
  }
}