/* ——— ГЛОБАЛЬНОЕ ПРАВИЛО main (для single-страниц) ——— */
main.main {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
}

/* общий контейнер для всех записей */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main.main {
  flex: 1; /* Занимает всё доступное пространство */
}

footer {
  /* Без position: absolute/fixed */
}

.single__content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px; /* отступ перед футером, чтобы видео не лезло */
}

/* универсальный блок: текст + медиа */
@media (min-width: 1024px) {
    .single__content-layout {
        display: flex;
        gap: 40px;
        flex-wrap: wrap;
    }

    .single__content-text {
        flex: 1;
        max-width: 50%;
    }

    .single__content-media {
        flex: 1;
        max-width: 50%;
    }

    /* ВАЖНО: НЕ обрезаем высоту, только адаптивность */
    .single__content-media .mejs-video,
    .single__content-media #mep_0 {
        width: 100%   !important;
        height: auto  !important;
        max-height: 80vh; /* Видео не займёт больше 80 % высоты экрана */
        overflow: visible; 
    }
    /* Масштабируем видео */
    .single__content iframe,
    .single__content .mejs-video {
       transform: scale(0.4); /* Уменьшаем на 60 % */
       transform-origin: center top; /* Точка масштабирования */
       display: block;
       margin: 0 auto;
    }

    /* фото — по центру, максимум по ширине блока */
    .single__content-media-image {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        margin: 0 auto;
    }
}

/* на мобильных — один под другим */
@media (max-width: 1023px) {
    .single__content-layout {
        display: flex;
    }

    .single__content-text,
    .single__content-media {
        width: 100% !important;
        margin-bottom: 20px;
    }

    /* на мобильных тоже НЕ обрезаем высоту */
    .single__content-media .mejs-video,
    .single__content-media #mep_0 {
        width: 100%   !important;
        height: auto  !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* поддержка полноэкранного режима MediaElement */
/* в полноэкране отключаем ограничения */
.mejs-container.mejs-fullscreen,
.mejs-container.mejs-fullscreen .mejs-video {
  max-height: none;
  max-width: none;
  height: 100vh;
  width: 100vw;
  left: 0;
  top: 0;
  position: fixed;
  z-index: 99999;
  overflow: hidden;
}
.single__content::after {
    content: "";
    display: table;
    clear: both;
}
footer {
  position: relative;
  z-index: 10; /* Выше видео */
}

.single__content iframe,
.single__content .mejs-video {
  z-index: 5; /* Ниже футера */
  position: relative; /* Если было absolute/fixed */
}