/* =========================================
   1. Основная сетка страницы
   ========================================= */
.video-page-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .video-page-layout {
        display: block;
        gap: 0;
        max-width: none;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
}
/* =========================================
   2. Левый основной блок (плеер + мета)
   ========================================= */
.main-video-content {
    flex: 1 1 600px;
    min-width: 0;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .main-video-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        margin-top: 0;
    }
}
/* =========================================
   3. Правая колонка с похожими видео
   ========================================= */
.side-video-widgets {
    flex: 0 0 auto;
    max-width: 333px;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: sticky;
    align-self: flex-start; /* Ключевой параметр: всегда выравнивание по верху */
    max-height: calc(100vh - 40px);
    overflow-y: auto; /* Было visible → auto, чтобы скролл работал при необходимости */
    box-sizing: border-box;
}
/* Скрытый скроллбар */
.side-video-widgets::-webkit-scrollbar {
    width: 6px;
}
.side-video-widgets::-webkit-scrollbar-track {
    background: transparent;
}
.side-video-widgets::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.side-video-widgets::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
.side-video-widgets .cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px; /* Фиксированный отступ между виджетами */
    margin: 0;
    padding: 0;
}
/* =========================================
   Десктоп ≥769px: базовые стили
   ========================================= */
@media (min-width: 769px) {
    .side-video-widgets .cat-grid {
        height: 100%; /* Только по умолчанию — для случая с 3 виджетами */
        align-content: space-between; /* Равномерное распределение только при 3 */
    }
}
/* =========================================
   Высота экрана ≥900px: 3 виджета, равномерно по высоте
   ========================================= */
@media (min-height: 900px) and (min-width: 769px) {
    .side-video-widgets .cat-grid {
        grid-template-rows: 1fr 1fr 1fr; /* Растягиваем на всю высоту */
        align-content: space-between;
        height: 100%;
    }
}
/* =========================================
   Высота экрана 700–899px: только 2 виджета, прижаты к верху
   ========================================= */
@media (min-height: 700px) and (max-height: 899px) and (min-width: 769px) {
    .side-video-widgets .cat-grid {
        grid-template-rows: repeat(2, auto); /* Без растяжки */
        align-content: start; /* Прижимаем к верху */
        height: auto; /* Не занимаем всю высоту */
    }
    .side-video-widgets .cat-pack:nth-child(n+3) {
        display: none;
    }
}
/* =========================================
   Высота экрана 550–699px: только 1 виджет, прижат к верху
   ========================================= */
@media (min-height: 550px) and (max-height: 699px) and (min-width: 769px) {
    .side-video-widgets .cat-grid {
        grid-template-rows: auto; /* Одна строка, без растяжки */
        align-content: start;
        height: auto;
    }
    .side-video-widgets .cat-pack:nth-child(n+2) {
        display: none;
    }
}
/* =========================================
   Высота экрана <550px: полностью скрываем сайдбар
   ========================================= */
@media (max-height: 549px) {
    .side-video-widgets {
        display: none;
    }
}
/* =========================================
   Мобильные по ширине (≤768px) — скрываем
   ========================================= */
@media (max-width: 768px) {
    .side-video-widgets {
        display: none;
    }
}
/* =========================================
   5. Плеер
   ========================================= */
.player-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .player-wrapper {
        order: 2;
        margin: 0 0 10px 0;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
}

.player-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* значение по умолчанию, будет перезаписано JS для вертикальных видео */
    overflow: hidden;
    background: #000;
    border-radius: 12px;
}
@media (max-width: 768px) {
    .player-embed {
        width: 100vw;
        border-radius: 0;
    }
}

/* Ключевой фикс скачка при старте видео на мобильных */
#wpst-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
	object-fit: cover;
    background: #000;
    opacity: 1; /* Видео сразу полностью видимое — убираем fade-in */
}
.player-embed.is-vertical #wpst-video {
    object-fit: contain;     /* ← contain + чёрные полосы по бокам */
}
/* Фикс растяжки видео в fullscreen на Android (portrait) */
/* При fullscreen всегда используем contain — видео не растягивается, появляются чёрные полосы где нужно */
/* На iOS это не повлияет (native fullscreen работает правильно) */
.plyr--fullscreen-enabled {
    background: #000 !important; /* Чёрный фон за видео */
}

.plyr--fullscreen-enabled .plyr__video-wrapper {
    background: #000 !important; /* Дополнительная страховка */
    height: 100% !important;
    width: 100% !important;
}

.plyr--fullscreen-enabled #wpst-video {
    object-fit: contain !important; /* Главное правило — contain вместо cover */
    height: 100% !important;
    width: 100% !important;
    max-height: 100vh !important;
    max-width: 100vw !important;
}

/* Убираем чёрный фон видео — постер будет полностью видимым */
#wpst-video {
    background: transparent !important;
}

