.cg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
}

.cg-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
}

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

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

.cg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.3s ease;
}

.cg-overlay-text {
    font-weight: bold;
    font-size: 24px;
    line-height: 1.2;
}

.cg-overlay-text span {
    font-size: 14px;
    font-weight: normal;
}

.cg-empty-notice {
    padding: 20px;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    text-align: center;
    color: #666;
}

/* responsive grid default */
@media (max-width: 767px) {
    .cg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* LIGHTBOX OVERLAY */
.cg-lightbox-overlay_95b0af40 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
}

body.admin-bar .cg-lightbox-overlay_95b0af40 {
    top: var(--wp-admin--admin-bar--height, 32px);
}
@media screen and (max-width: 782px) {
    body.admin-bar .cg-lightbox-overlay_95b0af40 {
        top: 46px;
    }
}

.cg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.cg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    animation: cgFadeIn_95b0af40 0.25s ease-out;
}

.cg-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

.cg-lightbox-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.cg-lightbox-prev {
    left: -70px;
}

.cg-lightbox-next {
    right: -70px;
}

@media (max-width: 767px) {
    .cg-lightbox-prev {
        left: 10px;
    }
    .cg-lightbox-next {
        right: 10px;
    }
}

.cg-lightbox-counter {
    color: #aaa;
    margin-top: 15px;
    font-size: 14px;
}

@keyframes cgFadeIn_95b0af40 {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
