/* Default grid (desktop: auto-fit images) */
.wcigl-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 15px 0;
}

/* Ensure items shrink properly */
.wcigl-item {
    flex: 1 1 calc(25% - 5px); /* 4 per row on large screens */
    box-sizing: border-box;
    border: 0.5px solid #40579d;
    border-radius: 4px;
}

/* Tablet (2–3 per row) */
@media (max-width: 768px) {
    .wcigl-item {
        flex: 1 1 calc(33.333% - 5px); /* 3 per row on tablets */
    }
}

/* Mobile (2 per row) */
@media (max-width: 480px) {
    .wcigl-item {
        flex: 1 1 calc(50% - 5px); /* 2 per row on phones */
    }
}
.wcigl-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.wcigl-item img:hover {
    transform: scale(1.03);
}

/* Lightbox overlay */
#wcigl-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
}
#wcigl-lightbox img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 8px;
}
/* Close button inside lightbox */
#wcigl-lightbox .wcigl-close {
    position: absolute;
    top: 14%;
    right: 10%;
    font-size: 32px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    z-index: 10000;
}