.cj-stories {
    padding: 48px 0 36px;
}

.cj-stories__subtitle {
    margin: 7px 0 22px;
    color: var(--cj-text);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

.cj-stories__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.cj-stories__tab {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 32px;
    margin: 0;
    padding: 8px 20px;
    border: 0;
    border-radius: 999px;
    color: var(--cj-text);
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    background: rgba(255, 255, 255, .86);
    box-shadow: none;
    cursor: pointer;
    text-transform: none;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.cj-stories__tab.is-active,
.cj-stories__tab:hover {
    color: #fff;
    background: var(--cj-cyan);
    transform: translateY(-1px);
}

.cj-stories__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.cj-story-card {
    overflow: hidden;
    border: 8px solid #fff;
    border-radius: 18px;
    background: #fff;
    transition: opacity .2s ease, transform .24s ease;
}

.cj-story-card.is-hidden {
    display: none;
}

.cj-stories__grid:not(.is-ready) .cj-story-card:nth-child(n + 13) {
    display: none;
}

.cj-story-card__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.cj-story-card__media {
    width: 100%;
    display: grid;
    gap: 7px;
}

.cj-story-card__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
}

.cj-story-card__image--top {
    aspect-ratio: 4 / 5;
}

.cj-story-card__image--bottom {
    aspect-ratio: 16 / 7;
}

.cj-story-card__title {
    margin: 20px 0 10px;
    color: var(--cj-text);
    font-size: 28px;
    line-height: 1.1;
    font-weight: 500;
    text-align: center;
}

.cj-story-card__more {
    width: min(100%, 198px);
    min-width: 198px;
    min-height: 42px;
    margin: 0 auto 12px;
    padding: 9px 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(22, 137, 230, 0.22);
    background: linear-gradient(180deg, #fff 0%, #f8fcff 100%);
    box-shadow: 0 6px 0 rgba(22, 137, 230, 0.24), 0 10px 20px rgba(42, 157, 236, 0.10);
    color: var(--cj-text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}

.cj-stories__more {
    display: flex;
    width: max-content;
    margin: 30px auto 0;
    min-width: 410px;
    text-transform: uppercase;
    border: 0;
    cursor: pointer;
}

.cj-stories__more[hidden] {
    display: none;
}

@media (min-width: 1200px) {
    .cj-stories {
        padding: 54px 0 28px;
    }

    .cj-stories__subtitle {
        margin-bottom: 16px;
        font-size: 24px;
    }

    .cj-stories__tabs {
        gap: 12px;
        margin-bottom: 24px;
    }

    .cj-stories__tab {
        min-width: 82px;
        min-height: 30px;
        padding: 7px 18px;
        font-size: 17px;
    }

    .cj-stories__grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 250px));
        justify-content: center;
        gap: 24px;
    }

    .cj-story-card {
        border-width: 8px;
        border-radius: 18px;
    }

    .cj-story-card__media {
        gap: 6px;
    }

    .cj-story-card__image {
        border-radius: 11px;
    }

    .cj-story-card__title {
        margin: 16px 0 8px;
        font-size: 24px;
        line-height: 1.08;
    }

    .cj-story-card__more {
        width: min(100%, 176px);
        min-width: 176px;
        min-height: 36px;
        margin-bottom: 10px;
        padding: 7px 24px;
        font-size: 15px;
    }

    .cj-stories__more {
        min-width: 360px;
        margin-top: 24px;
        font-size: 18px;
    }
}

@media (min-width: 850px) and (max-width: 1439px) {
    .cj-stories {
        padding: 46px 0 36px;
    }

    .cj-stories__subtitle {
        margin-bottom: 24px;
        font-size: clamp(22px, 2.5vw, 30px);
    }

    .cj-stories__tabs {
        gap: 10px;
        margin-bottom: 26px;
    }

    .cj-stories__tab {
        min-height: 38px;
        padding: 9px 22px;
        font-size: clamp(15px, 1.7vw, 19px);
    }

    .cj-stories__grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 220px));
        justify-content: center;
        gap: 18px;
    }

    .cj-story-card {
        border-width: 8px;
        border-radius: 18px;
    }

    .cj-story-card__media {
        gap: 6px;
    }

    .cj-story-card__image {
        border-radius: 12px;
    }

    .cj-story-card__title {
        margin: 20px 0 12px;
        font-size: clamp(19px, 2.1vw, 24px);
        line-height: 1.08;
    }

    .cj-story-card__more {
        width: min(100%, 168px);
        min-width: 168px;
        min-height: 34px;
        margin-bottom: 10px;
        padding: 7px 22px;
        font-size: 14px;
    }
}

@media (max-width: 849px) {
    .cj-stories {
        padding: 32px 0 30px;
    }

    .cj-stories__subtitle {
        margin-top: 2px;
        margin-bottom: 12px;
        font-size: 18px;
    }

    .cj-stories__tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 6px;
        margin-bottom: 22px;
        padding-bottom: 4px;
    }

    .cj-stories__tab {
        flex: 0 0 auto;
        min-width: 58px;
        min-height: 20px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .cj-stories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
    }

    .cj-story-card {
        border-width: 8px;
        border-radius: 14px;
    }

    .cj-story-card__media {
        gap: 5px;
    }

    .cj-story-card__image {
        border-radius: 8px;
    }

    .cj-story-card__title {
        margin: 10px 0 5px;
        font-size: 15px;
    }

    .cj-story-card__more {
        width: min(100%, 128px);
        min-width: 128px;
        min-height: 26px;
        margin-bottom: 4px;
        padding: 5px 14px;
        box-shadow: 0 4px 0 rgba(22, 137, 230, 0.20), 0 8px 14px rgba(42, 157, 236, 0.08);
        font-size: 11px;
    }

    .cj-stories__more {
        min-width: 244px;
        min-height: 25px;
        margin-top: 15px;
        font-size: 11px;
    }
}
