/* ==========================================================================
   EPP Gallery Pro
   ========================================================================== */

.epp-gallery-wrap {
    width: 100%;
}

/* ── Filter Tabs ────────────────────────────────────────────────────────── */

.epp-gallery-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.epp-gallery-filter-btn {
    padding: 7px 18px;
    border: 1.5px solid var(--epp-card-border,#e5e7eb);
    border-radius: var(--epp-radius-full,999px);
    background: var(--epp-white,#fff);
    font-size: var(--epp-text-sm,13px);
    font-weight: var(--epp-font-medium,500);
    color: var(--epp-gray-700,#374151);
    cursor: pointer;
    transition: background var(--epp-transition,.22s ease), color var(--epp-transition,.22s ease), border-color var(--epp-transition,.22s ease), box-shadow var(--epp-transition,.22s ease);
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: var(--epp-shadow-xs,0 1px 2px rgba(0,0,0,.06));
}

.epp-gallery-filter-btn:hover {
    border-color: var(--epp-primary,#7c3aed);
    color: var(--epp-primary,#7c3aed);
    box-shadow: var(--epp-shadow-sm,0 2px 6px rgba(0,0,0,.06));
}

.epp-gallery-filter-btn:focus-visible {
    outline: none;
    box-shadow: var(--epp-focus-ring,0 0 0 3px rgba(124,58,237,.25));
}

.epp-gallery-filter-btn.active {
    background: var(--epp-primary,#7c3aed);
    border-color: var(--epp-primary,#7c3aed);
    color: #fff !important;
    box-shadow: var(--epp-shadow-colored,0 4px 12px rgba(124,58,237,.25));
}
.epp-gallery-filter-btn.active:hover {
    color: #fff !important;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */

.epp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--epp-gallery-cols, 3), 1fr);
    gap: 12px;
}

/* Masonry via CSS columns */
.epp-gallery-layout--masonry {
    display: block;
    column-count: var(--epp-gallery-cols, 3);
    column-gap: 12px;
}

.epp-gallery-layout--masonry .epp-gallery-item {
    break-inside: avoid;
    margin-bottom: 12px;
}

/* ── Item ───────────────────────────────────────────────────────────────── */

.epp-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--epp-radius,8px);
    cursor: pointer;
    background: var(--epp-gray-100,#f3f4f6);
    box-shadow: var(--epp-shadow-xs,0 1px 2px rgba(0,0,0,.06));
    transition: box-shadow var(--epp-transition,.22s ease);
}

.epp-gallery-item:hover {
    box-shadow: var(--epp-shadow-md,0 8px 24px rgba(0,0,0,.10));
}

.epp-gallery-item[role="button"]:focus-visible {
    outline: none;
    box-shadow: var(--epp-focus-ring,0 0 0 3px rgba(124,58,237,.25));
}

.epp-gallery-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.epp-gallery-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.4,0,.2,1), filter .45s;
}

/* Grid mode: force equal height */
.epp-gallery-layout--grid .epp-gallery-img {
    height: 100%;
}

/* ── Hover Effects ──────────────────────────────────────────────────────── */

.epp-gallery-hover--zoom:hover .epp-gallery-img {
    transform: scale(1.08);
}

.epp-gallery-hover--fade:hover .epp-gallery-img {
    opacity: .7;
}

.epp-gallery-hover--blur:hover .epp-gallery-img {
    filter: blur(3px);
}

/* ── Overlay ────────────────────────────────────────────────────────────── */

.epp-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0,0,0,.5);
    opacity: 0;
    transition: opacity var(--epp-transition,.22s ease);
    pointer-events: none;
    line-height: 1.4;
}

/* Gradient overlay via custom props */
.epp-gallery-overlay--gradient {
    background: linear-gradient(to bottom, var(--epp-gallery-grad-from, rgba(0,0,0,0)), var(--epp-gallery-grad-to, rgba(0,0,0,.7))) !important;
}

.epp-gallery-cap-anim--fade-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .35s, transform .35s;
}

.epp-gallery-cap-anim--fade-down {
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .35s, transform .35s;
}

.epp-gallery-cap-anim--fade {
    opacity: 0;
    transition: opacity .35s;
}

.epp-gallery-cap-anim--zoom {
    opacity: 0;
    transform: scale(0.7);
    transition: opacity .35s, transform .35s;
}

