﻿/* ============================================
   PR-MODAL-1: общий скролл модалок (мобильный)
   Дублирует themes.css — post-modal.css грузится
   сразу; merge.css обновится при npm run build.
   CapCut (.capcut-modal) НЕ использует .modal-overlay.
   ============================================ */
.modal-overlay {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-panel {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.modal-open,
html.modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* ============================================
   POST / MEDIA VIEWER — ВИДЕО НА ВСЮ ШИРИНУ
   ============================================ */

/* Контейнер медиа — на всю ширину */
.media-viewer-stage {
    background: #000 !important;
    min-height: 200px;
    overflow: hidden;
    width: 100% !important;
}

.media-viewer-frame {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.media-viewer-frame .relative {
    width: 100% !important;
    max-width: 100% !important;
}

/* ВИДЕО — НА ВСЮ ШИРИНУ, ВЫСОТА ПОДСТРАИВАЕТСЯ */
#viewer-video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 75vh !important;
    max-height: 75dvh !important;
    min-height: 200px !important;
    object-fit: contain !important;
    background: #000;
    display: block !important;
    margin: 0 auto !important;
}

/* Постер тоже на всю ширину */
.media-viewer-frame img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 75vh !important;
    max-height: 75dvh !important;
    object-fit: contain !important;
    display: block !important;
}

/* Кнопка Play — поверх постера */
.media-viewer-frame button {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.media-viewer-frame button img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 75vh !important;
    max-height: 75dvh !important;
    object-fit: contain !important;
}

/* Контролы видео */
video::-webkit-media-controls {
    display: flex !important;
}
video::-webkit-media-controls-panel {
    display: flex !important;
}

/* === АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ === */
@media (max-width: 768px) {
    #viewer-video,
    .media-viewer-frame img,
    .media-viewer-frame button img {
        max-height: 60vh !important;
        max-height: 60dvh !important;
        min-height: 150px !important;
    }
}

@media (max-width: 640px) {
    #viewer-video,
    .media-viewer-frame img,
    .media-viewer-frame button img {
        max-height: 55vh !important;
        max-height: 55dvh !important;
        min-height: 120px !important;
    }
}

@media (max-width: 480px) {
    #viewer-video,
    .media-viewer-frame img,
    .media-viewer-frame button img {
        max-height: 50vh !important;
        max-height: 50dvh !important;
        min-height: 100px !important;
    }
}

/* Ошибка загрузки */
.media-viewer-frame .flex-col {
    width: 100% !important;
    max-width: 100% !important;
}