/* ==========================================================================
   Страница «Курсы» — вертикальные карточки-обложки
   ========================================================================== */

.cr-page {
    --cr-bg: #fcf0ea;
    --cr-line: #e2cbbc;
    --cr-accent: #b28663;
    --cr-ink: #1d1d1d;
    --cr-shadow: 0 26px 58px rgba(122, 78, 45, 0.16);
    --cr-shadow-soft: 0 16px 36px rgba(122, 78, 45, 0.12);

    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 2%, rgba(255, 255, 255, 0.9), transparent 32%),
        radial-gradient(circle at 94% 18%, rgba(178, 134, 99, 0.12), transparent 30%),
        radial-gradient(circle at 2% 86%, rgba(178, 134, 99, 0.10), transparent 28%),
        var(--cr-bg);
}

.cr-page *,
.cr-page *::before,
.cr-page *::after {
    box-sizing: border-box;
}

.cr-container {
    width: min(1260px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

.cr-section {
    position: relative;
    padding: clamp(46px, 5.5vw, 88px) 0;
}

.cr-section--head {
    padding-bottom: clamp(26px, 3vw, 42px);
}

.cr-section--flush {
    padding-top: 0;
}

.cr-stars {
    position: absolute;
    top: 3%;
    right: -40px;
    width: clamp(180px, 22vw, 340px);
    opacity: 0.18;
    transform: rotate(24deg);
    pointer-events: none;
    user-select: none;
}

/* --- шапка --------------------------------------------------------------- */

.cr-head {
    text-align: center;
}

.cr-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
    font-family: "Spectral", serif;
    font-size: 13px;
    font-style: italic;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cr-accent);
}

.cr-eyebrow::before,
.cr-eyebrow::after {
    content: "";
    width: 40px;
    height: 1px;
    background: var(--cr-accent);
    opacity: 0.6;
}

.cr-title {
    margin: 0;
    font-family: "Forum", serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 4.2vw, 3.8rem) !important;
    line-height: 1.1;
    color: var(--cr-ink);
}

.cr-title::after {
    content: "";
    display: block;
    width: 96px;
    height: 1px;
    margin: 26px auto 0;
    background: var(--cr-accent);
    opacity: 0.55;
}

/* --- сетка --------------------------------------------------------------- */

.cr-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px;
}

/* --- карточка курса ------------------------------------------------------ */

.cr-card {
    position: relative;
    display: block;
    flex: 0 1 calc((100% - 52px) / 3);
    max-width: calc((100% - 52px) / 3);
    overflow: hidden;
    border-radius: 28px;
    background: #2a211b;
    box-shadow: var(--cr-shadow-soft);
    text-decoration: none;
    aspect-ratio: 3 / 4;
    transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s ease;
}

.cr-card:hover,
.cr-card:focus-visible {
    transform: translateY(-10px);
    box-shadow: var(--cr-shadow);
    text-decoration: none;
}

.cr-card__media {
    position: absolute;
    inset: 0;
}

.cr-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.1s cubic-bezier(.22, .61, .36, 1);
}

.cr-card:hover .cr-card__media img {
    transform: scale(1.07);
}

/* затемнение снизу — чтобы текст всегда читался поверх любого фото */
.cr-card__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(24, 16, 11, 0.55) 0%, rgba(24, 16, 11, 0) 34%),
        linear-gradient(0deg, rgba(24, 16, 11, 0.92) 0%, rgba(24, 16, 11, 0.72) 26%, rgba(24, 16, 11, 0.18) 54%, rgba(24, 16, 11, 0) 72%);
    pointer-events: none;
    transition: opacity .45s ease;
}

.cr-card:hover .cr-card__scrim {
    opacity: 0.92;
}

/* стрелка */
.cr-card__arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    transition: background-color .35s ease, border-color .35s ease, color .35s ease, transform .35s ease;
}

.cr-card__arrow svg {
    width: 13px;
    height: 22px;
}

.cr-card:hover .cr-card__arrow {
    background: #fffaf6;
    border-color: #fffaf6;
    color: var(--cr-accent);
    transform: translateX(4px);
}

/* текстовый блок */
.cr-card__body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 26px 26px 28px;
    color: #fff;
}

.cr-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 10px;
    min-height: calc(2 * 1.24em);
    font-family: "Forum", serif;
    font-weight: 600;
    font-size: 1.32rem !important;
    line-height: 1.24;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.cr-card__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    min-height: calc(3 * 1.55em);
    font-family: "Spectral", serif;
    font-size: 0.98rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* тонкая линия-акцент под текстом */
.cr-card__body::after {
    content: "";
    display: block;
    width: 46px;
    height: 2px;
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.65);
    transition: width .45s cubic-bezier(.22, .61, .36, 1), background-color .45s ease;
}

.cr-card:hover .cr-card__body::after {
    width: 92px;
    background: #fff;
}

/* ==========================================================================
   ПОЯВЛЕНИЕ ПРИ СКРОЛЛЕ (класс cr-anim ставит скрипт)
   ========================================================================== */

.cr-page.cr-anim .cr-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s cubic-bezier(.22, .61, .36, 1), transform .8s cubic-bezier(.22, .61, .36, 1);
    will-change: opacity, transform;
}

.cr-page.cr-anim .cr-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .cr-page.cr-anim .cr-reveal,
    .cr-card {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   АДАПТИВ
   ========================================================================== */

@media (max-width: 1199.98px) {
    .cr-card {
        flex-basis: calc((100% - 26px) / 2);
        max-width: calc((100% - 26px) / 2);
    }
}

@media (max-width: 767.98px) {
    .cr-stars {
        display: none;
    }

    .cr-grid {
        gap: 22px;
    }

    .cr-card {
        flex-basis: 100%;
        max-width: 100%;
        aspect-ratio: 4 / 5;
    }

    .cr-card__body {
        padding: 22px 22px 24px;
    }
}

@media (max-width: 575.98px) {
    .cr-card {
        aspect-ratio: 3 / 4;
    }
}
