/* assets/css/gallery.css */
.carousel-wrapper {
    perspective: 1200px;
    display: flex;
    justify-content: center;
    padding: 20px 0 30px;
    width: 100%;
    /* No hidden overflow to allow 3D depth */
}

.carousel-3d {
    position: relative;
    width: 260px;
    height: 340px;
    transform-style: preserve-3d;
    animation: kdcp-spin 24s infinite linear;
}

.carousel-3d .card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backface-visibility: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    transform: rotateY(var(--kd-rot)) translateZ(var(--kd-tz));
}

.carousel-3d .card:hover {
    box-shadow: 0 18px 56px rgba(245, 176, 66, 0.6);
}

.carousel-3d .card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    pointer-events: none;
}

@keyframes kdcp-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.carousel-wrapper:hover .carousel-3d {
    animation-play-state: paused;
}

@media (max-width: 600px) {
    .carousel-3d {
        width: 200px;
        height: 270px;
    }
    .carousel-3d .card {
        transform: rotateY(var(--kd-rot)) translateZ(calc(var(--kd-tz) * 0.75));
    }
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 30px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay .lb-content {
    max-width: 70vw;
    max-height: 80vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9);
    position: relative;
    animation: kdcp-fadeUp 0.35s ease;
}

.lightbox-overlay .lb-content img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0;
}

.lightbox-overlay .lb-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.6rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.25s, transform 0.2s;
    background: none;
    border: none;
    line-height: 1;
}

.lightbox-overlay .lb-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lightbox-overlay .lb-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 18px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}

@keyframes kdcp-fadeUp {
    0% { opacity: 0; transform: scale(0.94) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 480px) {
    .lightbox-overlay .lb-content { max-width: 92vw; }
    .lightbox-overlay .lb-close { font-size: 2rem; top: 14px; right: 20px; }
}
