h3 {
    text-align: center;
    font-size: 24px;
    color: #333;
  }
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-width: 900px;
    margin: 20px auto;
  }

  .gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 10px;
    position: relative;
  }

  .gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.3s ease, z-index 0.3s ease;
  }

  .gallery-item:hover img {
    transform: scale(1.1); /* Slightly enlarges the image */
    z-index: 10; /* Brings the image on top of the others */
  }

  .description {
    padding: 10px;
    font-size: 14px;
    color: #333;
  }

  .pagination {
    text-align: center;
    margin-top: 20px;
  }

  .pagination button {
    margin: 5px;
    padding: 8px 12px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }

  .pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
  }

  /* Modal Styles */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .modal-content {
    position: relative;
    width: 80vw;
    height: 60vh;
    max-width: 900px;
    max-height: 600px;
    background: #000; /* Black background for empty space */
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .modal-content img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain; /* Keeps the original size without cropping */
    transition: opacity 0.3s ease-in-out;
  }

  .close-btn, .nav-btn {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 30px;
    padding: 12px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
  }

  .close-btn {
    top: 10px;
    right: 10px;
  }

  .close-btn:hover, .nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
  }

  .nav-btn {
    top: 50%;
    transform: translateY(-50%);
  }

  .nav-btn.left {
    left: 10px;
  }

  .nav-btn.right {
    right: 10px;
  }

  /* Responsive Styles */
  @media (max-width: 768px) {
    .gallery {
      grid-template-columns: repeat(2, 1fr);
    }
  }

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