/* ── Photos: masonry layout ──────────────────────────────────── */

/* Reset WordPress gallery flex/grid so CSS columns takes over */
.photos-gallery .wp-block-gallery.has-nested-images,
.photos-gallery .wp-block-gallery.has-nested-images.columns-3 {
    display: block !important;
    column-count: 3 !important;
    column-gap: 1rem !important;
    width: 100% !important;
    max-width: none !important;
}

/* Each image fills its column slot */
.photos-gallery .wp-block-gallery.has-nested-images .wp-block-image {
    break-inside: avoid !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;   /* override WP flex-basis */
    margin: 0 0 1rem !important;
    padding: 0 !important;
}

.photos-gallery .wp-block-gallery.has-nested-images .wp-block-image figure {
    margin: 0 !important;
    padding: 0 !important;
}

.photos-gallery .wp-block-gallery.has-nested-images .wp-block-image img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 2px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photos-gallery .wp-block-gallery.has-nested-images .wp-block-image:hover img {
    transform: scale(1.025);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

@media (max-width: 900px) {
    .photos-gallery .wp-block-gallery.has-nested-images { column-count: 2 !important; }
}
@media (max-width: 520px) {
    .photos-gallery .wp-block-gallery.has-nested-images { column-count: 1 !important; }
}

/* ── Widen the photos page to fill viewport ──────────────────── */

.photos-gallery {
    max-width: none !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* ── Fade-up on scroll ─────────────────────────────────────── */

.photos-gallery .wp-block-image {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.photos-gallery .wp-block-image.is-visible {
    opacity: 1;
    transform: translateY(0);
}
