/* Premium Global Lightbox Styles */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.4s;
}

.lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.lightbox-figure {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 92vh;
    z-index: 2;
}

.lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    will-change: transform;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    transform-origin: center center;
}

/* Glassmorphism Header */
.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(13, 27, 42, 0.4), transparent);
    z-index: 10;
}

.lightbox-caption {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.lightbox-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lightbox-close, .lightbox-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-close:hover, .lightbox-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Navigation */
.lightbox-nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    z-index: 5;
}

.lightbox-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 2rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-btn:hover:not(:disabled) {
    background: rgba(28, 78, 128, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(28, 78, 128, 0.4);
}

.lightbox-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

.lightbox-count {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lightbox-header { padding: 1rem; flex-direction: column-reverse; gap: 1rem; align-items: flex-end; }
    .lightbox-caption { font-size: 0.85rem; padding: 0.4rem 1.2rem; align-self: flex-start; }
    .lightbox-btn { width: 44px; height: 44px; font-size: 1.5rem; background: rgba(0,0,0,0.5); }
    .lightbox-nav { padding: 0 0.5rem; }
    .lightbox-controls { gap: 0.6rem; }
    .lightbox-figure {
        width: 100vw;
        max-width: 100vw;
    }
    .lightbox-image {
        width: 100vw;
        max-width: 100vw;
        max-height: 80vh;
        border-radius: 0;
    }
}

@keyframes pd-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
