/* ==========================================
   HERO SLIDER RTK
   ПК: 1920x550 | Мобильные: 640x360
   Масштабирование текста через container queries
   ========================================== */

/* Включаем container queries для привязки шрифтов к ширине баннера */
.hero-slider {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    overflow: hidden;
    background: #0A2777;
    container-type: inline-size; /* ключевая строка */
}

.hero-slider__wrapper {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.hero-slide {
    position: relative;
    min-width: 100%;
    aspect-ratio: 1920 / 550;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}


/* Картинка фона */
.hero-slide__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-slide__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ====== ПОДЛОЖКА НА ВЕСЬ БАННЕР (по умолчанию — слева) ====== */
.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(10, 39, 119, 0.55) 0%,
        rgba(10, 39, 119, 0.28) 0%,
        rgba(10, 39, 119, 0) 0%
    );
}


/* Блок с текстом */
.hero-slide__content {
    position: relative;
    z-index: 3;
    max-width: 640px;
    padding: 1.2rem 2rem;
    color: var(--rtk-white);
    margin-left: 2%;
    overflow: hidden; /* текст не выходит за границы */
}


/* ====== Текст СПРАВА ====== */
.hero-slide--right {
    justify-content: flex-end;
}
.hero-slide--right::before {
    background: linear-gradient(
        270deg,
        rgba(10, 39, 119, 0.55) 0%,
        rgba(10, 39, 119, 0.28) 0%,
        rgba(10, 39, 119, 0) 0%
    );
}
.hero-slide--right .hero-slide__content {
    margin-left: 0;
    margin-right: 2%;
    text-align: right;
}


/* ====== Текст ПО ЦЕНТРУ ====== */
.hero-slide--center {
    justify-content: center;
}
.hero-slide--center::before {
    background: radial-gradient(
        ellipse at center,
        rgba(10, 39, 119, 0.5) 0%,
        rgba(10, 39, 119, 0.22) 0%,
        rgba(10, 39, 119, 0) 0%
    );
}
.hero-slide--center .hero-slide__content {
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
}


/* ====== ТЁМНЫЙ ТЕКСТ (светлый фон) ====== */
.hero-slide--dark-text::before {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 0%
    );
}

.hero-slide--back::before {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 55%,
        rgba(255, 255, 255, 0) 90%
    );
}


.hero-slide--dark-text .hero-slide__title {
    color: var(--rtk-dark);
}
.hero-slide--dark-text .hero-slide__text {
    color: #333 !important;
}
.hero-slide--dark-text .hero-slide__link {
    color: var(--rtk-blue);
}
.hero-slide--dark-text .hero-slide__link:hover {
    color: var(--rtk-dark);
}

/* ====== Типографика: привязка к ширине баннера через cqw ====== */
.hero-slide__title {
    font-size: clamp(1.1rem, 4.5cqw, 2.2rem);
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 0.6rem 0;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--rtk-light);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-slide__text {
    font-size: clamp(0.8rem, 2.2cqw, 1.2rem);
    margin: 0 0 0.8rem 0;
    line-height: 1.4;
    color: var(--rtk-white);
    opacity: 0.97;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ====== Ссылка ====== */
.hero-slide__link {
    display: inline-block;
    font-size: clamp(0.8rem, 2cqw, 1.1rem);
    font-weight: 700;
    color: var(--rtk-blue) !important;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 0;
    transition: all 0.25s ease;
    margin-top: auto; /* прижимаем ссылку к низу на мобильной версии */
}
.hero-slide__link:hover {
    color: var(--rtk-white);
    letter-spacing: 0.06em;
}

/* ====== Индикаторы ====== */
.hero-slider__indicators {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
}
.hero-slider__dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--rtk-white);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.hero-slider__dot.active {
    background: var(--rtk-blue);
    border-color: var(--rtk-blue);
    transform: scale(1.25);
}
.hero-slider__dot:hover {
    background: var(--rtk-light);
    border-color: var(--rtk-light);
}

/* Fallback для старых браузеров без поддержки container queries */
@supports not (container-type: inline-size) {
    .hero-slide__title {
        font-size: clamp(1.1rem, 2.8vw, 2.6rem);
    }
    .hero-slide__text {
        font-size: clamp(0.8rem, 1.3vw, 1.2rem);
    }
    .hero-slide__link {
        font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    }
}



/* ==========================================
   МОБИЛЬНАЯ ВЕРСИЯ: текст по центру,
   сплошная подложка без градиента
   ========================================== */
@media (max-width: 768px) {
    /* Слайд: центрируем контент по вертикали и горизонтали */
    .hero-slide {
        aspect-ratio: 640 / 360;
        align-items: center;
        justify-content: center;
        padding-bottom: 0;
    }

    /* Сплошная подложка без градиента (тёмная) */
    .hero-slide::before {
        background: rgba(10, 39, 119, 0.75);
    }

    /* Сплошная подложка для светлого текста (белая) */
    .hero-slide--dark-text::before,
    .hero-slide--back::before {
        background: rgba(255, 255, 255, 0.85);
    }

    /* Контент: по центру */
    .hero-slide__content {
        margin: 0 auto;
        max-width: 95%;
        padding: 0.8rem 1rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Переопределяем правый слайд на центрирование */
    .hero-slide--right .hero-slide__content {
        margin: 0 auto;
        text-align: center;
    }

    /* Центрированный слайд */
    .hero-slide--center .hero-slide__content {
        margin: 0 auto;
    }

    /* Уменьшенные шрифты для мобильной версии */
    .hero-slide__title {
        font-size: clamp(0.85rem, 4.2vw, 1.3rem);
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }
    .hero-slide__text {
        font-size: clamp(0.7rem, 3.2vw, 0.95rem);
        margin-bottom: 0.5rem;
        line-height: 1.35;
    }
    .hero-slide__link {
        font-size: clamp(0.7rem, 3vw, 0.9rem);
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .hero-slide__content {
        padding: 0.5rem 0.8rem;
    }
    .hero-slide__title {
        font-size: clamp(0.75rem, 4vw, 1.1rem);
    }
    .hero-slide__text {
        font-size: clamp(0.65rem, 3vw, 0.85rem);
    }
}