/* Premium Art Lightbox CSS - Ultra Exquisite Version */
@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@300;400;500;700&display=swap');

:root {
    --pal-bg-color: rgba(5, 5, 5, 0.7); 
    --pal-text-color: #ffffff;
    --pal-text-muted: #b0b0b5;
    --pal-accent: #5E5CE6; /* Requested Purple Accent */
    --pal-transition-speed: 0.6s;
    --pal-transition-easing: cubic-bezier(0.16, 1, 0.3, 1); /* Smoother iOS-like spring */
}

/* Base Lightbox Container */
#premium-art-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available; /* Safari 100vh fix */
    height: 100dvh; /* Modern Safari 100vh fix */
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--pal-transition-speed) ease, visibility var(--pal-transition-speed) ease;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft JhengHei", sans-serif;
}

#premium-art-lightbox:not(.pal-hidden) {
    opacity: 1;
    visibility: visible;
}

/* Backdrop with Glassmorphism & Vignette */
.pal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15,15,15,0.4) 0%, rgba(5,5,5,0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
}

/* Content Wrapper */
.pal-content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Image Container */
.pal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.pal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08); /* Subtle border and deep shadow */
    opacity: 0;
    transform: scale(0.9) translateY(20px); /* Slightly start from below */
    transition: opacity var(--pal-transition-speed) var(--pal-transition-easing), 
                transform var(--pal-transition-speed) var(--pal-transition-easing);
    user-select: none;
    -webkit-user-drag: none;
    image-rendering: high-quality; /* Ensure crisp rendering */
}

.pal-image.pal-loaded {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Loader */
.pal-loader {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--pal-accent);
    animation: pal-spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    display: none;
}

.pal-loading .pal-loader {
    display: block;
}

@keyframes pal-spin {
    to { transform: rotate(360deg); }
}

/* Controls (Close & Nav) */
#premium-art-lightbox .pal-close, 
#premium-art-lightbox .pal-nav {
    position: absolute;
    background: rgba(25, 25, 25, 0.3) !important; /* Subtle circular background */
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50% !important;
    color: #ffffff !important;
    cursor: pointer;
    width: 54px;
    height: 54px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 10;
    outline: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none !important; /* Reset Elementor shadows */
    padding: 0 !important; /* Reset Elementor padding */
}

#premium-art-lightbox .pal-close svg, 
#premium-art-lightbox .pal-nav svg {
    stroke-width: 1.5; /* Thinner, more elegant lines */
    stroke: currentColor;
}

/* Force Reset Elementor's annoying :focus global styles */
#premium-art-lightbox .pal-close:focus, 
#premium-art-lightbox .pal-nav:focus {
    background: rgba(25, 25, 25, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Active (Press) state - applies everywhere */
#premium-art-lightbox .pal-close:active, 
#premium-art-lightbox .pal-nav:active,
#premium-art-lightbox .pal-close:focus:active, 
#premium-art-lightbox .pal-nav:focus:active {
    transform: scale(0.95) !important;
    background: #4A48B8 !important; /* Slightly darker purple for press effect */
    border-color: #4A48B8 !important;
    box-shadow: 0 10px 20px rgba(94, 92, 230, 0.3) !important;
    color: #ffffff !important;
}

/* Hover state - only on devices with a real mouse, avoids sticky hover on touch */
@media (hover: hover) and (pointer: fine) {
    #premium-art-lightbox .pal-close:hover, 
    #premium-art-lightbox .pal-nav:hover,
    #premium-art-lightbox .pal-close:focus:hover, 
    #premium-art-lightbox .pal-nav:focus:hover {
        background: var(--pal-accent) !important;
        border-color: var(--pal-accent) !important;
        transform: scale(1.05) !important;
        box-shadow: 0 10px 20px rgba(94, 92, 230, 0.3) !important;
        color: #ffffff !important;
    }
}

.pal-close {
    top: 30px;
    right: 30px;
}

.pal-nav {
    top: 50%;
    transform: translateY(-50%);
}

.pal-nav:hover {
    transform: translateY(-50%) scale(1.05);
}

.pal-prev {
    left: 40px;
}

.pal-next {
    right: 40px;
}

/* Hide controls when idle, but NEVER hide the info text, and only apply idle hiding on desktop devices */
@media (hover: hover) and (pointer: fine) {
    .pal-idle .pal-close, .pal-idle .pal-nav {
        opacity: 0;
        pointer-events: none;
    }
}

/* Information Box */
.pal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 60px 40px 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    color: var(--pal-text-color);
    text-align: center;
    transition: opacity 0.5s ease;
    pointer-events: none; /* Let clicks pass through to backdrop */
}

.pal-title {
    font-family: "Zen Kaku Gothic New", "Helvetica Neue", Helvetica, Arial, sans-serif; /* Requested Font */
    font-size: 1.6rem;
    font-weight: 400;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.pal-alt {
    font-size: 0.9rem;
    color: var(--pal-text-muted);
    margin: 0;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.5px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 5px rgba(0,0,0,0.8);
}

/* Animation classes for sliding */
.pal-slide-left-out {
    transform: translateX(-80px) scale(0.9) !important;
    opacity: 0 !important;
}

.pal-slide-right-out {
    transform: translateX(80px) scale(0.9) !important;
    opacity: 0 !important;
}

.pal-slide-left-in {
    animation: pal-slide-in-left var(--pal-transition-speed) var(--pal-transition-easing) forwards;
}

.pal-slide-right-in {
    animation: pal-slide-in-right var(--pal-transition-speed) var(--pal-transition-easing) forwards;
}

@keyframes pal-slide-in-left {
    from { transform: translateX(80px) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes pal-slide-in-right {
    from { transform: translateX(-80px) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pal-nav {
        display: none; 
    }
    
    .pal-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }
    
    .pal-image-container {
        max-width: 95vw;
        max-height: 75vh;
        margin-bottom: 80px;
    }
    
    .pal-info {
        padding: 40px 20px 25px;
    }
    
    .pal-title {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .pal-alt {
        font-size: 0.85rem;
    }
}

/* Zoom & Pan Support */
.pal-image {
    cursor: zoom-in;
}
#premium-art-lightbox.pal-zoomed .pal-info,
#premium-art-lightbox.pal-zoomed .pal-close,
#premium-art-lightbox.pal-zoomed .pal-nav {
    opacity: 0 !important;
    pointer-events: none;
}
#premium-art-lightbox.pal-zoomed .pal-image {
    cursor: grab;
    transition: transform 0.1s ease-out, opacity var(--pal-transition-speed) var(--pal-transition-easing);
}
#premium-art-lightbox.pal-zoomed .pal-image:active, .pal-dragging .pal-image {
    cursor: grabbing;
}
