/* ==========================================================================
   ANW Gallery — Masonry layout
   3 columns on desktop (JS-driven, tallest in middle)
   2 columns on tablet + mobile (CSS columns, ≤ 980px)
   ========================================================================== */

.anw-gallery--front {
    --masonry-gap: 16px;
    --masonry-columns: 3;
    width: 100%;
}

.anw-gallery--front .anw-gallery-items {
    display: block !important;
    column-count: var(--masonry-columns);
    column-gap: var(--masonry-gap);
    width: 100%;
    padding: 0;
    margin: 0;
}

.anw-gallery--front .anw-gallery-item {
    display: block !important;
    width: 100% !important;
    margin: 0 0 var(--masonry-gap) !important;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.anw-gallery--front .anw-gallery-item a {
    display: block !important;
    width: 100% !important;
}

.anw-gallery--front .anw-gallery-item img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
}

/* Tablet + mobile: 2 columns via CSS */
@media screen and (max-width: 980px) {
    .anw-gallery--front {
        --masonry-columns: 2;
    }
}

/* JS-driven 3-column layout: flex columns, tallest in middle */
.anw-gallery--front.masonry-js .anw-gallery-items {
    display: flex !important;
    column-count: auto;
    gap: var(--masonry-gap);
    align-items: flex-start;
}

.anw-gallery--front .masonry-column {
    flex: 1 1 0;
    min-width: 0;
}