/* Страховка: обёртка видео тоже без чёрного */
.plyr__video-wrapper {
    background: transparent !important;
}



/* =========================================
   6. Заголовок и просмотры
   ========================================= */
.video-meta-header {
    margin: 10px 0;
}
@media (max-width: 768px) {
    .video-meta-header {
        order: 3;
        margin-top: 0;
    }
}
.video-title-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: space-between; /* Оставляем для desktop */
    gap: 7px;
    flex-wrap: nowrap; /* Важно: запрещаем перенос, чтобы мета всегда справа */
}
@media (max-width: 768px) {
.video-title-wrapper {
        flex-direction: column;
        align-items: flex-start; /* Заголовок прижат к левому краю (как на YouTube) */
        justify-content: flex-start;
    }
}
.video-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}
@media (max-width: 768px) {
    .video-title {
        font-size: 18px;
        text-align: left;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .video-title::-webkit-scrollbar {
        display: none;
    }
}
.video-views {
    color: #bbbbbb;
    font-size: 15px;
    font-weight: normal;
letter-spacing: 0.2px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* =========================================
   7. Панель действий (лайки + кнопки)
   ========================================= */
.video-actions-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
}
/* ✅ hover ТОЛЬКО на кнопки лайк / дизлайк */
.post-votes .vote-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
/* Можно чуть усилить актив */
.post-votes .vote-btn:active {
    transform: translateY(0);
}
/* Цвета при hover + active */
.post-votes .like-btn:hover {
    color: #4CAF50;
}
.post-votes .dislike-btn:hover {
    color: #F44336;
}
@media (max-width: 768px) {
    .video-actions-bar {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Две равные колонки */
        grid-template-rows: auto auto; /* Две строки */
        gap: 10px 12px; /* Вертикальный 10px, горизонтальный 12px */
        justify-items: stretch; /* Элементы растягиваются по ширине колонки */
        align-items: center;
        padding: 0 10px;
        margin-bottom: 12px;
    }
    /* === Первая строка === */
    /* Лайки/дизлайки — теперь как обычная кнопка */
    .video-actions-bar > .post-votes-wrapper {
        grid-column: 1 / 2;
        grid-row: 1;
        height: 38px; /* Фиксированная высота как у action-btn */
        justify-self: stretch; /* Растягиваем на всю колонку */
    }
    .video-actions-bar > .post-votes-wrapper .post-votes {
        display: flex;
        align-items: center;
        justify-content: center; /* Центрируем содержимое */
        gap: 12px;
        background: #282828; /* Тот же фон, что и у action-btn */
        height: 100%;
        padding: 0 12px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        width: 100%;
        box-sizing: border-box;
    }
    /* Кнопка Comments */
    .video-actions-bar > .action-btn:nth-child(2) { /* Comments */
        grid-column: 2 / 3;
        grid-row: 1;
        height: 38px;
        padding: 0 14px;
        justify-content: center;
    }
    /* === Вторая строка === */
    .video-actions-bar > .action-btn:nth-child(3) { /* Share */
        grid-column: 1 / 2;
        grid-row: 2;
        height: 38px;
        padding: 0 14px;
        justify-content: center;
    }
    .video-actions-bar > .action-btn:nth-child(4) { /* Report */
        grid-column: 2 / 3;
        grid-row: 2;
        height: 38px;
        padding: 0 14px;
        justify-content: center;
    }
}
/* Блок лайков/дизлайков */
.post-votes-wrapper .post-votes {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #222222;
    height: 38px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.post-votes-wrapper .vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 0 12px;
    color: #bbbbbb;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
}
.post-votes .vote-btn .vote-icon {
    font-size: 0;
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.post-votes .like-btn .vote-icon svg,
.post-votes .dislike-btn .vote-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
/* Убираем старую обводку с внутренних кнопок */
.post-votes .like-btn:hover,
.post-votes .like-btn.active,
.post-votes .dislike-btn:hover,
.post-votes .dislike-btn.active {
    box-shadow: none; /* Полностью убираем inset-обводку с внутренних кнопок */
    background: transparent;
}
/* Меняем цвет текста иконки/числа при активном состоянии */
.post-votes .like-btn.active {
    color: #4CAF50;
}
.post-votes .dislike-btn.active {
    color: #F44336;
}
/* =========================================
   8. Кнопки действий (Comments, Share, Report)
   ========================================= */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
padding-left: 12px;
    padding-right: 14px;
    background: #282828; /* Сплошной тёмный фон — без градиента */
    border: none;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13.3px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); /* Внешняя тень остаётся */
    transition: all 0.3s ease;
letter-spacing: 0.3px;
}
.action-btn:hover {
    background: #383838; /* Чуть светлее при ховере — мягкий эффект */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    color: #ffffff;
}
.action-btn svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    fill: currentColor;
    stroke: currentColor;
    opacity: 0.9;
}
.action-btn:hover svg {
    opacity: 1;
}
.icon-comments::before,
.icon-share::before,
.icon-report::before {
    content: none;
}
/* =========================================
   9. Блок категорий и тегов
   ========================================= */
