body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f7f7f7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 2em;
  max-width: 1400px;
  margin: auto;
}

.gallery-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
  transform: translateY(-5px);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item p {
  padding: 0.8em;
  font-size: 14px;
  background-color: #fff;
  margin: 0;
  border-top: 1px solid #eee;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  background-color: #fff;
  padding: 1em;
  border-radius: 10px;
}

.lightbox-content img {
  max-width: 100%;
  height: auto;
}

.lightbox-content p {
  margin-top: 1em;
  font-size: 16px;
  color: #333;
}

.nav-buttons {
  margin-top: 1em;
}

.nav-buttons button {
  background: none;
  border: none;
  font-size: 2em;
  margin: 0 1em;
  cursor: pointer;
}

.close {
  position: absolute;
  right: 1em;
  top: 0.5em;
  font-size: 2em;
  color: #333;
  cursor: pointer;
}
@media (max-width: 768px) {
  .gallery-grid {
    padding: 1em;
    gap: 12px;
  }

  .gallery-item p {
    font-size: 13px;
    padding: 0.6em;
  }

  .lightbox-content {
    padding: 0.5em;
    border-radius: 6px;
  }

  .lightbox-content p {
    font-size: 14px;
  }

  .nav-buttons button {
    font-size: 1.5em;
    margin: 0 0.5em;
  }

  .close {
    font-size: 1.5em;
    top: 0.25em;
    right: 0.5em;
  }
}

@media (max-width: 480px) {
  .gallery-item p {
    font-size: 12px;
  }

  .lightbox-content p {
    font-size: 13px;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  @media (max-width: 480px) {
    .gallery-grid {
      grid-template-columns: 1fr;
    }

    .lightbox-content {
      padding: 0.4em;
    }
  }

