/* task-slider.css v2.0 - Полная версия с улучшенными стилями */

/* ========================================================================= */
/* 1. Основной контейнер галереи                                            */
/* ========================================================================= */
.gallery-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.gallery {
    width: 100%;
    position: relative;
    z-index: 1;
}

.gallery.swiper {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    z-index: 1;
    background: transparent !important;
}

/* Принудительная очистка всех возможных наложений */
.gallery.swiper::before,
.gallery.swiper::after,
.gallery .swiper-wrapper::before,
.gallery .swiper-wrapper::after {
    display: none !important;
    content: none !important;
}

.gallery .swiper-wrapper {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

/* ========================================================================= */
/* 2. Слайды и изображения                                                  */
/* ========================================================================= */
.gallery .swiper-slide {
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    position: relative;
    z-index: 2;
    overflow: visible;
}

/* Принудительная очистка слайдов от любых наложений */
.gallery .swiper-slide::before,
.gallery .swiper-slide::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    user-select: none;
    position: relative;
    z-index: 3;
    background: transparent !important;
}

.gallery-img:hover {
    opacity: 0.9;
}

.gallery-img:active {
    opacity: 0.8;
}

/* ========================================================================= */
/* 3. Навигационные стрелки для галереи                                     */
/* ========================================================================= */
.gallery .swiper-button-next,
.gallery .swiper-button-prev {
    color: var(--color-1);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.gallery:hover .swiper-button-next,
.gallery:hover .swiper-button-prev {
    opacity: 1;
    visibility: visible;
}

.gallery .swiper-button-next:hover,
.gallery .swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.gallery .swiper-button-next::after,
.gallery .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-1);
}

.gallery .swiper-button-next {
    right: 8px;
}

.gallery .swiper-button-prev {
    left: 8px;
}

/* ========================================================================= */
/* 4. Десктопная версия - сетка 4x1                                         */
/* ========================================================================= */
@media (min-width: 769px) {
    .gallery .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        transform: none !important;
    }

    .gallery .swiper-slide {
        width: 100% !important;
        margin-right: 0 !important;
        height: 180px;
    }

    .gallery.swiper {
        overflow: visible;
        margin: 0;
        height: auto;
    }

    /* Скрываем стрелки на десктопе */
    .gallery .swiper-button-next,
    .gallery .swiper-button-prev {
        display: none;
    }

    .gallery-container {
        padding: 15px 0;
    }
}

/* ========================================================================= */
/* 5. Планшетная версия                                                     */
/* ========================================================================= */
@media (max-width: 768px) and (min-width: 577px) {
    .gallery.swiper {
        height: 180px;
    }

    .gallery .swiper-slide {
        height: 180px;
    }

    .gallery .swiper-button-next,
    .gallery .swiper-button-prev {
        width: 32px;
        height: 32px;
        margin-top: -16px;
    }

    .gallery .swiper-button-next::after,
    .gallery .swiper-button-prev::after {
        font-size: 12px;
    }
}

/* ========================================================================= */
/* 6. Мобильная версия                                                      */
/* ========================================================================= */
@media (max-width: 576px) {
    .gallery.swiper {
        height: 140px;
    }

    .gallery .swiper-slide {
        height: 140px;
    }

    .gallery .swiper-button-next,
    .gallery .swiper-button-prev {
        width: 28px;
        height: 28px;
        margin-top: -14px;
    }

    .gallery .swiper-button-next::after,
    .gallery .swiper-button-prev::after {
        font-size: 10px;
    }

    .gallery-container {
        padding: 15px 0;
    }
}

/* ========================================================================= */
/* 7. Лайтбокс                                                              */
/* ========================================================================= */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.lightbox-swiper {
    width: 100%;
    height: 100%;
    background: transparent !important;
    z-index: 2002;
}

/* Принудительная очистка лайтбокса */
.lightbox-swiper::before,
.lightbox-swiper::after,
.lightbox .swiper-wrapper::before,
.lightbox .swiper-wrapper::after {
    display: none !important;
    content: none !important;
}

.lightbox-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent !important;
    position: relative;
    z-index: 2003;
}

/* Принудительная очистка слайдов лайтбокса */
.lightbox .swiper-slide::before,
.lightbox .swiper-slide::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    position: relative;
    z-index: 2004;
    background: transparent !important;
}

