/* === Медиаконтент в постах: адаптивное отображение === */

.ve-photo-item,
.ve-video-item,
.ve-embed-wrap {
    width: 100%;
    max-width: 100%;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.ve-photo-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 90vh;
}

/* Контейнер для фото с размытым фоном */
.ve-photo-item.ve-blurred-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ve-photo-item.ve-blurred-bg::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: inherit;
    filter: blur(25px) brightness(0.7);
    z-index: 0;
}

.ve-photo-item.ve-blurred-bg img {
    position: relative;
    z-index: 1;
    object-fit: contain;
    width: 100%;
    height: auto;
    max-height: 90vh;
    margin: 0 auto;
    display: block;
}

/* Видео: размытый фон из превью */
.ve-video-item {
    aspect-ratio: 16/9;
    background: #000;
}

.ve-video-item.ve-blurred-bg {
    background-size: cover;
    background-position: center;
}

.ve-video-item.ve-blurred-bg::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: inherit;
    filter: blur(25px) brightness(0.5);
    z-index: 0;
}

.ve-video-item video {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Развёртывание/свёртывание поста */
.ve-post-content {
    position: relative;
    width: 100%;
}

.ve-post-content.ve-collapsed {
    max-height: 90vh;
    overflow: hidden;
}

.ve-post-content.ve-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #fff 5%, rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 5;
}

.ve-expand-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px;
    background: none;
    border: none;
    color: #2196f3;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px dashed #2196f3;
    margin-top: -5px;
    position: relative;
    z-index: 6;
}

.ve-expand-btn:hover {
    text-decoration: none;
    color: #1769aa;
}

/* Полноэкранный режим видео */
.ve-video-item:fullscreen video {
    object-fit: contain;
    background: #000;
}

/* Отзывчивость: все устройства */
.icms-content-fields .ve-photo-item,
.icms-content-fields .ve-video-item,
.icms-content-fields .ve-embed-wrap,
.lenta_long_content .ve-photo-item,
.lenta_long_content .ve-video-item,
.lenta_long_content .ve-embed-wrap {
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
    max-width: none;
    border-radius: 0;
}

.content_item .ve-photo-item,
.content_item .ve-video-item,
.content_item .ve-embed-wrap {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

/* === Настольная версия === */
@media screen and (min-width: 993px) {
    .ve-photo-item img {
        max-height: 90vh;
    }
    .ve-video-item {
        max-height: 90vh;
    }
}

/* === Планшет === */
@media screen and (min-width: 577px) and (max-width: 992px) {
    .ve-photo-item img {
        max-height: 85vh;
    }
}

/* === Мобильная версия === */
@media screen and (max-width: 576px) {
    .ve-photo-item img {
        max-height: 80vh;
    }

    .lenta_long_content .ve-photo-item,
    .lenta_long_content .ve-video-item,
    .lenta_long_content .ve-embed-wrap {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }

    .ve-video-item .controls {
        padding: 6px;
    }

    .ve-video-item .row_video {
        gap: 5px;
    }
}
