/* =========================================================
   Wards slider
   Карточки подопечных для инфоблока 16
   ========================================================= */

.wards-slider {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, var(--white) 85.05%, var(--gray-light-font) 100.04%);
}

.wards-slider-section {
    max-width: 100%;
    overflow-x: clip;
}

.wards-slider > .swiper {
    position: relative;
    padding: 28px 0 64px;
    overflow: visible;
    background: var(--white);
}

.swiper-wrapper.wards-list {
    translate: -24px 0;
}

/* -------------------------------
   Slide
-------------------------------- */

.wards-item.swiper-slide {
    position: relative;
    top: 0;
    height: 360px;
    max-width: 320px;
    overflow: hidden;
    border-radius: 16px;
    background-color: #e5e5e5;
    background-image: var(--image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: transform .7s ease-in-out, top .7s ease-in-out, margin .7s ease-in-out;
}

.wards-item.swiper-slide-active {
    --ward-scale: 1.06;
    z-index: 5;
    top: 0;
    max-width: 340px;
    margin-right: 16px !important;
    overflow: visible;
    border-radius: calc(20px / var(--ward-scale));
    transform: scale(var(--ward-scale));
    transform-origin: center center;
}

.wards-item.swiper-slide-prev {
    margin-right: 16px !important;
}

/* Маска как на десктопе Draft — без белой вуали */
.wards-item:not(.swiper-slide-active)::before,
.wards-item.swiper-slide-prev::before,
.wards-item.swiper-slide-next::before {
    display: none;
}

/* -------------------------------
   Green card — стиль Draft (как ≥1401)
-------------------------------- */

.wards-item .support__block {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 168px;
    min-height: 168px;
    padding: 16px 16px 12px;
    overflow: visible;
    border-radius: 12px;
    background: #3EA74F;
    color: var(--white, #ffffff);
    transition:
        left .7s ease-in-out,
        right .7s ease-in-out,
        bottom .7s ease-in-out,
        height .7s ease-in-out,
        min-height .7s ease-in-out,
        padding .7s ease-in-out,
        border-radius .7s ease-in-out;
}

.wards-item.swiper-slide-active .support__block {
    left: calc(14px / var(--ward-scale));
    right: calc(14px / var(--ward-scale));
    bottom: calc(-6px / var(--ward-scale));
    height: calc(168px / var(--ward-scale));
    min-height: calc(168px / var(--ward-scale));
    padding: calc(16px / var(--ward-scale)) calc(16px / var(--ward-scale)) calc(12px / var(--ward-scale));
    border-radius: calc(12px / var(--ward-scale));
}

/* -------------------------------
   Status badge
-------------------------------- */

.wards-item .support__status {
    position: absolute;
    top: -10px;
    right: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    column-gap: 4px;
    height: 26px;
    min-height: 26px;
    max-width: none;
    padding: 0 10px;
    overflow: hidden;
    border-radius: 40px;
    background: var(--white, #ffffff);
    color: #535353;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 1;
    visibility: visible;
}

.wards-item.swiper-slide-active .support__status {
    top: calc(-12px / var(--ward-scale));
    right: calc(14px / var(--ward-scale));
    height: calc(26px / var(--ward-scale));
    min-height: calc(26px / var(--ward-scale));
    padding: 0 calc(10px / var(--ward-scale));
    font-size: calc(14px / var(--ward-scale));
}

.wards-item .support__status svg {
    display: none;
}

/* Совместимость со старым классом, если где-то ещё остался fundraiser */
.wards-item .fundraiser {
    position: absolute;
    top: -10px;
    right: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    column-gap: 4px;
    height: 26px;
    min-height: 26px;
    max-width: none;
    padding: 0 10px;
    overflow: hidden;
    border-radius: 40px;
    background: var(--white, #ffffff);
    color: #535353;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* -------------------------------
   Text
-------------------------------- */

.wards-item .support__title {
    max-width: none;
    margin: 0;
    color: var(--white, #ffffff);
    font-size: 20px;
    line-height: 0.9;
    font-weight: 500;
    text-transform: uppercase;
}

.wards-item.swiper-slide-active .support__title {
    font-size: calc(20px / var(--ward-scale));
}

.wards-item .support__info {
    display: block;
    margin: 8px 0 0;
    color: var(--white, #ffffff);
    font-size: 15px;
    line-height: 1.1;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Без сбора — 3 строки описания вместо прогресса */
.wards-item .support__info--desc,
.wards-item .support__block--no-collect .support__info {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wards-item.swiper-slide-active .support__info {
    margin-top: calc(8px / var(--ward-scale));
    font-size: calc(15px / var(--ward-scale));
}

/* -------------------------------
   Progress
-------------------------------- */

.wards-item .support__progress {
    width: 100%;
    height: 10px;
    margin-top: 12px;
    margin-bottom: 0;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 20px;
    background: #73C580;
    transition: height .7s ease-in-out, margin-top .7s ease-in-out;
}

.wards-item .support__progress .support__bar {
    display: block;
    height: 10px;
    border-radius: 20px;
    background: #FFE74F;
    transition: height .7s ease-in-out;
}

.wards-item.swiper-slide-active .support__progress {
    height: calc(10px / var(--ward-scale));
    margin-top: calc(12px / var(--ward-scale));
}

.wards-item.swiper-slide-active .support__progress .support__bar {
    height: calc(10px / var(--ward-scale));
}

/* -------------------------------
   Money
-------------------------------- */

.wards-item .support__collect {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 6px;
    margin-top: 10px;
    padding-bottom: 0;
    color: var(--white, #ffffff);
    font-size: 13px;
    line-height: 1.1;
    font-weight: 600;
}

.wards-item.swiper-slide-active .support__collect {
    margin-top: calc(10px / var(--ward-scale));
    font-size: calc(13px / var(--ward-scale));
}

.wards-item .support__collect > div {
    display: flex;
    align-items: center;
    column-gap: 0;
    min-width: 0;
}

.wards-item .support__collect > div:first-child {
    flex: auto;
}

.wards-item .support__collect > div:last-of-type {
    flex: 0 0 auto;
    color: var(--white);
    font-weight: 600;
    opacity: 0.6;
}

.wards-item .support__collect svg {
    display: none;
}

.wards-item .support__gray {
    white-space: nowrap;
    color: var(--white);
    font-weight: 600;
}

.wards-item .support__sum {
    white-space: nowrap;
    color: var(--white);
    font-weight: 600;
}

.wards-item .support__sum::after {
    content: " \20BD";
}

/* -------------------------------
   Button — белый outline, как на десктопе
-------------------------------- */

.wards-item .support__btn {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    height: 29px;
    min-height: 29px;
    margin-top: 10px;
    flex: 0 0 auto;
    overflow: visible;
    transition: height .7s ease-in-out, min-height .7s ease-in-out, margin-top .7s ease-in-out;
}

.wards-item.swiper-slide-active .support__btn {
    height: calc(29px / var(--ward-scale));
    min-height: calc(29px / var(--ward-scale));
    margin-top: calc(10px / var(--ward-scale));
}

.wards-item .support__block .support__btn .btn,
.wards-item .support__block .support__btn .btn.btn--wards-more,
.wards-item .support__btn a.btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 120px;
    height: 29px;
    min-height: 29px;
    margin: 0 !important;
    padding: 0 16px;
    border: 2px solid #fff;
    border-radius: 40px;
    background: transparent !important;
    color: #fff !important;
    font-size: 15px !important;
    line-height: 1.1;
    font-weight: 600;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
}

.wards-item.swiper-slide-active .support__block .support__btn .btn,
.wards-item.swiper-slide-active .support__block .support__btn .btn.btn--wards-more {
    min-width: calc(120px / var(--ward-scale));
    height: calc(29px / var(--ward-scale));
    min-height: calc(29px / var(--ward-scale));
    padding: 0 calc(16px / var(--ward-scale));
    border-width: calc(2px / var(--ward-scale));
    border-radius: calc(40px / var(--ward-scale));
    font-size: calc(15px / var(--ward-scale));
}
/* -------------------------------
   Helped / closed state
   На всякий случай, если где-то будет класс helped
-------------------------------- */

.wards-item .support__block.helped {
    background: var(--yellow, #FFE74F);
    color: var(--black-font, #343333);
}

.wards-item .support__block.helped .support__title,
.wards-item .support__block.helped .support__info,
.wards-item .support__block.helped .support__collect {
    color: var(--black-font, #343333);
}

.wards-item .support__block.helped .support__progress {
    background: rgba(52, 51, 51, .2);
}

.wards-item .support__block.helped .support__progress .support__bar {
    background: var(--green, #3EA74F);
}

.wards-item .support__block.helped .support__btn .btn {
    background: var(--green, #3EA74F);
    color: var(--white, #ffffff);
}

/* -------------------------------
   Arrows
-------------------------------- */

    .wards-slider .wards-slider-button-prev,
    .wards-slider .wards-slider-button-next {
        z-index: 7;
    }

.wards-item__link {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* -------------------------------
   Adaptive — тот же Draft-стиль, масштаб слайдера
-------------------------------- */

@media (max-width: 1400px) {
    .wards-slider {
        background: var(--white);
    }

    .wards-slider > .swiper {
        padding: 28px 0 64px;
        overflow: visible;
        background: var(--white);
    }

    .wards-item.swiper-slide {
        max-width: 300px;
    }

    .wards-item.swiper-slide-active,
    .wards-item.swiper-slide-prev {
        margin-right: 20px !important;
    }

    .swiper-wrapper.wards-list {
        translate: 0 0;
    }
}

@media (max-width: 1200px) {
    .wards-item.swiper-slide {
        max-width: 280px;
        height: 340px;
    }

    .wards-item.swiper-slide-active {
        max-width: 300px;
    }

    .wards-item.swiper-slide-active,
    .wards-item.swiper-slide-prev {
        margin-right: 16px !important;
    }
}

@media (max-width: 991px) {
    .wards-slider {
        overflow: hidden;
        max-width: 100%;
    }

    .wards-slider > .swiper {
        /* visible на мобилке даёт горизонтальный pan страницы */
        padding: 32px 0 56px;
        overflow: hidden;
    }

    .wards-item.swiper-slide {
        height: 340px;
        max-width: none;
    }

    .wards-item.swiper-slide-active {
        --ward-scale: 1.05;
        top: 0;
        max-width: none;
        transform: scale(var(--ward-scale));
        transform-origin: center center;
        /* visible — бейдж «Сбор идёт» выступает вверх; клип на .swiper */
        overflow: visible;
    }

    .wards-item.swiper-slide-active,
    .wards-item.swiper-slide-prev {
        margin-right: 12px !important;
    }

    .swiper-wrapper.wards-list {
        translate: none;
    }

    .wards-item .support__status {
        right: 8px;
    }

    .wards-item .support__collect svg {
        display: none;
    }

    .wards-item .support__sum::after {
        content: " \20BD";
    }

    .wards-item .support__info {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wards-item .support__info--desc,
    .wards-item .support__block--no-collect .support__info {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

@media (max-width: 755px) {
    .wards-item.swiper-slide,
    .wards-item.swiper-slide-active {
        max-width: none;
        height: 360px;
    }

    .wards-item.swiper-slide-active {
        --ward-scale: 1.04;
        top: 0;
        transform: scale(var(--ward-scale));
    }

    .wards-item .support__block {
        height: 168px;
        min-height: 168px;
    }
}

/* Карточки слайдера по макету Draft (Copy), фрейм 2005:61, y 669–1142.
   Только десктоп от 1401px: ниже остаются прежние размеры. */
@media (min-width: 1401px) {
    .wards-slider {
        position: relative;
        background: var(--white);
    }

    .wards-slider > .swiper {
        padding: 32px 0 88px;
        overflow: visible;
        background: var(--white);
    }

    .swiper-wrapper.wards-list {
        translate: 0 0;
    }

    .wards-item.swiper-slide,
    .wards-item.swiper-slide-active {
        top: 0;
        max-width: none;
        height: 401px;
        border-radius: 16px;
        transform: none;
    }

    .wards-item.swiper-slide,
    .wards-item.swiper-slide-active,
    .wards-item.swiper-slide-prev {
        margin-right: 57px !important;
    }

    /* Раскладка у всех слайдов 344×401. Центральная карточка увеличивается
       до 406×473 вокруг центра, поэтому внутренние размеры делятся на масштаб,
       чтобы после scale шрифт и плашка совпали с макетом. */
    .wards-item.swiper-slide-active {
        --ward-scale: 1.180232558;
        z-index: 5;
        overflow: visible;
        border-radius: calc(20px / var(--ward-scale));
        transform: scale(var(--ward-scale));
        transform-origin: center center;
    }

    .wards-item:not(.swiper-slide-active)::before,
    .wards-item.swiper-slide-prev::before,
    .wards-item.swiper-slide-next::before {
        display: none;
    }

    .wards-slider::before,
    .wards-slider::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 6;
        width: 220px;
        pointer-events: none;
    }

    .wards-slider::before {
        left: 0;
        background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
    }

    .wards-slider::after {
        right: 0;
        background: linear-gradient(270deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
    }

    .wards-slider .wards-slider-button-prev,
    .wards-slider .wards-slider-button-next {
        z-index: 7;
    }

    .wards-item__link {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 5;
    }

    .wards-item .support__block {
        left: 14px;
        right: 14px;
        bottom: 14px;
        height: 178px;
        min-height: 178px;
        padding: 19px 19px 15px;
        border-radius: 12px;
        background: #3EA74F;
        overflow: visible;
        transition:
            left .7s ease-in-out,
            right .7s ease-in-out,
            bottom .7s ease-in-out,
            height .7s ease-in-out,
            min-height .7s ease-in-out,
            padding .7s ease-in-out,
            border-radius .7s ease-in-out;
    }

    /* Макет 4016:863 — плашка 372×178, inset 17 / top 304; снизу −9 за край фото 473. */
    .wards-item.swiper-slide-active .support__block {
        left: calc(17px / var(--ward-scale));
        right: calc(17px / var(--ward-scale));
        bottom: calc(-9px / var(--ward-scale));
        height: calc(178px / var(--ward-scale));
        min-height: calc(178px / var(--ward-scale));
        padding: calc(19px / var(--ward-scale)) calc(19px / var(--ward-scale)) calc(15px / var(--ward-scale));
        border-radius: calc(12px / var(--ward-scale));
    }

    .wards-item .support__status {
        top: -10px;
        right: 8px;
        height: 29px;
        min-height: 29px;
        max-width: none;
        padding: 0 10px;
        border-radius: 15px;
        color: #535353;
        font-size: 16px;
        line-height: 1.1;
        font-weight: 600;
        text-transform: none;
        transition:
            top .7s ease-in-out,
            right .7s ease-in-out,
            height .7s ease-in-out,
            min-height .7s ease-in-out,
            padding .7s ease-in-out,
            border-radius .7s ease-in-out,
            font-size .7s ease-in-out;
    }

    .wards-item.swiper-slide-active .support__status {
        top: calc(-15px / var(--ward-scale));
        right: calc(21px / var(--ward-scale));
        height: calc(29px / var(--ward-scale));
        min-height: calc(29px / var(--ward-scale));
        padding: 0 calc(11px / var(--ward-scale));
        border-radius: calc(40px / var(--ward-scale));
        font-size: calc(16px / var(--ward-scale));
    }

    .wards-item.swiper-slide-active .support__title {
        font-size: calc(24px / var(--ward-scale));
    }

    .wards-item.swiper-slide-active .support__info {
        margin-top: calc(10px / var(--ward-scale));
        font-size: calc(18px / var(--ward-scale));
    }

    .wards-item.swiper-slide-active .support__progress {
        height: calc(11px / var(--ward-scale));
        margin-top: calc(15px / var(--ward-scale));
    }

    .wards-item.swiper-slide-active .support__progress .support__bar {
        height: calc(11px / var(--ward-scale));
    }

    .wards-item.swiper-slide-active .support__collect {
        margin-top: calc(11px / var(--ward-scale));
        font-size: calc(14px / var(--ward-scale));
    }

    .wards-item .support__status svg {
        display: none;
    }

    .wards-item .support__title {
        max-width: none;
        font-size: 24px;
        line-height: 0.9;
        font-weight: 500;
        transition: font-size .7s ease-in-out;
    }

    .wards-item .support__info {
        margin: 10px 0 0;
        font-size: 18px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: margin-top .7s ease-in-out, font-size .7s ease-in-out;
    }

    .wards-item .support__info--desc,
    .wards-item .support__block--no-collect .support__info {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        white-space: normal;
    }

    .wards-item .support__progress {
        height: 11px;
        margin-top: 15px;
        border-radius: 20px;
        background: #73C580;
        transition: height .7s ease-in-out, margin-top .7s ease-in-out;
    }

    .wards-item .support__progress .support__bar {
        height: 11px;
        border-radius: 20px;
        background: #FFE74F;
        transition: height .7s ease-in-out;
    }

    .wards-item .support__collect {
        margin-top: 11px;
        padding-bottom: 0;
        font-size: 14px;
        line-height: 1.1;
        font-weight: 600;
        transition: margin-top .7s ease-in-out, font-size .7s ease-in-out;
    }

    .wards-item .support__collect svg {
        display: none;
    }

    .wards-item .support__sum,
    .wards-item .support__gray {
        color: var(--white);
        font-weight: 600;
    }

    .wards-item .support__collect > div:last-of-type {
        color: var(--white);
        font-weight: 600;
        opacity: 0.6;
    }

    .wards-item .support__sum::after {
        content: " \20BD";
    }

    .wards-item .support__block .support__btn {
        display: flex;
        align-items: flex-end;
        justify-content: flex-start;
        width: 100%;
        height: 29px;
        min-height: 29px;
        margin-top: 11px;
        overflow: visible;
        transition: height .7s ease-in-out, min-height .7s ease-in-out, margin-top .7s ease-in-out;
    }

    .wards-item.swiper-slide-active .support__btn {
        height: calc(29px / var(--ward-scale));
        min-height: calc(29px / var(--ward-scale));
        margin-top: calc(11px / var(--ward-scale));
    }

    .wards-item .support__block .support__btn .btn,
    .wards-item .support__block .support__btn .btn.btn--wards-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 120px;
        height: 29px;
        min-height: 29px;
        margin: 0;
        padding: 0 16px;
        border: 2px solid #fff;
        border-radius: 40px;
        background: transparent;
        color: #fff;
        font-size: 16px;
        line-height: 1.1;
        font-weight: 600;
        text-align: center;
        text-transform: none;
        white-space: nowrap;
        box-shadow: none;
        transition:
            min-width .7s ease-in-out,
            height .7s ease-in-out,
            min-height .7s ease-in-out,
            padding .7s ease-in-out,
            border-width .7s ease-in-out,
            border-radius .7s ease-in-out,
            font-size .7s ease-in-out;
    }

    .wards-item.swiper-slide-active .support__block .support__btn .btn,
    .wards-item.swiper-slide-active .support__block .support__btn .btn.btn--wards-more {
        min-width: calc(120px / var(--ward-scale));
        height: calc(29px / var(--ward-scale));
        min-height: calc(29px / var(--ward-scale));
        padding: 0 calc(16px / var(--ward-scale));
        border-width: calc(2px / var(--ward-scale));
        border-radius: calc(40px / var(--ward-scale));
        font-size: calc(16px / var(--ward-scale));
    }
}