/* -----------------------------------------
   GALLERY CARD (Small Preview in Grid)
------------------------------------------ */

.image-gallery-card {
    display: flex;
    gap: 6px;
}

.img-wrapper {
    position: relative;
    width: 75px;
    height: 75px;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .img-wrapper:hover {
        /*transform: translateY(-4px);*/
        transform: scale(1.35);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

/* +X Overlay */
.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6) );
    color: black;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(1px);
}

/* -----------------------------------------
   MODAL GALLERY
------------------------------------------ */

.gallery-modal .modal-content {
    background: #f9fafb;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.gallery-item {
    animation: fadeIn 0.25s ease;
}

.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .gallery-image-wrapper img {
        width: 100%;
        /*height: 220px;*/
        object-fit: cover;
        transition: transform 0.4s ease;
    }

    /* Hover Effects */
    .gallery-image-wrapper:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    }

        .gallery-image-wrapper:hover img {
            transform: scale(1.08);
        }

/* Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient( to top, rgba(0,0,0,0.75), rgba(0,0,0,0) );
    color: #fff;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-image-wrapper:hover .gallery-overlay {
    opacity: 1;
}

.gallery-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty State */
.gallery-grid .text-muted {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
}

/* Fade animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
