/* Images for Blog - Lightbox Styles */

/* 라이트박스 오버레이 */
.images-for-blog-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(5px);
}

.images-for-blog-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* 바디 스크롤 방지 */
body.lightbox-open {
    overflow: hidden !important;
    height: 100vh;
}

/* 라이트박스 콘텐츠 컨테이너 */
.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxFadeIn 0.4s ease-out;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 라이트박스 이미지 */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    cursor: pointer; /* 클릭 가능 표시 */
}

/* 핀치 투 줌 지원을 위한 터치 액션 */
.lightbox-image {
    touch-action: pinch-zoom;
}

/* 이미지 로딩 상태 */
.lightbox-image:not([src]),
.lightbox-image[src=""] {
    background: #333;
    min-width: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image:not([src])::after,
.lightbox-image[src=""]::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: lightboxSpin 1s infinite linear;
}

@keyframes lightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 닫기 버튼 */
.lightbox-close {
    position: absolute;
    top: -60px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 300;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

.lightbox-close:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* 이미지 카운터 */
.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 98%;
        max-height: 98%;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .lightbox-counter {
        bottom: 20px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .lightbox-close::before {
        content: '×';
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .images-for-blog-lightbox {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .images-for-blog-lightbox,
    .lightbox-content,
    .lightbox-image,
    .lightbox-close {
        transition: none;
        animation: none;
    }
    
    .lightbox-content {
        animation: none;
    }
}

/* 키보드 네비게이션 개선 */
.lightbox-close:focus {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3);
}

/* 터치 기기 최적화 */
@media (hover: none) and (pointer: coarse) {
    /* 터치 타겟 크기 확대 */
    .lightbox-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* 프린트 스타일 */
@media print {
    .images-for-blog-lightbox {
        display: none !important;
    }
}