/**
 * KSM Video Component
 * Фасад видео: постер + play → по клику iframe (YouTube / Дзен)
 * Подключается условно только на записях с категорией «video»
 */


/* ═══════════════════════════════════ */
/*  Hero без картинки (видео-запись)   */
/* ═══════════════════════════════════ */

.article-hero--video {
    padding: 120px 24px 0;
    text-align: center;
    background: #0D0B0B;
    height: auto;
    min-height: auto;
    max-height: none;
}

.article-hero--video .hero-content {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
}

.article-hero--video .hero-title {
    text-shadow: none;
}

/* Убираем лишний отступ перед видео-контентом */
.article-content.article-content--video {
    padding-top: 0;
}

@media (max-width: 768px) {
    .article-hero--video {
        padding: 100px 16px 0;
    }
}

@media (max-width: 480px) {
    .article-hero--video {
        padding: 88px 16px 0;
    }
}


/* ═══════════════════════════════════ */
/*  Одиночное видео                   */
/* ═══════════════════════════════════ */

.ksm-video {
    position: relative;
    width: 280px;
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: #151313;
    margin: 0 auto;
}

/* Обёртка: видео + текст рядом */
.ksm-video-wrap {
    display: flex;
    justify-content: center;
    gap: 32px;
    align-items: center;
    margin: 16px 0 48px;
}

/* Постер */
.ksm-video__poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease, filter .4s ease;
    filter: brightness(.55);
    display: block;
}

.ksm-video:hover .ksm-video__poster {
    transform: scale(1.03);
    filter: brightness(.65);
}

/* Оверлей (градиент) */
.ksm-video__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(13,11,11,.75) 0%, transparent 35%),
        linear-gradient(180deg, rgba(13,11,11,.35) 0%, transparent 25%);
    pointer-events: none;
}

/* Кнопка play */
.ksm-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(215, 0, 0, .85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease, background .3s ease;
    box-shadow: 0 4px 30px rgba(215, 0, 0, .3);
    z-index: 2;
}

.ksm-video__play svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin-left: 2px;
}

.ksm-video:hover .ksm-video__play {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(215, 0, 0, .95);
}

/* Длительность */
.ksm-video__duration {
    position: absolute;
    bottom: 14px;
    right: 14px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 3px 8px;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 2;
}

/* Текст рядом с видео */
.ksm-video-info {
    max-width: 340px;
}

.ksm-video-info__label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: #D70000;
    font-weight: 500;
    margin-bottom: 14px;
    font-family: 'Jost', sans-serif;
}

.ksm-video-info__title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 300;
    color: #C0BFBF;
    line-height: 1.3;
    margin-bottom: 12px;
}

.ksm-video-info__desc {
    font-size: 16px;
    color: #777;
    line-height: 1.6;
    font-family: 'Jost', sans-serif;
}

/* iframe после клика */
.ksm-video__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}


/* ═══════════════════════════════════ */
/*  Серия видео — сетка               */
/* ═══════════════════════════════════ */

.ksm-video-series {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 32px 0 48px;
}

/* Карточка серии */
.ksm-video-series .ksm-video {
    width: 100%;
    min-width: unset;
    border-radius: 14px;
    margin: 0;
}

.ksm-video-series .ksm-video__play {
    width: 44px;
    height: 44px;
    box-shadow: 0 3px 20px rgba(215, 0, 0, .25);
}

.ksm-video-series .ksm-video__play svg {
    width: 15px;
    height: 15px;
}

.ksm-video-series .ksm-video:hover .ksm-video__play {
    transform: translate(-50%, -50%) scale(1.1);
}

.ksm-video-series .ksm-video__duration {
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
}

.ksm-video-series .ksm-video__iframe {
    border-radius: 14px;
}

/* Подпись под карточкой */
.ksm-video-series .ksm-video-card {
    display: flex;
    flex-direction: column;
}

.ksm-video-card__part {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #D70000;
    font-weight: 500;
    margin: 8px 0 4px;
    font-family: 'Jost', sans-serif;
}

.ksm-video-card__title {
    font-size: 14px;
    font-weight: 400;
    color: #E0DFDF;
    line-height: 1.3;
    font-family: 'Jost', sans-serif;
}


/* ═══════════════════════════════════ */
/*  Responsive                        */
/* ═══════════════════════════════════ */

@media (max-width: 700px) {
    .ksm-video-wrap {
        flex-direction: column;
        gap: 24px;
    }

    .ksm-video-wrap .ksm-video {
        width: 100%;
        max-width: 300px;
    }

    .ksm-video-info {
        text-align: center;
        max-width: 100%;
    }

    .ksm-video-series {
        gap: 10px;
    }

    .ksm-video-series .ksm-video__play {
        width: 34px;
        height: 34px;
    }

    .ksm-video-series .ksm-video__play svg {
        width: 12px;
        height: 12px;
    }

    .ksm-video-card__title {
        font-size: 12px;
    }
}
