/* ===== NEWS SLIDER ===== */
/* Уникальные стили новостей (стрелки и пагинация в slider-base.css) */

/* Секция */
.news-slider {
    width: 100%;
    position: relative;
    padding: 145px 0 60px 0;
    overflow: hidden;
}

/* Заголовок секции */
.news-slider__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.news-slider__header.container {
    padding-left: 0;
    padding-right: 0;
}

.news-slider__title {
    color: #4F4F4F;
    font-family: "PT Astra Serif", serif;
    font-size: 48px;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 40px;
}

.news-slider__all-link {
    color: #222322;
    font-family: "TT Ramillas", serif;
    font-size: 18px;
    font-style: italic;
    font-weight: 700;
    text-decoration: none;
    line-height: var(--line-height-22_4, 22.4px);
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
}

/* Общий контейнер = стрелки + слайды */
.news-slider__inner {
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--slider-arrow-width) 1fr var(--slider-arrow-width);
    align-items: start;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* Viewport */
.news-slider__viewport {
    grid-column: 2;
    width: 100%;
    /* 4 карточки по 340 + 3 gap по 40 + паддинги для ховеров */
    max-width: calc(4 * 340px + 3 * 40px + 40px);
    margin: 0 auto;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    padding: 20px;
    box-sizing: border-box;
}

/* Track */
.news-slider__track {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
    padding: 20px 0;
    transition: transform 0.4s ease;
}

/* ===== Карточка ===== */
.news-slider__slide {
    display: flex;
    width: 340px;
    flex: 0 0 340px;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--item-spacing-s, 24px);
    position: relative;
    z-index: 1;
    /* Паддинги для ховер-подложки: 17.5px по бокам, 18px сверху/снизу */
    padding: 18px 17.5px;
    margin: -18px -17.5px;
    box-sizing: content-box;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.news-slider__slide:hover {
    background: #FFFAF5;
}

.news-slider__all-link:hover {
text-decoration: underline;
    color: #005C67;
}

/* ===== Картинка ===== */
.news-slider__image-link {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    align-self: stretch;
    width: 100%;
    height: 340px;
    overflow: visible;
    margin: 0;
}

/* Сам img */
.news-slider__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    /* Маска обрезки */
    -webkit-mask-image: url("/local/templates/my/images/masks/news-mask.svg");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: cover;
    mask-image: url("/local/templates/my/images/masks/news-mask.svg");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: cover;
    transition: transform 0.3s ease;
}

/* Оверлей поверх фото */
.news-slider__mask {
    position: absolute;
    inset: -10px;
    z-index: 2;
    pointer-events: none;
    background: url("/local/templates/my/images/masks/news-mask.svg") center / cover no-repeat;
    opacity: 1;
}

/* ===== Контент под картинкой ===== */
.news-slider__content {
    display: flex;
    padding: 0 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--item-spacing-15_18, 15.18px);
    align-self: stretch;
    width: 100%;
    position: relative;
}

/* Заголовок новости (контейнер) */
.news-slider__name {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
}

/* Заголовок новости (ссылка) */
.news-slider__name a {
    color: #005C67;
    font-family: "PT Astra Serif", serif;
    font-size: 19px;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: text-decoration 0.3s ease, text-decoration-color 0.3s ease;
}

.news-slider__name a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* ===== Текст анонса ===== */
.news-slider__desc {
    align-self: stretch;
    color: #111;
    font-family: "tt-commons-pro", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 120%;
    margin: 0;
    /* Фиксированная высота 75px с многоточием */
    height: 75px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Читать подробнее ===== */
.news-slider__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #222322;
    font-family: "tt-commons-pro", sans-serif;
    font-size: var(--font-size-14, 14px);
    font-style: normal;
    font-weight: 600;
    line-height: 22.4px;
    letter-spacing: var(--letter-spacing-1_12, 1.12px);
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
    text-transform: uppercase;
    transition: color 0.3s ease;
}



