body {
  font-family: 'Arial', sans-serif;
  background-color: #f9fafb;
  margin: 0;
  padding: 0;
}

.masonry-grid {
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.masonry-item {
  margin-bottom: 1.5rem;
  width: 23%;
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

.masonry-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.masonry-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.lightbox img.active {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #3b82f6;
}

.nav-btn {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-btn.active {
  background-color: #3b82f6;
  color: white;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .masonry-item {
    width: 31%;
  }
}

@media (max-width: 768px) {
  .masonry-item {
    width: 48%;
  }
}

@media (max-width: 480px) {
  .masonry-item {
    width: 100%;
  }
}