.categories-tags-label {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin: 20px 0 15px 0;
    display: block;
	letter-spacing: 0.5px;
}
@media (max-width: 768px) {
    .categories-tags-label {
        display: none;
    }
}
.video-categories-tags-under {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    padding: 0;
}
@media (max-width: 768px) {
    .categories-tags-section {
 order: 1;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        margin-top: 0 !important;
    }
    .video-categories-tags-under {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 2px 5px 3px;
        margin-top: 0;
        scrollbar-width: none; /* Firefox */
    }
    .video-categories-tags-under::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
}
/* Стили для ссылок — теперь без градиента, чистый фон */
.video-categories-tags-under a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    background: #282828; /* Сплошной тёмный фон — убрали градиент */
    border: none;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13.3px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
letter-spacing: 0.2px;
}
.video-categories-tags-under a:hover {
    background: #383838; /* Мягкое посветление при ховере */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    color: #ffffff;
}
@media (max-width: 768px) {
    .video-categories-tags-under a {
        height: 34px;
        font-size: 12.35px;
        padding: 0 13.3px;
        min-width: fit-content;
    }
}
.video-tags-mobile {
    display: none !important;
}
.video-meta-info {
    display: flex;
    align-items: center;
    gap: 6px; /* Пробел вокруг · */
    white-space: nowrap; /* Чтобы "12 views · 2 months ago" не разрывалась */
    flex-shrink: 0; /* Не сжимается */
    color: #bbbbbb;
    font-size: 16px;
}
@media (max-width: 768px) {
.video-meta-info {
    width: 100%; /* Растягиваем на всю ширину, чтобы совпадать с кнопками */
    display: grid;
    grid-template-columns: 1fr 12px 1fr; /* Левая колонка, центральная (ширина = gap кнопок), правая колонка */
    gap: 0; /* Без лишних gaps, чтобы • был строго в 12px-зоне */
    align-items: center; /* Вертикальное центрирование элементов */
    padding: 0 10px; /* Совпадает с padding в .video-actions-bar для выравнивания по краям */
    font-size: 14px;
    white-space: nowrap; /* Сохраняем, чтобы текст не переносился */
}
.video-meta-info > .video-views:first-of-type {
    text-align: right; /* Views прижат к правому краю левой колонки (ближе к •) */
    padding-right: 4px; /* Опционально: мелкий отступ для визуального баланса, подкорректируйте по шрифту */
}
.video-meta-info > .meta-separator {
    text-align: center; /* • строго по центру 12px-зоны (в отступе между кнопками) */
}
.video-meta-info > .video-views:last-of-type {
    text-align: left; /* Date прижат к левому краю правой колонки (ближе к •) */
    padding-left: 4px; /* Опционально: симметричный отступ */
}
}
/* Только для секции Related videos */
.related-videos-section {
    margin-top: 2em; /* Большой отступ сверху от предыдущего контента (например, от тегов или плеера) */
}
.related-videos-section .widget-header {
    margin: 0 0 1.3em 1px; /* Отступ снизу от заголовка до сетки, слева — как у других */
}
.related-videos-section .widget-title-new {
    margin: 0;
    font-weight: 400;
    font-size: 1.6em; /* Можно подогнать под ваш дизайн */
}
/* Кнопка "Show more" по центру и с отступом */
.related-videos-section .show-more-related {
    text-align: center;
    margin: 2em 0 1em;
}
.related-videos-section .related-videos-btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: #222; /* Или ваш акцентный цвет */
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.1em;
    transition: background-color 0.3s;
}
.related-videos-section .related-videos-btn:hover {
    background-color: #444;
}
/* Серый разделитель во всю ширину только на мобильных устройствах */
@media only screen and (max-width: 768px) {
    .mobile-divider {
        display: block;
        width: 100%;
        height: 0.5px;
        border: none;
        background-color: #333;
        opacity: 1;
    }
}


/* Основной контейнер меню */


/* Базовые стили для всех подменю качества и скорости — только на мобильных (тач) */
@media (pointer: coarse) {
  [id^="plyr-settings-"][id$="-quality"] > div[role="menu"],
  [id^="plyr-settings-"][id$="-speed"]   > div[role="menu"] {
	touch-action: pan-y;              /* Разрешаем только вертикальный скролл внутри */
    overscroll-behavior-y: contain;   /* Самое важное — не даём скроллу "выходить" на body */
    -webkit-overflow-scrolling: touch;
    max-height: 15vh !important;
    overflow-y: auto !important;
    -ms-overflow-style: none;          /* IE + старый Edge */
    scrollbar-width: none;             /* Firefox */
  }

	
  /* WebKit-браузеры (Chrome/Safari на Android/iOS) */
  [id^="plyr-settings-"][id$="-quality"] > div[role="menu"]::-webkit-scrollbar,
  [id^="plyr-settings-"][id$="-speed"]   > div[role="menu"]::-webkit-scrollbar {
    display: none;
  }
}

