/* Общие стили для блока */
.ei-cpgb-gallery-block {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

/* Стили для сетки */
.ei-cpgb-gallery-grid {
    display: grid;
    gap: 15px; /* Расстояние между элементами */
}

/* Настройки для десктопов */
@media (min-width: 769px) {
    .ei-cpgb-gallery-grid {
        grid-template-columns: repeat(var(--desktop-columns), 1fr);
    }
}

/* Настройки для мобильных устройств */
@media (max-width: 768px) {
    .ei-cpgb-gallery-grid {
        grid-template-columns: repeat(var(--mobile-columns), 1fr);
    }
}

/* Стили для галереи */
.ei-cpgb-gallery-item img {
    width: 100%; /* Занимает всю ширину контейнера */
    height: auto; /* Автоматическая высота по умолчанию */
}

/* Стили для квадратных изображений */
.ei-cpgb-gallery-item.square img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    max-height: var(--max-square-height, 500px); /* По умолчанию 500px */
}

/* Стили для слайдера */
.ei-cpgb-gallery-slider img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.ei-cpgb-gallery-slider .ei-cpgb-gallery-item{margin: 10px;}
.ei-cpgb-gallery-slider .ei-cpgb-gallery-item p{font-size: 16px;font-weight: bold;margin-top: 10px;padding: 0 10px;}

/* Стили для Lightbox */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-caption {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 3px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
}

.lightbox-close {
    right: 10px;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 50px;
}