/* Pods Divi Gallery — gallery.css */

/* ── Grid wrapper ────────────────────────────────────────────────────────── */
.pdg-gallery {
    display: grid;
    grid-template-columns: repeat(var(--pdg-cols, 3), 1fr);
    gap: var(--pdg-gap, 12px);
}

/* ── Individual item ─────────────────────────────────────────────────────── */
.pdg-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--pdg-radius, 8px);
    background: #e5e7eb;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pdg-item:focus-visible {
    outline: 3px solid var(--pdg-accent, #2563eb);
    outline-offset: 2px;
}

/* ── Image ───────────────────────────────────────────────────────────────── */
.pdg-img {
    display: block;
    width: 100%;
    aspect-ratio: var(--pdg-ar, 1/1);
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.3s ease;
    will-change: transform;
}

/* ── Hover effects ───────────────────────────────────────────────────────── */
.pdg-hover-zoom  .pdg-item:hover .pdg-img { transform: scale(1.07); }
.pdg-hover-fade  .pdg-item:hover .pdg-img { opacity: 0.7; }
.pdg-hover-slide .pdg-item:hover .pdg-img { transform: translateY(-6px); }

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.pdg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.50) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pdg-item:hover .pdg-overlay,
.pdg-item:focus-visible .pdg-overlay {
    opacity: 1;
}

/* ── Zoom icon (lightbox trigger indicator) ──────────────────────────────── */
.pdg-zoom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--pdg-accent, #2563eb);
    color: #fff;
    transform: scale(0.75);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity   0.25s ease;
    flex-shrink: 0;
}

.pdg-item:hover .pdg-zoom-icon,
.pdg-item:focus-visible .pdg-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Caption ─────────────────────────────────────────────────────────────── */
.pdg-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Lightbox backdrop & layout ──────────────────────────────────────────── */
.pdg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000000;
    align-items: center;
    justify-content: center;
}

.pdg-lightbox.pdg-lb-active {
    display: flex;
}

.pdg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.pdg-lb-stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
}

.pdg-lb-img {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    animation: pdg-lb-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes pdg-lb-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Lightbox buttons ────────────────────────────────────────────────────── */
.pdg-lb-btn {
    position: fixed;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1;
}

.pdg-lb-btn:hover {
    background: var(--pdg-accent, #2563eb);
    transform: scale(1.08);
}

.pdg-lb-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.pdg-lb-close {
    top: 16px;
    right: 16px;
}

.pdg-lb-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.pdg-lb-prev:hover {
    transform: translateY(-50%) scale(1.08);
}

.pdg-lb-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.pdg-lb-next:hover {
    transform: translateY(-50%) scale(1.08);
}

/* ── Counter ─────────────────────────────────────────────────────────────── */
.pdg-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    letter-spacing: 0.06em;
    z-index: 2;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .pdg-gallery {
        grid-template-columns: repeat(min(var(--pdg-cols, 3), 2), 1fr);
    }
}

@media (max-width: 480px) {
    .pdg-gallery {
        grid-template-columns: repeat(min(var(--pdg-cols, 3), 1), 1fr);
    }
    .pdg-lb-prev { left: 6px; }
    .pdg-lb-next { right: 6px; }
}
