.gallery-grid {
    column-count: 2; /* number of columns */
    column-gap: 20px; /* space between columns */
}

.gallery-item {
    break-inside: avoid; /* prevents splitting images between columns */
    margin-bottom: 20px; /* space between items vertically */
    position: relative;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.caption-image .caption {
    font-size: 16px;
}

/* Expand button */
.expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(76, 175, 80, 0.95);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    font-size: 14px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover .expand-btn {
    opacity: 1;
}

.expand-btn:hover {
    background: rgba(69, 160, 73, 1);
    transform: scale(1.05);
}

/* Fullscreen modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.fullscreen-modal.active {
    display: flex;
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fullscreen-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.fullscreen-caption {
    margin-top: 20px;
    color: white;
    font-size: 18px;
    text-align: center;
    max-width: 90%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}

.close-btn:hover {
    background: white;
    transform: scale(1.1);
}

@media screen and (max-width: 768px) {
    .gallery-grid {
        column-count: 1;
    }
    
    .expand-btn {
        display: none; /* Hide button on mobile, allow direct clicking */
    }
    
    .fullscreen-caption {
        font-size: 16px;
    }
}