/* ===== Arkdio Slide Popup - Frontend Styles ===== */

/* Popup Overlay */
.psp-popup-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.psp-popup-wrap.psp-visible {
    opacity: 1;
}

/* Background overlay */
.psp-popup-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* Popup Container - max-width set dynamically via JS */
.psp-popup-container {
    position: relative;
    z-index: 2;
    width: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Slider */
.psp-popup-slider {
    width: 100%;
    overflow: hidden;
}
.psp-popup-slider .swiper-wrapper {
    display: flex;
    align-items: flex-start;
}

/* Slide */
.psp-slide {
    flex-shrink: 0;
}
.psp-slide-inner {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: #fff;
    isolation: isolate; /* 명확한 스택 컨텍스트 생성 → iframe/poster z-index 정상 동작 */
    /* border-radius set via inline style from settings */
}
/* PC: hover - entire slide lifts up (distance set by JS) */
@media (min-width: 769px) {
    .psp-hover-enabled .psp-slide {
        transition: transform 0.25s ease;
    }
}
.psp-slide-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.psp-slide-inner a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.psp-slide-inner a img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bottom bar */
.psp-popup-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 5px;
    box-sizing: border-box;
}

/* Checkbox - 13px */
.psp-popup-check {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff !important;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.psp-popup-check span {
    color: #fff !important;
}
.psp-popup-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #fff;
    cursor: pointer;
}

/* Close button - SAME 13px as checkbox */
.psp-popup-close {
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
}
.psp-popup-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    text-decoration: none;
}

/* ===== Navigation Arrows ===== */
.psp-nav-prev,
.psp-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    color: rgba(255,255,255,0.8);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.psp-nav-prev:hover,
.psp-nav-next:hover {
    color: #fff;
}
.psp-nav-prev svg,
.psp-nav-next svg {
    width: 100%;
    height: 100%;
}
.psp-nav-prev.swiper-button-disabled,
.psp-nav-next.swiper-button-disabled {
    opacity: 0.2;
    cursor: default;
}
/* PC: arrows outside slider area, inside container */
.psp-nav-prev {
    left: -44px;
}
.psp-nav-next {
    right: -44px;
}

/* ===== Mobile - Centered + Symmetric Peek ===== */
@media (max-width: 768px) {
    .psp-popup-container {
        width: 100%;
        padding: 0 4%;
        box-sizing: border-box;
    }
    .psp-popup-bottom {
        padding: 10px 0;
    }
    .psp-popup-check {
        font-size: 12px;
    }
    .psp-popup-close {
        font-size: 12px;
    }
    /* Overflow visible to show symmetric peek on both sides */
    .psp-popup-slider {
        overflow: visible;
    }
    /* Inactive slides dimmed for peek effect */
    .psp-popup-slider .swiper-slide {
        opacity: 0.35;
        transition: opacity 0.3s ease;
    }
    .psp-popup-slider .swiper-slide-active {
        opacity: 1;
    }
    /* Mobile: arrows on peek area, slightly inset from edge */
    .psp-nav-prev,
    .psp-nav-next {
        width: 28px;
        height: 28px;
        top: 50%;
    }
    .psp-nav-prev {
        left: 10px;
    }
    .psp-nav-next {
        right: 10px;
    }
}

/* Mobile hidden (controlled by JS) */
.psp-popup-wrap.psp-hide-mobile {
    display: none !important;
}

/* ===== 동영상 슬라이드 공통 ===== */
.psp-slide-media {
    background: #000;
}

/* mp4 video 요소 */
.psp-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    display: block;
}

/* YouTube iframe */
.psp-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    z-index: 1; /* isolation 컨텍스트 내에서 포스터(100) 보다 낮게 */
}

/* YouTube Shorts 전용 커버 래퍼:
   CSS만으로는 padding-bottom 부모에서 자식 높이 상속이 불가능.
   left/top/width/height 는 JS(setupShortsScalers)가 px 단위로 명시 설정. */
.psp-shorts-scaler {
    position: absolute;
    overflow: hidden;
    z-index: 1; /* 포스터(100) 보다 낮게 */
}
/* scale(1.15) → 유튜브 플레이어 UI(하단 구독/제목 오버레이) 크롭
   width/height 는 JS가 px 단위로 명시 설정. */
.psp-shorts-scaler .psp-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    border: none;
    display: block;
    transform-origin: 50% 50%;
    transform: scale(1.15);
    z-index: auto;
}

/* 포스터 오버레이 (YouTube 로딩 대기) */
.psp-video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    transform: translateZ(0); /* iframe GPU 레이어 위로 강제 승격 */
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.psp-video-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.psp-video-poster.psp-poster-fade {
    opacity: 0;
}
