/**
 * Стили для плагина "Ленивая загрузка"
 *
 * @version     1.010
 */

:root{
    --size_ll: 40px;
}

/* Базовые стили для lazyload */
.lazyload{
    display: none;
}

body.js .lazyload{
    display: block;
}

picture.loading{
    position: relative;
}

/* Спиннер через псевдоэлемент */
picture.loading:before{
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--size_ll);
    height: var(--size_ll);
    margin-top: calc(-1 * var(--size_ll) / 2);
    margin-left: calc(-1 * var(--size_ll) / 2);
    border: calc(var(--size_ll) / 10) solid #DDD;
    border-top-color: var(--primary-color, #3498DB);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
    z-index: 1;
}

/* Анимация вращения */
@keyframes spinner-rotate{
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(360deg);
    }
}

.video_container{
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: 100%;
    height: auto;
    text-align: center;
}

.video_container picture,
.video_container img,
.video_container iframe{
    position: absolute;
    left: 0;
    top:0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Контейнер с инфой */
.video_container .video_info{
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    padding: 12px 14px;
    gap: 12px;

    /* Универсальный градиент: тёмный у основания → прозрачный к верху */
    background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.45) 40%,
            transparent 100%
    );

    /* Текст не должен блокировать клик по превью */
    pointer-events: none;
}

/* название ролика */
.video_container .video_title{
    color: #FFF;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: left;

    /* Гибкое растягивание + защита от переполнения flex-контейнера */
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    /*-webkit-line-clamp: 2;*/
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ссылка на видео-хостинг */
.video_container .video_link{
    color: rgba(255, 255, 255, 0.85);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    transition: color 0.2s ease;
    pointer-events: auto; /* Возвращаем кликабельность */
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video_container .video_link:hover{
    color: #FFF;
}

.play_button{
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: none;
    padding: 0;
    width: 68px;
    height: 48px;
    border: none;
    background-color: transparent;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.rutube .play_button{
    width: 72px;
    height: 72px;
}

.play_button-shape{
    color: #212121;
    fill-opacity: 0.8;
}

.play_button-icon{
    fill: #FFF;
}

.play_button:focus{
    outline: none;
}

.play_button:hover .play_button-shape,
.play_button:focus .play_button-shape{
    color: var(--hover_color, #00A1E7);
    fill-opacity: 1;
}

.video_container.enabled .play_button{
    display: block;
}

.video_container.run{
    background-color: #000;
}

.video_container.run picture,
.video_container.run .play_button,
.video_container.run .video_info{
    opacity: 0;
    transition: opacity 300ms;
}