/* Dynamic Gallery Grid */
.dgg-wrapper { width: 100%; }

.dgg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    width: 100%;
    height: 520px;
    overflow: hidden;
}

.dgg-cell {
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
    background: #f3f3f3;
    cursor: pointer;
    border-radius: inherit;
}

.dgg-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.dgg-cell:hover img { transform: scale(1.04); }

.dgg-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.45);
    pointer-events: none;
}

.dgg-show-btn {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff;
    color: #111;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    pointer-events: none;
}

.dgg-empty {
    padding: 24px; text-align: center;
    background: #fafafa; border: 1px dashed #ddd; border-radius: 8px;
    color: #666;
}

@media (max-width: 600px) {
    .dgg-grid { height: 360px; }
    .dgg-show-btn { font-size: 12px; padding: 8px 14px; }
}

/* ---------- Lightbox ---------- */
.dgg-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.dgg-lightbox.is-open { opacity: 1; visibility: visible; }

.dgg-lb-close, .dgg-lb-nav {
    position: absolute;
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .2s ease;
    z-index: 2;
}
.dgg-lb-close:hover, .dgg-lb-nav:hover { background: rgba(255,255,255,.2); }

.dgg-lb-close { top: 20px; right: 20px; }
.dgg-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.dgg-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

.dgg-lb-stage {
    max-width: 92vw;
    max-height: 82vh;
    display: flex; align-items: center; justify-content: center;
}

.dgg-lb-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.dgg-lb-counter {
    position: absolute;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0,0,0,.5);
    padding: 6px 14px;
    border-radius: 999px;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
}

.dgg-lb-caption {
    position: absolute;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    color: #eaeaea;
    font-size: 13px;
    max-width: 80vw;
    text-align: center;
}

@media (max-width: 600px) {
    .dgg-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .dgg-lb-prev { left: 8px; width: 40px; height: 40px; }
    .dgg-lb-next { right: 8px; width: 40px; height: 40px; }
}

body.dgg-no-scroll { overflow: hidden; }