/* ========================================================================= */
/* 8. Навигация лайтбокса                                                   */
/* ========================================================================= */
.lightbox .swiper-button-next,
.lightbox .swiper-button-prev {
    color: var(--color-1);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.lightbox .swiper-button-next:hover,
.lightbox .swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 1;
}

.lightbox .swiper-button-next::after,
.lightbox .swiper-button-prev::after {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-1);
}

.lightbox .swiper-button-next {
    right: 20px;
}

.lightbox .swiper-button-prev {
    left: 20px;
}

/* ========================================================================= */
/* 9. Кнопка закрытия лайтбокса                                             */
/* ========================================================================= */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-1);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 1;
}

/* ========================================================================= */
/* 10. Адаптивность лайтбокса                                               */
/* ========================================================================= */
@media (max-width: 768px) {
    .lightbox-content {
        width: 95%;
        height: 85%;
    }

    .lightbox .swiper-button-next,
    .lightbox .swiper-button-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }

    .lightbox .swiper-button-next::after,
    .lightbox .swiper-button-prev::after {
        font-size: 16px;
    }

    .lightbox .swiper-button-next {
        right: 10px;
    }

    .lightbox .swiper-button-prev {
        left: 10px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-slide {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .lightbox-content {
        width: 100%;
        height: 90%;
    }

    .lightbox .swiper-button-next,
    .lightbox .swiper-button-prev {
        width: 35px;
        height: 35px;
        margin-top: -17.5px;
    }

    .lightbox .swiper-button-next::after,
    .lightbox .swiper-button-prev::after {
        font-size: 14px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .lightbox-slide {
        padding: 5px;
    }
}

/* ========================================================================= */
/* 11. Специальные эффекты и анимации                                       */
/* ========================================================================= */

/* Плавное появление элементов */
.gallery-container {
    opacity: 1;
}

/* Загружающиеся изображения */
.gallery-img[loading] {
    opacity: 0.7;
}

/* Эффект фокуса для доступности */
.gallery-img:focus,
.lightbox-close:focus,
.lightbox .swiper-button-next:focus,
.lightbox .swiper-button-prev:focus {
    outline: 3px solid var(--color-3);
    outline-offset: 2px;
}

/* Улучшенные переходы для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .gallery-img:hover {
        opacity: 1;
    }

    .gallery-img:active {
        opacity: 0.8;
    }
}

/* ========================================================================= */
/* 13. Принудительная очистка всех возможных артефактов                     */
/* ========================================================================= */

/* Убираем все возможные наложения от Swiper */
.swiper-slide-shadow,
.swiper-slide-shadow-left,
.swiper-slide-shadow-right,
.swiper-slide-shadow-top,
.swiper-slide-shadow-bottom,
.swiper-cube-shadow,
.swiper-3d .swiper-slide-shadow,
.swiper-coverflow .swiper-slide-shadow {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Убираем все transition эффекты которые могут создавать артефакты */
.swiper-slide-duplicate,
.swiper-slide-duplicate-active,
.swiper-slide-duplicate-next,
.swiper-slide-duplicate-prev {
    display: none !important;
}

/* Принудительно убираем любые overlay */
.swiper-wrapper > *::before,
.swiper-wrapper > *::after,
.swiper-slide > *::before,
.swiper-slide > *::after {
    display: none !important;
    content: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* Убираем любые скрытые элементы которые могут создавать тени */
.swiper-pagination,
.swiper-pagination-bullet,
.swiper-pagination-progressbar,
.swiper-scrollbar {
    display: none !important;
}

/* Принудительная очистка background для всех элементов swiper */
.swiper,
.swiper-wrapper,
.swiper-slide,
.gallery .swiper,
.gallery .swiper-wrapper,
.gallery .swiper-slide,
.lightbox .swiper,
.lightbox .swiper-wrapper,
.lightbox .swiper-slide {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ========================================================================= */
/* 14. Кнопки навигации - состояния                                         */
/* ========================================================================= */

/* Отключенные кнопки навигации */
.swiper-button-disabled {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Плавный переход для кнопок */
.gallery .swiper-button-next,
.gallery .swiper-button-prev {
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.lightbox .swiper-button-next,
.lightbox .swiper-button-prev {
    transition: opacity 0.3s ease !important;
}

/* ========================================================================= */
/* 14. Индикаторы и счетчики                                                */
/* ========================================================================= */

/* Счетчик изображений в лайтбоксе */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--color-1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2001;
}

@media (max-width: 576px) {
    .lightbox-counter {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}