body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
}
h1 {
  text-align: center;
  margin-top: 20px;
}
.gallery {
  display: grid;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: repeat(4, 1fr); /* Default 4 columns for large screens */
}
.gallery-item {
  position: relative;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
  cursor: pointer;
}
.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}
.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top center; /* Focus on the top part of images where faces usually are */
  transition: transform 0.3s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-item p {
  margin: 0;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.95);
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
}
/* Modal styles for image preview */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain; /* Keep contain for modal view to show full image */
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
}
/* Responsive breakpoints */
@media (max-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr); /* 3 columns for medium-large screens */
  }
  .gallery-item img {
    height: 260px;
  }
}
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
  }
  .gallery-item img {
    height: 240px;
  }
}
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(1, 1fr); /* 1 column for mobile */
    gap: 15px;
    padding: 15px;
  }
  .gallery-item img {
    height: 350px; /* Increased height for mobile screens */
  }
  .gallery-item p {
    font-size: 13px;
    padding: 10px;
  }
}
