/* Gallery Block CSS */
.gallery-block {
    position: relative;
}

/* Shared Gallery Item */
.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #eaeaea;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.zoom-icon {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .zoom-icon {
    transform: scale(1);
}

/* Grid Layout */
.gallery-grid {}

/* Masonry Layout */
.gallery-masonry {
    column-count: var(--cols, 3);
    column-gap: 1rem;
}

.gallery-masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    aspect-ratio: unset;
    border-radius: 1rem;
}

.gallery-masonry .gallery-item img {
    height: auto;
}

.gallery-swiper {
    width: 100%;
    padding-bottom: 3rem !important;
    overflow: hidden;
}

.gallery-swiper.swiper-centered .swiper-slide {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0.55;
}

.gallery-swiper.swiper-centered .swiper-slide-active {
    opacity: 1;
    transform: scale(1.02);
    z-index: 10;
}

.gallery-swiper .swiper-slide .gallery-item {
    height: 380px;
    aspect-ratio: unset;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.gallery-swiper .swiper-slide .gallery-item.aspect-portrait {
    aspect-ratio: 3/4 !important;
    height: 420px !important;
}

.gallery-swiper .swiper-slide .gallery-item.aspect-square {
    aspect-ratio: 1/1 !important;
    height: 360px !important;
}

.gallery-swiper .swiper-slide .gallery-item.aspect-landscape {
    aspect-ratio: 4/3 !important;
    height: 300px !important;
}

.gallery-swiper .swiper-slide .gallery-item.aspect-tall {
    aspect-ratio: 2/3 !important;
    height: 460px !important;
}

.gallery-swiper .swiper-button-prev,
.gallery-swiper .swiper-button-next {
    color: var(--primary-color);
}

.gallery-swiper .swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
}

/* Lightbox Overlay */
.gallery-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gallery-lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-img-wrapper {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    padding: 0.5rem;
    outline: none;
    transition: color 0.2s;
}

.gallery-lightbox-close {
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
}

.gallery-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    color: var(--primary-color);
}

@media (max-width: 767.98px) {
    .gallery-masonry {
        column-count: 2 !important;
    }
    .gallery-masonry .gallery-item {
        aspect-ratio: 1/1 !important;
    }
    .gallery-masonry .gallery-item img {
        height: 100% !important;
        object-fit: cover !important;
    }
}

@media (max-width: 575.98px) {
    .gallery-masonry {
        column-count: 1 !important;
    }
}
