/* --- Lightbox Window Styles --- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

/* Close Button Position */
.lightbox-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10003;
    line-height: 1;
}

.lightbox-close-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(200, 162, 74, 0.3);
    color: #fff;
    font-size: 2.5rem;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    z-index: 10002;
    user-select: none;
}

.lightbox-nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #0f0f0f;
    box-shadow: 0 0 15px rgba(200, 162, 74, 0.4);
}

.prev-btn {
    left: 40px;
}

.next-btn {
    right: 40px;
}

.lightbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 1200px;
    z-index: 10000;
    perspective: 1500px;
    perspective-origin: center;
}

/* Brand Gold Border on Content */
.lightbox-content {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    border: 3px solid var(--primary-color); /* Brand gold */
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: block !important;
    object-fit: contain !important;
    opacity: 0;
    transform: scale(0.95) rotateY(0deg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
}

/* Gentle reveal animation when loaded */
.lightbox.active .lightbox-content.loaded {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
}

/* Flip Page-Turn States */
.lightbox-content.flip-left {
    transform: scale(0.9) rotateY(-90deg);
    opacity: 0;
}

.lightbox-content.flip-right {
    transform: scale(0.9) rotateY(90deg);
    opacity: 0;
}

#lightbox-caption {
    margin-top: 20px;
    font-family: var(--font-body);
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        padding: 5px;
    }
    .prev-btn {
        left: 15px;
    }
    .next-btn {
        right: 15px;
    }
    .lightbox-close-btn {
        top: 20px;
        right: 25px;
        font-size: 2.5rem;
    }
    #lightbox-caption {
        font-size: 0.95rem;
    }
}
