/**
 * Фронтенд слайдера. Геометрия кадра приходит из PHP-констант через
 * --ses-frame-* (см. SES_Simple_Slider::frame_css_vars()).
 */

.ses-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: transparent;
}

.ses-slider__track {
    display: flex;
    transition: transform 0.35s ease;
    will-change: transform;
}

.ses-slider__slide {
    box-sizing: border-box;
    padding: 0;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

.ses-slider__link {
    display: block;
    width: 100%;
    margin: 0;
    color: transparent;
    text-decoration: none;
    font-size: 0;
    line-height: 0;
}

/* Кадр всегда на всю ширину; фокус/зум только кадрируют картинку */
.ses-slider__frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--ses-frame-w, 1920) / var(--ses-frame-h, 530);
    min-height: var(--ses-frame-min-h, 250px);
    overflow: hidden;
    background: #000;
    --ses-focus-x: var(--ses-d-x, 50%);
    --ses-focus-y: var(--ses-d-y, 50%);
    --ses-focus-zoom: var(--ses-d-zoom, 1);
    --ses-focus-x-ratio: var(--ses-d-xr, 0.5);
    --ses-focus-y-ratio: var(--ses-d-yr, 0.5);
}

@media (max-width: 1024px) {
    .ses-slider__frame {
        --ses-focus-x: var(--ses-t-x, var(--ses-d-x, 50%));
        --ses-focus-y: var(--ses-t-y, var(--ses-d-y, 50%));
        --ses-focus-zoom: var(--ses-t-zoom, var(--ses-d-zoom, 1));
        --ses-focus-x-ratio: var(--ses-t-xr, var(--ses-d-xr, 0.5));
        --ses-focus-y-ratio: var(--ses-t-yr, var(--ses-d-yr, 0.5));
    }
}

@media (max-width: 767px) {
    .ses-slider__frame {
        --ses-focus-x: var(--ses-m-x, var(--ses-d-x, 50%));
        --ses-focus-y: var(--ses-m-y, var(--ses-d-y, 50%));
        --ses-focus-zoom: var(--ses-m-zoom, var(--ses-d-zoom, 1));
        --ses-focus-x-ratio: var(--ses-m-xr, var(--ses-d-xr, 0.5));
        --ses-focus-y-ratio: var(--ses-m-yr, var(--ses-d-yr, 0.5));
    }
}

.ses-slider__img {
    position: absolute !important;
    display: block !important;
    width: calc(100% * var(--ses-focus-zoom, 1)) !important;
    height: calc(100% * var(--ses-focus-zoom, 1)) !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: cover !important;
    object-position: var(--ses-focus-x, 50%) var(--ses-focus-y, 50%) !important;
    top: calc((1 - var(--ses-focus-zoom, 1)) * 100% * var(--ses-focus-y-ratio, 0.5)) !important;
    left: calc((1 - var(--ses-focus-zoom, 1)) * 100% * var(--ses-focus-x-ratio, 0.5)) !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    color: transparent;
}

.ses-slider__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
}

.ses-slider__btn {
    pointer-events: auto;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ses-slider__btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.ses-slider__btn:focus-visible,
.ses-slider__dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.ses-slider__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.ses-slider__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s ease;
}

.ses-slider__dot.is-active,
.ses-slider__dot:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* display:flex у .ses-slider__nav иначе перебивает атрибут hidden */
.ses-slider__nav[hidden],
.ses-slider__dots[hidden] {
    display: none !important;
}

.ses-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ses-slide-single {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.ses-slide-single__title {
    margin: 0 0 16px;
}

.ses-slide-single__content {
    line-height: 1.6;
}

@media (max-width: 767px) {
    .ses-slider__btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .ses-slider__nav {
        padding: 0 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ses-slider__track {
        transition: none;
    }
}