.epp-gallery-item:hover .epp-gallery-cap-anim--fade-up,
.epp-gallery-item:hover .epp-gallery-cap-anim--fade-down,
.epp-gallery-item:hover .epp-gallery-cap-anim--fade,
.epp-gallery-item:hover .epp-gallery-cap-anim--zoom {
    opacity: 1;
    transform: none;
}

.epp-gallery-item:hover .epp-gallery-overlay,
.epp-gallery-item:focus-within .epp-gallery-overlay {
    opacity: 1;
}

.epp-gallery-caption {
    font-size: var(--epp-text-sm,13px);
    font-weight: var(--epp-font-medium,500);
    color: #fff;
    text-align: center;
    padding: 0 12px;
    transition: opacity .35s, transform .35s;
}

.epp-gallery-zoom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    transition: background .2s;
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.epp-gallery-item:hover .epp-gallery-zoom-icon {
    background: rgba(255,255,255,.3);
}

/* ── Video Play Button ──────────────────────────────────────────────────── */

.epp-gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.55);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    transition: background .25s, transform .25s;
}

.epp-gallery-item:hover .epp-gallery-play {
    background: rgba(var(--epp-primary-rgb,124,58,237),.85);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ── Filter Animation ───────────────────────────────────────────────────── */

.epp-gallery-item.epp-gallery-filtered-out {
    opacity: 0;
    transform: scale(.85);
    position: absolute !important;
    pointer-events: none;
    height: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Load More Hidden ───────────────────────────────────────────────────── */

.epp-gallery-hidden {
    display: none !important;
}

/* ── Load More Button ───────────────────────────────────────────────────── */

.epp-gallery-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.epp-gallery-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--epp-primary,#7c3aed);
    color: #fff;
    border: none;
    border-radius: var(--epp-radius,8px);
    font-size: var(--epp-text-sm,13px);
    font-weight: var(--epp-font-semibold,600);
    cursor: pointer;
    transition: background var(--epp-transition,.22s ease), box-shadow var(--epp-transition,.22s ease), transform var(--epp-transition,.22s ease);
    box-shadow: var(--epp-shadow-colored,0 4px 12px rgba(124,58,237,.25));
    letter-spacing:.01em;
}

.epp-gallery-loadmore:hover {
    background: var(--epp-primary-dark,#6d28d9);
    box-shadow: 0 8px 20px rgba(var(--epp-primary-rgb,124,58,237),.35);
    transform: translateY(-1px);
}

.epp-gallery-loadmore:focus-visible {
    outline: none;
    box-shadow: var(--epp-focus-ring,0 0 0 3px rgba(124,58,237,.25));
}

.epp-gallery-loadmore:disabled {
    opacity: .5;
    cursor: default;
    transform: none;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */

.epp-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.9);
    opacity: 0;
    transition: opacity .3s;
    cursor: zoom-out;
}

.epp-lightbox-overlay.active {
    opacity: 1;
}

.epp-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    cursor: default;
}

.epp-lightbox-content img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--epp-radius-sm,6px);
}

.epp-lightbox-content iframe {
    width: 80vw;
    max-width: 900px;
    height: 50.625vw;
    max-height: 506px;
    border: none;
    border-radius: var(--epp-radius-sm,6px);
}

.epp-lightbox-caption {
    position: absolute;
    bottom: -32px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--epp-gray-300,#d1d5db);
    font-size: var(--epp-text-sm,13px);
}

.epp-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100000;
    transition: background var(--epp-transition,.22s ease);
    color: #fff;
}
.epp-lightbox-close:hover {
    background: rgba(255,255,255,.25);
}
.epp-lightbox-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,.4);
}

.epp-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100000;
    transition: background var(--epp-transition,.22s ease), transform var(--epp-transition,.22s ease);
    color: #fff;
}
.epp-lightbox-nav:hover {
    background: rgba(255,255,255,.25);
    transform: translateY(-50%) scale(1.08);
}
.epp-lightbox-nav:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,.4);
}

.epp-lightbox-prev { left: 16px; }
.epp-lightbox-next { right: 16px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .epp-gallery-grid {
        --epp-gallery-cols: 2;
    }
    .epp-gallery-layout--masonry {
        column-count: 2;
    }
}

@media (max-width: 767px) {
    .epp-gallery-grid {
        --epp-gallery-cols: 1;
    }
    .epp-gallery-layout--masonry {
        column-count: 1;
    }
    .epp-lightbox-content iframe {
        width: 94vw;
        height: 52.875vw;
    }
}
