* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: radial-gradient(circle, #FFCA28 0%, #26A69A 100%);
  min-height: 100vh;
  font-family: 'Lora', serif;
  color: #333;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 20px 0;
}

h1 {
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-grow: 1;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .caption {
  opacity: 1;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: auto;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal img {
  max-width: 90%;
  max-height: 70%;
  border-radius: 10px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.modal.show img {
  transform: scale(1);
}

.modal-caption {
  position: absolute;
  bottom: 10%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1rem;
  text-align: center;
}

.close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #FFCA28;
}

.close:focus, .nav:focus {
  outline: 2px solid #FFCA28;
  outline-offset: 2px;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.nav:hover {
  background: #FFCA28;
  color: #000;
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

footer {
  text-align: center;
  padding: 15px 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1rem;
  width: 100%;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

footer li {
  margin: 5px 0;
  color: #fff;
  font-size: 0.95rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .gallery-item img {
    height: 150px;
  }

  .modal img {
    max-width: 95%;
    max-height: 60%;
  }

  .modal-caption {
    font-size: 0.9rem;
    bottom: 5%;
  }

  .nav {
    padding: 8px 15px;
    font-size: 1.2rem;
  }

  footer {
    font-size: 0.9rem;
    padding: 10px 0;
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery-item img {
    height: 200px;
  }

  footer {
    font-size: 0.8rem;
  }
}