/*
Theme Name: Global Brigades
Theme URI: https://www.globalbrigades.org/
Description: Child theme for Divi
Author: Global Brigades
Author URI: https://www.globalbrigades.org/
Template: Divi
Version: 1.0.0
Text Domain: global-brigades
*/


/* =========================================================
   PROGRAM GALLERY
   ========================================================= */

.program-gallery {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    grid-template-rows: repeat(4, 150px);
    gap: 14px;
    width: 100%;
}

.program-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border: 0;
    padding: 0;
    border-radius: 16px;
    background: #eee;
    cursor: pointer;
}

.program-gallery-item-1 {
    grid-column: 1;
    grid-row: 1 / span 3;
}

.program-gallery-item-2 {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.program-gallery-item-3 {
    grid-column: 2;
    grid-row: 3;
}

.program-gallery-item-4 {
    grid-column: 1;
    grid-row: 4;
}

.program-gallery-item-5 {
    grid-column: 2;
    grid-row: 4;
}

.program-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.program-gallery-item:hover .program-gallery-image {
    transform: scale(1.035);
}

.program-gallery-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 28, 80, 0.62);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    backdrop-filter: blur(2px);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    .program-gallery {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, 220px);
    }

    .program-gallery-item-1 {
        grid-column: 1 / span 2;
        grid-row: 1;
    }

    .program-gallery-item-2 {
        grid-column: 1;
        grid-row: 2;
    }

    .program-gallery-item-3 {
        grid-column: 2;
        grid-row: 2;
    }

    .program-gallery-item-4 {
        grid-column: 1;
        grid-row: 3;
    }

    .program-gallery-item-5 {
        grid-column: 2;
        grid-row: 3;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .program-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 12px;
    }

    .program-gallery-item,
    .program-gallery-item-1,
    .program-gallery-item-2,
    .program-gallery-item-3,
    .program-gallery-item-4,
    .program-gallery-item-5 {
        grid-column: auto;
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }

}


/* =========================================================
   LIGHTBOX
   ========================================================= */

.program-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 25, 0.94);
    padding: 40px 90px;
}

.program-lightbox.active {
    display: flex;
}

.program-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.program-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
}

.program-lightbox-counter {
    margin-top: 16px;
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

.program-lightbox-close,
.program-lightbox-prev,
.program-lightbox-next {
    position: absolute;
    z-index: 2;
    border: 0;
    padding: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.program-lightbox-close {
    top: 20px;
    right: 28px;
    font-size: 44px;
    line-height: 1;
}

.program-lightbox-prev,
.program-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 64px;
    line-height: 1;
}

.program-lightbox-prev {
    left: 28px;
}

.program-lightbox-next {
    right: 28px;
}

.program-lightbox-close:hover,
.program-lightbox-prev:hover,
.program-lightbox-next:hover {
    opacity: 0.7;
}

.program-lightbox-open {
    overflow: hidden;
}


/* =========================================================
   LIGHTBOX MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .program-lightbox {
        padding: 30px 12px;
    }

    .program-lightbox-image {
        max-width: 94vw;
        max-height: 80vh;
    }

    .program-lightbox-prev {
        left: 8px;
    }

    .program-lightbox-next {
        right: 8px;
    }

    .program-lightbox-prev,
    .program-lightbox-next {
        font-size: 48px;
    }

    .program-lightbox-close {
        top: 10px;
        right: 14px;
        font-size: 38px;
    }

}

/** Country program navigation logic */

/* Frontend only */
body:not(.et-fb) .country-program-panel {
    display: none;
}

body:not(.et-fb) .country-program-panel.active {
    display: block;
}

/* Active filter */
.country-filter.active {
    background: #e83e8c;
    color: #fff;
}

/* Divi Visual Builder: show all panels */
body.et-fb .country-program-panel {
    display: block !important;
}

/* =========================================================
   LODGING GALLERY
   ========================================================= */

.lodging-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.lodging-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.lodging-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.lodging-gallery-item:hover .lodging-gallery-image {
    transform: scale(1.035);
}

.lodging-gallery-more {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(20, 28, 80, .60);
    color: #fff;

    font-size: 22px;
    font-weight: 700;
}


/* Tablet */

@media (max-width: 980px) {

    .lodging-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* Mobile */

@media (max-width: 767px) {

    .lodging-gallery {
        gap: 10px;
    }

}

/** Scroll country program navigation buttons  */
.country-program-panel {
    scroll-margin-top: 120px;
}

@media (max-width: 980px) {
    .country-program-panel {
        scroll-margin-top: 100px;
    }
}

@media (max-width: 767px) {
    .country-program-panel {
        scroll-margin-top: 80px;
    }
}