/* ============================================
   Image Gallery Component
   Mobile-first, responsive grid + lightbox
   ============================================ */

/* --- Grid Layout --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-grid-item:active img {
    transform: scale(1.05);
}

.gallery-grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.gallery-grid-item:hover .gallery-grid-overlay,
.gallery-grid-item:active .gallery-grid-overlay {
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
}

/* --- Navigation Buttons --- */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* --- Modal --- */
.gallery-modal .modal-body {
    min-height: 200px;
    background: #000;
}

/* --- Responsive --- */
@media (max-width: 400px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-nav {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