.news-slider__more::after {
    content: "";
    position: absolute;
    right: 15px;
    bottom: -3px;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: url("/local/templates/my/images/icons/guidance_right-arrow.svg") center / contain no-repeat;
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Ховер на карточку — показываем стрелку и меняем цвет */
.news-slider__slide:hover .news-slider__more {
    color: #E61734;
}

.news-slider__slide:hover .news-slider__more::after {
    opacity: 1;
}

/* Active состояние — рамка на подложке + поворот стрелки */
.news-slider__slide:active {
    border: 1px solid rgba(246, 136, 27, 0.31);
}

.news-slider__slide:active .news-slider__more::after {
    opacity: 1;
    transform: rotate(-45deg);
}

/* ===== Стрелки ===== */
.news-slider__arrow {
    grid-row: 1;
    align-self: center;
    width: var(--slider-arrow-width);
    height: 56px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 30;
    background-image: url("/local/templates/my/images/icons/slide-arrow.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: filter 0.3s ease;
}

.news-slider__arrow--prev {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    margin-top: 188px; /* (340px / 2) - (56px / 2) = 170 - 28 = 142px + padding */
    transform: rotate(180deg);
}

.news-slider__arrow--next {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    align-self: start;
    margin-top: 188px;
}

.news-slider__arrow:hover,
.news-slider__arrow:active {
    filter: brightness(0) saturate(100%) invert(65%) sepia(56%) saturate(2670%) hue-rotate(0deg) brightness(102%) contrast(95%);
}

.news-slider__arrow.is-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Пагинация ===== */
.news-slider__pagination {
    grid-column: 2;
    grid-row: 2;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

/* Точки */
.news-slider__dot {
    position: relative;
    width: 15px;
    height: 14px;
    border: none;
    padding: 0;
    background: var(--slider-dot-gray);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-slider__dot:hover {
    opacity: 0.8;
}

.news-slider__dot.is-active {
    width: 63px;
    background: transparent;
    border-radius: 999px;
}

.news-slider__dot::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 14px;
    background: var(--slider-dot-red);
    border-radius: 999px;
    z-index: 2;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-slider__dot.is-active::before {
    opacity: 1;
    transform: scaleX(1);
}

.news-slider__dot::after {
    content: "";
    position: absolute;
    left: 26px;
    top: 0;
    width: 37px;
    height: 14px;
    background: var(--slider-dot-gray);
    border-radius: 999px;
    z-index: 1;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-slider__dot.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.news-slider__dot.is-reanimate {
    animation: sliderDotReanimate 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 1728px — 3 карточки ===== */
@media (max-width: 1728px) {
    .news-slider__viewport {
        max-width: calc(3 * 340px + 2 * 40px + 40px); /* 1140px */
    }
}

/* ===== 1400px — 2 карточки ===== */
@media (max-width: 1400px) {
    .news-slider__viewport {
        max-width: calc(2 * 340px + 1 * 40px + 40px); /* 760px */
    }
}
/* ===== 1024px — планшет, 2 карточки 340px, навигация снизу ===== */
@media (max-width: 1024px) {
    .news-slider {
        padding: 245px 0 40px 0;
    }
    
    .news-slider__title {
        font-size: 48px;
        margin-bottom: 30px;
    }
    
    .news-slider__inner {
        display: grid;
        grid-template-columns: auto auto auto;
        grid-template-rows: auto auto;
        justify-content: center;
        align-items: center;
        gap: 24px 50px;
    }
    
    .news-slider__viewport {
        grid-column: 1 / -1;
        grid-row: 1;
        max-width: calc(2 * 340px + 1 * 40px + 40px); /* 760px */
        margin: 0 auto;
        padding: 20px;
        padding-bottom: 10px;
        padding-top: 0;
    }
    
    .news-slider__track {
        gap: 40px;
    }
    
    .news-slider__slide {
        flex: 0 0 340px;
        width: 340px;
    }
    
    .news-slider__image-link {
        height: 340px;
    }
    
    /* Стрелки снизу */
    .news-slider__arrow--prev {
        grid-column: 1;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        margin: 0;
        transform: rotate(180deg);
    }
    
    .news-slider__pagination {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
    }
    
    .news-slider__arrow--next {
        grid-column: 3;
        grid-row: 2;
        justify-self: start;
        align-self: center;
        margin: 0;
    }
}

/* ===== 850px — 2 карточки 320px ===== */
@media (max-width: 850px) {
    .news-slider__viewport {
        max-width: calc(2 * 320px + 1 * 30px + 40px); /* 710px */
    }
    
    .news-slider__track {
        gap: 30px;
    }
    
    .news-slider__slide {
        flex: 0 0 320px;
        width: 320px;
    }
    
    .news-slider__image-link {
        height: 320px;
    }
}

/* ===== 768px ===== */
@media (max-width: 768px) {
    .news-slider {
        padding: 245px 0 30px 0;
    }
    
    .news-slider__header {
        margin-bottom: 30px;
    }
    
    .news-slider__title {
        font-size: 45px;
        margin-bottom: 30px;
    }
    
    .news-slider__inner {
        gap: 20px 40px;
    }
    
    .news-slider__viewport {
        max-width: calc(2 * 300px + 1 * 24px + 40px); /* 664px */
    }
    
    .news-slider__track {
        gap: 24px;
    }
    
    .news-slider__slide {
        flex: 0 0 300px;
        width: 300px;
    }
    
    .news-slider__image-link {
        height: 300px;
    }
}

/* ===== 680px — 1 карточка 340px ===== */
@media (max-width: 680px) {
    .news-slider__viewport {
        max-width: calc(1 * 340px + 40px); /* 380px */
    }

        .news-slider__title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    
    .news-slider__track {
        gap: 40px;
    }
    
    .news-slider__slide {
        flex: 0 0 340px;
        width: 340px;
    }
    
    .news-slider__image-link {
        height: 340px;
    }

        .news-slider__all-link {
        font-size: 16px;
    }
}

/* ===== 580px — мобилка ===== */
@media (max-width: 580px) {
    .news-slider {
        padding: 215px 0 24px 0;
    }
    
    .news-slider__header {
        margin-bottom: 20px;
    }
    
    .news-slider__title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    

    
    .news-slider__inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        padding: 0;
        gap: 20px 0;
    }
    
    .news-slider__viewport {
        grid-column: 1 / -1;
        grid-row: 1;
        max-width: calc(1 * 340px + 40px); /* 380px */
        width: 100%;
        margin: 0 auto;
        padding: 20px;
         padding-bottom: 10px;
         padding-top: 0;
    }
    
    .news-slider__more {
        font-size: 12px;
    }
    
    /* Стрелки с отступами */
    .news-slider__arrow--prev {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        margin: 0 0 0 25px;
    }
    
    .news-slider__pagination {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        justify-self: center;
    }
    
    .news-slider__arrow--next {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        margin: 0 25px 0 0;
    }
}

/* ===== 480px ===== */
@media (max-width: 480px) {
    .news-slider__arrow--prev {
        margin: 0 0 0 35px;
    }
    
    .news-slider__arrow--next {
        margin: 0 35px 0 0;
    }
}

/* ===== 420px — карточка не помещается ===== */
@media (max-width: 420px) {
    .news-slider__viewport {
        max-width: calc(1 * 300px + 40px); /* 340px */
    }
    
    .news-slider__slide {
        flex: 0 0 300px;
        width: 300px;
    }
    
    .news-slider__image-link {
        height: 300px;
    }
    
    .news-slider__arrow--prev {
        margin: 0 0 0 20px;
    }
    
    .news-slider__arrow--next {
        margin: 0 20px 0 0;
    }
}

/* ===== 360px ===== */
@media (max-width: 360px) {
    .news-slider__viewport {
        max-width: calc(1 * 260px + 40px); /* 320px */
    }
    
    .news-slider__slide {
        flex: 0 0 260px;
        width: 260px;
    }
    
    .news-slider__image-link {
        height: 280px;
    }
    
    .news-slider__name a {
        font-size: 17px;
    }
    
    .news-slider__desc {
        font-size: 12px;
        height: 58px;
    }
    
    .news-slider__arrow--prev {
        margin: 0 0 0 10px;
    }
    
    .news-slider__arrow--next {
        margin: 0 10px 0 0;
    }

    .news-slider__more::after {
    right: -6px;

}
}