.gallery-wrapper {
    padding: 7px;
    max-width: 90vw;
    margin: 0 auto;
    
    /* Masonry columns: fixed column width of ~400px, auto number of columns */
    columns: 400px auto;
    column-gap: 14px;           /* Horizontal gutter */
}

.gallery-item {
    background-color: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;        /* Vertical gutter */
    break-inside: avoid;        /* Prevents item from breaking across columns */
    display: inline-block;      /* Required for proper flow */
    width: 100%;                /* Full width of its column */
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Optional: Force fewer columns on smaller screens if needed */
@media (max-width: 900px) {
    .gallery-wrapper {
        columns: 2;
    }
}

@media (max-width: 600px) {
    .gallery-wrapper {
        columns: 1;
    }
}