/* Специальное правило для очень узких и очень высоких экранов (типа 344×882) */
@media (pointer: coarse) and (max-width: 360px) and (min-height: 850px) {
  [id^="plyr-settings-"][id$="-quality"] > div[role="menu"],
  [id^="plyr-settings-"][id$="-speed"]   > div[role="menu"] {
    max-height: 10vh !important;   /* ← как просили — 10vh */
  }
}


.plyr--full-ui input[type=range] {
  color: #fafafa;
}

/* Фон всегда прозрачный — без изменений */
.plyr--video .plyr__control:not(.plyr__control--overlaid):hover,
.plyr--video .plyr__control:not(.plyr__control--overlaid):focus,
.plyr--video .plyr__control:not(.plyr__control--overlaid).plyr__tab-focus,
.plyr--video .plyr__control:not(.plyr__control--overlaid)[aria-expanded="true"] {
    background: rgba(0, 0, 0, 0.0) !important;
    box-shadow: none !important; /* Убираем возможные тени фокуса */
    transform: none !important; /* Запрещаем любой масштаб */
}

/* На случай, если где-то применяется currentColor с другим контекстом */
.plyr--video .plyr__controls .plyr__control:hover {
    color: inherit !important;
}

.plyr__control.plyr__tab-focus {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.3);
}

.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before {
  background: #fafafa;
}

/* Кастомная кнопка Play — уменьшенная версия, как на Pornhub/xHamster, без scale и сдвигов */
.plyr__control--overlaid {
  width: 80px !important;
  height: 80px !important;
  background: rgba(30, 30, 30, 0.7) !important;   /* тёмно-серая полупрозрачная */
  border-radius: 50% !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
  opacity: 0.95 !important;
  transition: background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Белая иконка — тоже уменьшена */
.plyr__control--overlaid svg {
 width: 38px !important;
 height: 38px !important;
 color: #fafafa !important;
 filter: drop-shadow(0 3px 3px rgba(0,0,0,0.1)) !important;

}

/* Hover — только осветление фона и тени, без любого масштаба */
.plyr__control--overlaid:hover,
.plyr__control--overlaid:focus {
  background: rgba(50, 50, 50, 0.7) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
}



/* На мобильных — чуть больше (но всё равно уменьшено по сравнению с предыдущим) */
@media (max-width: 768px) {
  .plyr__control--overlaid {
    width: 80px !important;
    height: 80px !important;
  }

  .plyr__control--overlaid svg {
    width: 35px !important;
    height: 35px !important;
  }
}





.plyr__menu__container .plyr__control[role=menuitemradio] {
    padding-left: 7px;
    padding-left: calc(var(--plyr-control-spacing, 10px)*.7);
}

.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before {
    border-radius: 100%;
}

.plyr__menu__container .plyr__control[role=menuitemradio]:before {
    background: #0000001a;         /* Не выбран — лёгкий серый */
    content: "";
    display: block;
    flex-shrink: 0;
    height: 18px;                  /* Чуть больше для видимости */
    margin-right: 12px;
    margin-right: var(--plyr-control-spacing,12px);
    transition: all .3s ease;
    width: 18px;
}

/* Убрали внутреннюю белую точку полностью */
.plyr__menu__container .plyr__control[role=menuitemradio]:after {
    display: none !important;      /* Полностью скрываем ::after */
}

/* Выбранное качество — сплошной серый круг */
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before {
    background: #888888;           /* Серый цвет — сплошной заполненный круг */
    /* Если хотите другой оттенок серого: #777777 (темнее), #aaaaaa (светлее) и т.д. */
}

/* Не даём менять фон выбранного пункта при hover/focus */
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:hover:before,
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:focus-visible:before,
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true].plyr__tab-focus:before {
    background: #888888 !important;     /* Твой серый остаётся всегда */
    opacity: 1 !important;              /* На всякий случай, если где-то стоит opacity */
}

/* На случай, если hover применяется к не выбранным — оставляем как есть, но можно заблокировать полностью */
.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before,
.plyr__menu__container .plyr__control[role=menuitemradio]:focus-visible:before {
    background: #0000001a !important;   /* Оригинальный лёгкий фон для невыбранных */
}

/* Дополнительная страховка — если Plyr где-то использует transition на ::before */
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before {
    transition: none !important;        /* Убираем плавность изменения, если она мешает */
}

.plyr *:focus,
.plyr *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}