/* ═══════════════════════════════════════════════
   GALLERY WINDOW & LIGHTBOX
   ═══════════════════════════════════════════════ */
.gallery-body {
    padding: 16px !important;
}

.gallery-grid {
    display: grid;
    /* responsive columns, min 140px width to keep thumbnails small */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    aspect-ratio: 4/3;
}

.gallery-item:hover,
.gallery-item:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    outline: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 20px 12px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Lightbox Modal ─── */
#lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

#lightbox-caption {
    margin-top: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#lightbox-prev {
    left: 20px;
}

#lightbox-next {
    right: 20px;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    font-weight: 300;
}