/* =========================================================
   GALLERY GRID
========================================================= */

.custom-envira-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 12px auto 32px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

.custom-envira-gallery.single {
    display: block;
}

.custom-envira-gallery a {
    cursor: pointer;
    display: block;
}

@media (max-width: 768px) {
    .custom-envira-gallery {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   GALLERY ITEMS
========================================================= */

.custom-envira-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: transform .25s ease, box-shadow .25s ease;
}

.custom-envira-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,.15);
}

.custom-envira-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    transition: transform .35s ease;
}

.custom-envira-item:hover img {
    transform: scale(1.04);
}

/* =========================================================
   CAPTION (grid cards)
========================================================= */

.custom-envira-caption {
    padding: 12px 14px;
    font-family: Mate, "Work Sans", serif;
    font-size: .88em;
    line-height: 1.4;
    text-align: left;
    color: #333;
    background: #f5f1e8;
    border-top: 1px solid rgba(0,0,0,.06);
}

.custom-envira-gallery.single .custom-envira-caption {
    font-style: italic;
    color: #555;
    text-align: center;
}

/* =========================================================
   FANCYBOX v4 overrides
========================================================= */

/* Darker backdrop */
.fancybox__backdrop {
    background: rgba(15,10,5,.94) !important;
}

/* Image styling */
.fancybox__image {
    border-radius: 8px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,.5) !important;
}

/* Caption */
.fancybox__caption {
    padding: 10px 16px;
    font-family: Mate, serif;
    font-size: .88em;
    line-height: 1.45;
    color: #eee;
    text-align: center;
    background: transparent;
}

/* =========================================================
   HIDE FLOATING MAP BUTTON WHEN LIGHTBOX IS OPEN
========================================================= */

body.fancybox-active #floating-map-button {
    display: none !important;
}

/* =========================================================
   ANIMATIONS
========================================================= */

.fancybox-fadeInScale {
    animation: fadeInScale .22s ease forwards;
}

.fancybox-fadeOutScale {
    animation: fadeOutScale .18s ease forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeOutScale {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.96); }
}
