/* ============================================================
 * hero-video.css — видео-фон: placeholder, спиннер, кнопка-скролл.
 * Базовое позиционирование .hero-video-block — в header-hero.css.
 * Подключается глобально через includes/head.php.
 * ============================================================ */

/* --- Placeholder: полупрозрачное лого на чёрном фоне --- */
.hero-video-block__placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 1;
    transition: opacity .4s ease;
    pointer-events: none;
}
.hero-video-block.is-ready .hero-video-block__placeholder {
    opacity: 0;
}
.hero-video-block__placeholder img {
    width: 80%;
    max-width: 80%;
    height: auto;
    opacity: .15;
    filter: grayscale(1) brightness(2);
    user-select: none;
    pointer-events: none;
}

/* --- Спиннер --- */
.hero-video-block__loader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity .4s ease;
}
.hero-video-block.is-ready .hero-video-block__loader {
    opacity: 0;
    visibility: hidden;
}
.hero-video-block__spinner {
    width: 72px;
    height: 72px;
    border: 5px solid rgba(254, 213, 0, .2);
    border-top-color: #fed500;
    border-radius: 50%;
    animation: hero-video-spin .9s linear infinite;
    box-sizing: border-box;
}
@keyframes hero-video-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
    .hero-video-block__spinner {
        width: 54px;
        height: 54px;
        border-width: 4px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero-video-block__spinner { animation-duration: 2s; }
}

/* --- Кнопка-скролл --- */
.hero-video-block__scroll {
    position: absolute;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 30;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid #fed500;
    border-radius: 50%;
    background: rgba(0, 0, 0, .25);
    color: #fed500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
    animation: hero-scroll-bounce 1.8s ease-in-out infinite;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}
.hero-video-block__scroll:hover,
.hero-video-block__scroll:focus-visible {
    background: #fed500;
    color: #0b0b0d;
    border-color: #fed500;
    animation-play-state: paused;
    transform: translateX(-50%) translateY(-2px);
    outline: none;
}
.hero-video-block__scroll svg {
    width: 22px;
    height: 22px;
    display: block;
    pointer-events: none;
}
@keyframes hero-scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-video-block__scroll { animation: none; }
}
@media (max-width: 640px) {
    .hero-video-block__scroll { width: 44px; height: 44px; bottom: 60px; }
    .hero-video-block__scroll svg { width: 18px; height: 18px; }
}

/* ============================================================
 * hero-header-wrap — «шапка + видео-фон» (как на /styleguide/),
 * применяется на всех страницах, где есть разметка .hero-header-wrap.
 * На /styleguide/ перекрывается правилами из header-hero.css (body.sg-page…),
 * на остальных (в т.ч. главной) — работает этот блок.
 * ============================================================ */

.hero-header-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--hh-black, #000);
    isolation: isolate;
}

/* Видео-блок внутри обёртки — абсолютом под шапкой */
.hero-header-wrap .hero-video-block {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    z-index: 0;
    background: var(--hh-black, #000);
    overflow: hidden;
}

/* Шапка — поверх видео, прозрачная, компактная */
.hero-header-wrap .p2-header-hero {
    position: relative;
    z-index: 10;
    background: transparent;
}

/* Убираем форс-высоты у шапки внутри обёртки (главная — .p2-header-hero--home) */
.hero-header-wrap .p2-header-hero,
.hero-header-wrap .p2-header-hero--home,
.hero-header-wrap .p2-header-hero--inner,
.hero-header-wrap .p2-header-hero:not(.p2-header-hero--home) {
    min-height: 0 !important;
    max-height: none !important;
    height: 100% !important;
    background: transparent !important;
    overflow: visible !important;
    padding: 0 !important;
}

/* Базовые размеры самого .hero-video-block (если вдруг рендерится вне обёртки) */
.hero-header-wrap > .hero-video-block,
.hero-header-wrap > .hero-video-block--home,
.hero-header-wrap > .hero-video-block--inner {
    height: 100%;
    max-height: none;
}

/* ============================================================
 * Базовые правила для .hero-video-block и .hero-video-block__video.
 * Подключаются глобально (в т.ч. на главной), чтобы видео
 * растягивалось на весь блок и обрезалось по cover.
 * На /styleguide/ перекрывается более специфичными правилами
 * из header-hero.css (body.sg-page …).
 * ============================================================ */

.hero-video-block {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--hh-black, #000);
    display: block;
}

.hero-video-block--home,
.hero-video-block--inner {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: none;
}

.hero-video-block__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    z-index: 0;
}