/* Basic Reset & Body Styling */


h1 {
    text-align: center;
    color: #333;
}

/* Gallery Grid Styling */
.gallery-grid {
    display: grid;
    /* Creates columns that are at least 150px wide, but expand to fill space */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px; /* Space between grid items */
    padding: 10px;
    max-width: 1200px; /* Optional: Max width for the gallery */
    margin: 20px auto; /* Center the gallery */
}

.gallery-item img {
    width: 100%; /* Make images fill their container */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below image */
    border-radius: 4px; /* Slightly rounded corners */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Smooth transition on hover */
    cursor: pointer;
    aspect-ratio: 1 / 1; /* Make images square-ish like the example */
    object-fit: cover; /* Cover the area without distorting aspect ratio */
}

.gallery-item:hover img {
    transform: scale(1.05); /* Slightly enlarge image on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow on hover */
}


/* Lightbox Modal Styling */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

/* Modal Content (Image) */
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh; /* Limit height to viewport height */
    animation-name: zoom;
    animation-duration: 0.4s;
}

/* Animation */
@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Caption Text */
#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    height: 50px; /* Reserve space for caption */
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Prev/Next Buttons */
.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Adjust vertically */
    color: white;
    font-weight: bold;
    font-size: 25px;
    transition: 0.4s ease;
    border-radius: 0 3px 3px 0;
    user-select: none; /* Prevent text selection */
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent background */
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.lightbox-prev {
    left: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.6); /* Darker background on hover */
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .lightbox-content {
        max-width: 95%; /* Use more width on smaller screens */
    }
     .gallery-grid {
        /* Adjust columns for smaller screens */
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 5px;
    }
    .lightbox-prev,
    .lightbox-next {
        font-size: 18px;
        padding: 10px;
    }
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}