/* Allure — YouTube / MP4 popup（reserve 可单独引用） */
body.video-modal-open {
    overflow: hidden !important;
}

body.video-modal-open .site-chrome {
    visibility: hidden;
    pointer-events: none;
}

.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.video-overlay.is-visible {
    opacity: 1;
}

.video-modal-panel {
    position: relative;
    width: 80vw;
    max-width: 1200px;
    min-width: 280px;
}

.video-modal-panel.is-portrait {
    width: min(80vw, calc(85vh * 9 / 16));
    max-width: min(80vw, calc(85vh * 9 / 16));
}

.video-modal-half .video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-panel.is-portrait .video-container {
    aspect-ratio: 9 / 16;
    max-height: 85vh;
}

.video-modal-half .video-container iframe,
.video-modal-half .video-container video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    background: #000;
}

.video-rotate-hint {
    display: none;
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom, 12px));
    transform: translateX(-50%);
    z-index: 100003;
    margin: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    pointer-events: none;
}

.video-overlay.is-portrait-host .video-rotate-hint {
    display: block;
}

.video-close {
    position: absolute;
    top: -44px;
    right: 0;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s, background 0.3s;
}

.video-close:hover {
    color: #C5A059;
}

@media (max-width: 1024px) {
    .video-modal-panel {
        width: 92vw;
    }

    .video-modal-panel.is-portrait {
        width: min(92vw, calc(88vh * 9 / 16));
    }

    .video-overlay.is-portrait-host .video-modal-panel {
        width: 100%;
        max-width: 100%;
    }

    .video-close {
        top: max(8px, env(safe-area-inset-top, 0px));
        right: max(4px, env(safe-area-inset-right, 0px));
    }
}

/* 横屏：100dvh 内 16:9（尺寸由 CSS 计算，旋转自动重排） */
.video-overlay.is-landscape-immersive {
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    background: #000;
    backdrop-filter: none;
}

.video-overlay.is-landscape-immersive .video-modal-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: none;
    min-width: 0;
}

.video-overlay.is-landscape-immersive .video-container {
    aspect-ratio: 16 / 9;
    width: min(100vw, calc(100vh * 16 / 9));
    width: min(100dvw, calc(100dvh * 16 / 9));
    height: auto;
    max-height: 100vh;
    max-height: 100dvh;
    box-shadow: none;
}

.video-overlay.is-landscape-immersive .video-rotate-hint {
    display: none;
}

.video-overlay.is-landscape-immersive .video-close {
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    z-index: 100002;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    font-size: 30px;
    line-height: 44px;
    text-align: center;
}

.video-overlay.is-landscape-immersive .video-close:hover {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

.video-trigger,
#youtube-facade {
    cursor: pointer;
}

.video-trigger iframe:not(.hero-video-embed),
#youtube-facade iframe {
    display: none !important;
}
