.animated-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.animated-gallery li {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 0;
  transition: opacity 1s ease-in-out;
}

.animated-gallery li.active {
  opacity: 1;
  z-index: 1;
}

.slide-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
}

.slide-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  display: block;
}

.caption {
  position: absolute;
  bottom: 5%;
  left: 5%;
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
  max-width: 90%;
  z-index: 2;
}
.caption h2,
.caption p {
  transition: color 0.5s ease, opacity 0.5s ease;
}

.caption h2 {
  transition-delay: 0s;
}

.caption p {
  transition-delay: 0.5s;
  opacity: .5;

}

.animated-gallery li.active .caption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 1rem;
}

.gallery-controls button {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 0.3rem;
  transition: background 0.3s ease;
}

.gallery-controls button:hover {
  background: rgba(255,255,255,0.2);
}

.gallery-counter {
  position: absolute;
  top: 10%;
  left: 10%;
  z-index: 10;
  color: #fff;
}