/* Homepage gallery: maintain a consistent layout while photographs are being added. */
.gallery .gallery-item--pending {
    isolation: isolate;
    background: linear-gradient(140deg, #0b3654 5%, #036b96 70%, #139cca 100%);
}

.gallery .gallery-item--pending::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 22%, rgba(184, 230, 249, .23), transparent 40%),
        radial-gradient(circle at 16% 68%, rgba(10, 42, 70, .34), transparent 50%);
    pointer-events: none;
}

.gallery .gallery-item--pending::after {
    background: linear-gradient(180deg, rgba(5, 34, 53, .05) 25%, rgba(5, 34, 53, .75) 100%);
}

.gallery .gallery-item--pending .gallery-caption span {
    color: rgba(255, 255, 255, .88);
}

/* Four-photo homepage preview. The complete gallery lives on gallery.php. */
.gallery .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(220px, 28vw, 360px);
    gap: 16px;
}

.gallery .gallery-grid .gallery-item:first-child,
.gallery .gallery-grid .gallery-item:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
}

.gallery .gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery .home-centered-action {
    margin-top: 32px;
    text-align: center;
}

.gallery .home-centered-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
}

@media (max-width: 700px) {
    .gallery .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: 275px;
        gap: 15px;
    }

    .gallery .gallery-grid .gallery-item:first-child {
        min-height: 0;
    }

    .gallery .home-centered-action .btn {
        max-width: 100%;
    }
}
