@charset "UTF-8";

/* ==========================================================================
    [PK自訂樣式]
   PK-Lightbox.css - Native Lightbox Component (Replaces Venobox)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Lightbox Overlay
   -------------------------------------------------------------------------- */
.pk-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pk-lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   2. Lightbox Container
   -------------------------------------------------------------------------- */
.pk-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   3. Lightbox Image
   -------------------------------------------------------------------------- */
.pk-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border: 10px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   3.1 Lightbox Iframe
   -------------------------------------------------------------------------- */
.pk-lightbox-iframe {
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    max-height: 600px;
    background: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   4. Lightbox Title
   -------------------------------------------------------------------------- */
.pk-lightbox-title {
    color: #fff;
    font-size: 16px;
    margin-top: 15px;
    text-align: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   5. Close Button
   -------------------------------------------------------------------------- */
.pk-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.pk-lightbox-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

.pk-lightbox-close::before,
.pk-lightbox-close::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #333;
}

.pk-lightbox-close::before {
    transform: rotate(45deg);
}

.pk-lightbox-close::after {
    transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. Navigation Buttons
   -------------------------------------------------------------------------- */
.pk-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.pk-lightbox-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.pk-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pk-lightbox-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
}

.pk-lightbox-prev {
    left: 20px;
}

.pk-lightbox-next {
    right: 20px;
}

/* Arrow Icons (SVG) */
.pk-lightbox-prev::after,
.pk-lightbox-next::after {
    content: "";
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.pk-lightbox-prev::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
}

.pk-lightbox-next::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   7. Counter (1/5)
   -------------------------------------------------------------------------- */
.pk-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
}

/* --------------------------------------------------------------------------
   8. Loading Spinner
   -------------------------------------------------------------------------- */
.pk-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --------------------------------------------------------------------------
   9. Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .pk-lightbox-container {
        max-width: 95%;
        max-height: 95%;
    }
    
    .pk-lightbox-image {
        max-height: 70vh;
        border-width: 5px;
    }
    
    .pk-lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    
    .pk-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .pk-lightbox-prev {
        left: 10px;
    }
    
    .pk-lightbox-next {
        right: 10px;
    }
    
    .pk-lightbox-counter {
        top: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .pk-lightbox-title {
        font-size: 14px;
        margin-top: 10px;
        padding: 8px 15px;
    }
}

/* --------------------------------------------------------------------------
   10. Accessibility
   -------------------------------------------------------------------------- */
.pk-lightbox-overlay:focus-within .pk-lightbox-close:focus,
.pk-lightbox-overlay:focus-within .pk-lightbox-nav:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   11. Prevent Body Scroll when Lightbox is Open
   -------------------------------------------------------------------------- */
body.pk-lightbox-open {
    overflow: hidden;
}
