/**
 * Блок «Освой бьюти-профессию с нуля до первых клиентов» — главная (редизайн)
 */
:root {
    --advantages-container: 1500px;
    --advantages-gap-section: 80px;
    --advantages-gap-columns: 120px;
    --advantages-gap-cards: 24px;
    --advantages-color-text: #111827;
    --advantages-color-bg: #f5f6fb;
    --advantages-color-brand: #b04481;
    --advantages-font: 'Vela Sans', 'Onest', system-ui, -apple-system, sans-serif;
    --advantages-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --advantages-duration: 0.45s;
    --advantages-pin-offset: 138px;
}

.advantages-main {
    padding: var(--advantages-gap-section) 16px var(--advantages-gap-section);
    font-family: var(--advantages-font);
    color: var(--advantages-color-text);
}

@media (min-width: 1200px) {
    .advantages-main--scroll {
        position: relative;
        box-sizing: border-box;
    }

    .advantages-main__spacer {
        display: none;
        width: 100%;
    }

    .advantages-main--locked .advantages-main__spacer {
        display: block;
    }

    .advantages-main--scroll .advantages-main__pin {
        position: relative;
        z-index: 2;
    }

    .advantages-main--locked .advantages-main__pin {
        position: fixed;
        top: var(--advantages-pin-offset, 138px);
        left: 0;
        right: 0;
        z-index: 20;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    .advantages-main--scroll .advantages-main__card {
        cursor: default;
    }
}

@media (min-width: 1533px) {
    .advantages-main {
        padding-left: 0;
        padding-right: 0;
    }
}

.advantages-main__inner {
    display: flex;
    align-items: flex-start;
    gap: var(--advantages-gap-columns);
    max-width: var(--advantages-container);
    margin: 0 auto;
}

.advantages-main__title {
    flex: 1 1 721px;
    min-width: 0;
    margin: 0;
    font-family: var(--advantages-font);
    font-size: 52px;
    font-weight: 600;
    line-height: 64px;
    color: var(--advantages-color-text);
}

body.in_index .advantages-main__title {
    margin-bottom: 0;
}

.advantages-main__cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 659px;
    width: 659px;
    max-width: 100%;
}

.advantages-main__card {
    display: grid;
    grid-template-columns: 1fr 48px;
    grid-template-areas:
        "title icon"
        "text text";
    align-items: start;
    column-gap: 32px;
    row-gap: 32px;
    margin-bottom: 0;
    padding: 40px;
    background: var(--advantages-color-bg);
    border-radius: 24px;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        height var(--advantages-duration) var(--advantages-ease),
        padding var(--advantages-duration) var(--advantages-ease),
        row-gap var(--advantages-duration) var(--advantages-ease),
        margin-top var(--advantages-duration) var(--advantages-ease),
        margin-bottom var(--advantages-duration) var(--advantages-ease);
}

.advantages-main__card:not(.is-active):not(:first-child) {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.advantages-main__card.is-active + .advantages-main__card:not(.is-active) {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.advantages-main__card.is-active + .advantages-main__card.is-active {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

/* Снизу скругляем только внешний край стопки закрытых карточек */
.advantages-main__card:not(.is-active):has(+ .advantages-main__card:not(.is-active)) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.advantages-main__card.is-active {
    height: 340px;
    margin-top: var(--advantages-gap-cards);
    margin-bottom: var(--advantages-gap-cards);
    overflow: hidden;
    row-gap: 0;
    grid-template-rows: auto 1fr;
    border-radius: 24px;
}

.advantages-main__card.is-active:first-child {
    margin-top: 0;
}

.advantages-main__card.is-active:last-child {
    margin-bottom: 0;
}

.advantages-main__card:focus-visible {
    outline: 2px solid var(--advantages-color-brand);
    outline-offset: 2px;
}

.advantages-main__card:not(.is-active) {
    height: auto;
    min-height: 0;
    row-gap: 0;
    padding-top: 28px;
    padding-bottom: 28px;
}

.advantages-main__card-body {
    display: contents;
}

.advantages-main__card-title {
    grid-area: title;
    margin: 0;
    font-family: var(--advantages-font);
    font-size: 32px;
    font-weight: 500;
    line-height: 40px;
    color: var(--advantages-color-text);
}

.advantages-main__card-icon {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.advantages-main__card-icon img,
.advantages-main__card-icon svg {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.advantages-main__card-text {
    grid-area: text;
    margin: 0;
    width: 100%;
    overflow: hidden;
    max-height: 84px;
    align-self: start;
    opacity: 1;
    font-family: var(--advantages-font);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    color: var(--advantages-color-text);
    transition:
        max-height var(--advantages-duration) var(--advantages-ease),
        opacity calc(var(--advantages-duration) * 0.75) var(--advantages-ease),
        margin-top var(--advantages-duration) var(--advantages-ease);
}

.advantages-main__card:not(.is-active) .advantages-main__card-text {
    max-height: 0;
    opacity: 0;
    margin-top: -32px;
}

.advantages-main__card.is-active .advantages-main__card-text {
    align-self: end;
    height: auto;
    max-height: 84px;
}

.drag-block.container[data-class='ADVANTAGES_MAIN_drag'] {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
}

@media (max-width: 1199px) {
    .advantages-main__inner {
        flex-direction: column;
        gap: 48px;
    }

    .advantages-main__title {
        flex: none;
        width: 100%;
        font-size: 40px;
        line-height: 48px;
    }

    .advantages-main__cards {
        flex: none;
        width: 100%;
    }

    .advantages-main__card.is-active {
        height: auto;
        overflow: visible;
        grid-template-rows: none;
        row-gap: 32px;
        margin-top: 0;
        margin-bottom: 0;
    }

    .advantages-main__card.is-active .advantages-main__card-text {
        align-self: start;
        max-height: none;
        overflow: visible;
    }

    .advantages-main__card:not(.is-active) {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .advantages-main__card:not(.is-active) .advantages-main__card-text {
        margin-top: -12px;
    }

    .advantages-main__card-title {
        font-size: 26px;
        line-height: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .advantages-main__card,
    .advantages-main__card-text {
        transition: none;
    }
}
