/* --- Gallery Page Specific Styles --- */

.gallery-section {
    padding: 60px 15px;
}

.gallery-grid {
    display: grid;
    /* Default: 4 columns on desktop */
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.gallery-image {
    width: 100%;
    /* Create square or uniform aspect ratio */
    padding-top: 100%; 
    background-size: cover;
    background-position: center;
    transition: transform 0.5s;
}

/* Zoom effect on hover */
.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(56, 118, 29, 0.6); /* Dark Green overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay i {
    color: white;
    font-size: 2em;
}

/* --- Modal (Lightbox) Styles --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

/* Modal Content (Image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    animation-name: zoom;
    animation-duration: 0.6s;
}

/* Caption of Modal Image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
}

/* Add Animation */
@keyframes zoom {
    from {transform: scale(0)} 
    to {transform: scale(1)}
}

/* --- Responsiveness --- */

/* Tablet View: 3 columns */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Mobile View: 2 columns */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .modal-content {
        width: 95%; /* Make modal image fill more screen space */
    }
}