/* Gallery: image fills the card; title overlays the image. */

.mix-card {
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 4px solid var(--black);
    box-shadow: 10px 10px 0px var(--black);
    height: 320px;
    background: var(--black);
}

.mix-card a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.mix-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.overlay-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 10px 12px;
    background: rgba(0,0,0,0.75);
    color: var(--citrus);
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    text-align: center;
}

/* ── Lightbox ─────────────────────────────────────────────── */

#lightbox {
    background: transparent;
    border: none;
    padding: 0;
    margin: auto;
    max-width: 94vw;
    max-height: 94vh;
    overflow: visible;
    
    /* Animation transitions for dialog opening */
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                display 0.2s allow-discrete, 
                overlay 0.2s allow-discrete;
}

#lightbox[open] {
    opacity: 1;
    transform: scale(1);
}

@starting-style {
    #lightbox[open] {
        opacity: 0;
        transform: scale(0.96);
    }
}

#lightbox::backdrop {
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease, display 0.2s allow-discrete, overlay 0.2s allow-discrete;
}

#lightbox[open]::backdrop {
    background: rgba(0, 0, 0, 0.92);
}

@starting-style {
    #lightbox[open]::backdrop {
        background: rgba(0, 0, 0, 0);
    }
}

.lb-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lb-img {
    display: block;
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid var(--citrus);
    box-shadow: 10px 10px 0 var(--black);
    
    /* Crossfade/fade transitions when active image changes */
    opacity: 0;
    transition: opacity 0.18s ease-in-out;
}

.lb-img.lb-fade-in {
    opacity: 1;
}

.lb-title {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--black);
    color: var(--citrus);
    font-family: 'Space Mono', monospace;
    font-weight: 900;
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    text-transform: uppercase;
    text-align: center;
    max-width: 88vw;
    word-break: break-word;
}

/* Shared button reset */
.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    z-index: 1;
    border: 3px solid var(--citrus);
    background: var(--black);
    color: var(--citrus);
    font-family: 'Space Mono', monospace;
    font-weight: 900;
    font-size: 1.6rem;
    line-height: 1;
    cursor: crosshair;
    padding: 6px 14px;
    transition: all 0.1s steps(2);
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
    background: var(--citrus);
    color: var(--black);
    box-shadow: 4px 4px 0 var(--orange);
}

.lb-close {
    top: -18px;
    right: -18px;
    font-size: 2rem;
    padding: 2px 10px;
}

.lb-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lb-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

/* Stack buttons below image on narrow screens */
@media (max-width: 768px) {
    .lb-prev,
    .lb-next {
        top: auto;
        bottom: -52px;
        transform: none;
    }

    .lb-prev { left: 0; }
    .lb-next { right: 0; }

    .lb-close {
        top: -14px;
        right: -6px;
    }

    .lb-img {
        max-width: 92vw;
        max-height: 70vh;
    }
}
