/* Masonry Lightbox Slider Widget Styles */

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

.gallery .gallery__track {
    display: grid;
    gap: 0px;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 220px;
    grid-template-areas:
        "a b b c d"
        "e f g g d"
        "e f h h i";
}

.gallery .m-a { grid-area: a; }
.gallery .m-b { grid-area: b; }
.gallery .m-c { grid-area: c; }
.gallery .m-d { grid-area: d; }
.gallery .m-e { grid-area: e; }
.gallery .m-f { grid-area: f; }
.gallery .m-g { grid-area: g; }
.gallery .m-h { grid-area: h; }
.gallery .m-i { grid-area: i; }

.gallery .gallery__item {
    width: 100%;
    height: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0;
    margin: 0;
    background: transparent;
    display: block;
    cursor: pointer;
    overflow: hidden;
}

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

@media (hover: hover) {
    .gallery .gallery__item img {
        transition:
            transform 0.22s ease,
            filter 0.22s ease;
    }

    .gallery .gallery__item:hover img {
        transform: scale(1.02);
        filter: brightness(1.03);
    }
}

/* ================= MODAL ================= */

#gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    overflow: auto;
    background: rgba(0, 0, 0, 0.9);
    padding: 40px 0;
}

#gallery-modal .modal-content {
    position: relative;
    margin: auto;
    width: min(1200px, 92vw);
    background: transparent;
}

#gallery-modal .close {
    color: #fff;
    position: fixed;
    top: 14px;
    right: 22px;
    font-size: 38px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

#gallery-modal .close:hover {
    color: #bbb;
}

#gallery-modal .mySlides {
    display: none;
    position: relative;
}

#gallery-modal .numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
    left: 0;
}

#gallery-modal .mySlides img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 220px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

#gallery-modal .prev,
#gallery-modal .next {
    cursor: pointer;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    user-select: none;
    -webkit-user-select: none;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    transition: all 0.22s ease-in-out;
}

#gallery-modal .prev {
    left: 16px;
}

#gallery-modal .next {
    right: 16px;
}

#gallery-modal .prev:hover,
#gallery-modal .next:hover {
    color: #ffaf02;
    background: rgba(0, 0, 0, 0.55);
}

#gallery-modal .caption-container {
    text-align: center;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
}

#gallery-modal .modal-thumbs {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 0 0;
}

#gallery-modal .modal-thumbs img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    opacity: 0.6;
    cursor: pointer;
    border-radius: 10px;
}

#gallery-modal .modal-thumbs img.active,
#gallery-modal .modal-thumbs img:hover {
    opacity: 1;
}

.gallery .swiper-button-prev,
.gallery .swiper-button-next {
  display: none !important;
}

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

@media (max-width: 1024px) {
    #gallery-modal {
        display: none !important;
    }
	.gallery {
		padding-bottom: 30px;
	}
	
    .gallery .gallery__swiper {
        position: relative;
        height: calc(100svh - 20px);
        max-height: calc(70dvh - 20px);
        overflow: hidden;
		padding: 60px 0;
    }

    .gallery .gallery__track.swiper-wrapper {
        height: 100%;
        display: flex;
    }

    .gallery .gallery__item.swiper-slide {
        height: 100%;
        display: flex;
    }

    .gallery .gallery__item.swiper-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .gallery .swiper-button-next,
    .gallery .swiper-button-prev {
        color: #ffffff !important;
    }

    .gallery .swiper-pagination {
        position: absolute !important;
        left: 0;
        right: 0;
        bottom: 0 !important;
        z-index: 10;
        margin: 0 !important;
        padding: 0 !important;
    }

	.gallery .swiper-pagination-bullet {
		width: 15px;
		height: 15px;
	}
	
    .gallery .swiper-pagination-bullet-active {
        background: #000 !important;
    }

    .gallery .gallery__swiper:focus {
        outline: none;
    }

    .gallery .gallery__swiper::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        pointer-events: none;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }

    .gallery .lightbox {
        display: none !important;
    }
	.gallery .swiper-button-prev,
	.gallery .swiper-button-next {
		display: flex !important;
	 }
	
	.gallery .swiper-button-prev svg,
	.gallery .swiper-button-next svg {
		display: none;
	}
}
