/* ===================================================================
   BTK Reference Lightbox — index.html 갤러리와 동일한 GLightbox 스타일
   =================================================================== */

.glightbox-container .gcontainer {
    height: 100vh !important;
    height: 100dvh !important;
}

.glightbox-container .gslide {
    height: 100vh !important;
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.glightbox-container .gslide-inner-content {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 100vw !important;
}

.glightbox-container .gslide-media {
    width: 100% !important;
    max-width: 100vw !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
}

.glightbox-container .gslide-image {
    align-items: center !important;
    justify-content: center !important;
}

.glightbox-container .gslide-image img {
    max-width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
}

.glightbox-container .gslide-description {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 8px 14px !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
    flex: 0 0 auto !important;
}

.glightbox-container .gslide-title {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    margin: 0 !important;
}

.glightbox-container .gslide-desc {
    display: none !important;
}

/* 닫기(X) 버튼 → btk-media-viewer-close.css (Android gallery-mobile 기준) */

/* ── 갤러리(portfolio-info a)와 동일한 원형 확대 버튼 ──
   오버레이 flex 행 안 좌측 배치 (설명 텍스트와 gap으로 분리) */
.style-ref-card .btk-ref-card-zoom,
.motion-video-card .btk-ref-card-zoom {
    position: static;
    flex-shrink: 0;
    order: -1;
    z-index: 5;
    box-sizing: border-box;
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    margin: 0;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.3s ease, transform 0.15s ease;
}

.style-ref-card .btk-ref-card-zoom::after,
.motion-video-card .btk-ref-card-zoom::after {
    display: none !important;
    content: none !important;
}

.style-ref-card .btk-ref-card-zoom i,
.motion-video-card .btk-ref-card-zoom i {
    font-size: 0.75rem;
    line-height: 1;
    pointer-events: none;
}

.style-ref-card .btk-ref-card-zoom:hover,
.style-ref-card .btk-ref-card-zoom:focus-visible,
.motion-video-card .btk-ref-card-zoom:hover,
.motion-video-card .btk-ref-card-zoom:focus-visible {
    background: #5e42a6 !important;
    color: #fff !important;
    outline: none;
    transform: none;
}

.style-ref-card .btk-ref-card-zoom:active,
.motion-video-card .btk-ref-card-zoom:active {
    transform: scale(0.94);
}

.style-ref-card.selected .btk-ref-card-zoom,
.motion-video-card.selected .btk-ref-card-zoom {
    display: inline-flex;
}

/* 비디오 확대 모달 — 닫기(X)는 btk-media-viewer-close (뷰포트 우상단) */
#btk-ref-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#btk-ref-image-fallback-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#btk-ref-image-fallback-modal img {
    display: block;
    max-width: 95vw;
    max-height: 90dvh;
    object-fit: contain;
    border-radius: 8px;
}

#btk-ref-video-modal .btk-ref-video-box {
    position: relative;
    width: min(95vw, calc(90dvh * 3 / 4));
    height: min(90dvh, calc(95vw * 4 / 3));
    max-width: 95vw;
    max-height: 90dvh;
    aspect-ratio: 3 / 4;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

#btk-ref-video-modal video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#btk-ref-video-modal .btk-ref-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    text-align: center;
    pointer-events: none;
}

@media (max-width: 480px) {
    .style-ref-card .btk-ref-card-zoom,
    .motion-video-card .btk-ref-card-zoom {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }
}
