* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #fff;
  color: #333;
}

h1 {
  text-align: center;
  padding: 30px 20px;
  font-size: 2.5rem;
  color: #333;
}

.gallery1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1300px;
  margin: auto;
}

.gallery1-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gallery1-item.show {
  transform: translateY(0);
  opacity: 1;
}

.gallery1-item img {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
  display: block;
}

.gallery1-item:hover img {
  transform: scale(1.1);
}

.caption1 {
  position: absolute;
  bottom: -100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.8);
  color: #111;
  text-align: center;
  padding: 10px;
  font-size: 1rem;
  transition: bottom 0.4s ease;
  font-weight: 500;
}

.gallery1-item:hover .caption1 {
  bottom: 0;
}

/* Lightbox */
.lightbox1 {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: fadeIn 0.5s ease;
}

.lightbox1.active {
  display: flex;
}

.lightbox1 img {
  max-width: 90%;
  max-height: 70vh;
  border-radius: 15px;
  animation: zoomIn 0.5s ease;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.lightbox1-caption {
  margin-top: 20px;
  text-align: center;
  animation: fadeUp 0.5s ease;
}

.lightbox1-caption a {
  background: #333;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: bold;
  transition: background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.lightbox1-caption a:hover {
  background: #555;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 500px) {
  .lightbox1-caption a {
    padding: 8px 16px;
    font-size: 14px;
  }
}
