/* ═══════════════════════════════════════════════════════
   Jeunz Gallery — Advanced Elementor Gallery Widget
   Version 1.0.0
   ═══════════════════════════════════════════════════════ */

/* ─── BASE GRID ────────────────────────────────────── */

.jeunz-gallery-wrapper {
    width: 100%;
}

.jeunz-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

/* ─── GALLERY ITEM ─────────────────────────────────── */

.jeunz-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    aspect-ratio: 1/1;
}

/* Background mode */
.jeunz-gallery-item.jeunz-mode-background {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* IMG tag mode */
.jeunz-gallery-item.jeunz-mode-img_tag {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jeunz-gallery-item.jeunz-mode-img_tag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── LINK RESET ───────────────────────────────────── */

.jeunz-gallery-grid a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ─── HOVER EFFECTS ────────────────────────────────── */

/* Zoom In */
.jeunz-gallery-item.jeunz-hover-zoom.jeunz-mode-background {
    background-size: 100%;
    transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.jeunz-gallery-item.jeunz-hover-zoom.jeunz-mode-background:hover {
    background-size: 115%;
}
.jeunz-gallery-item.jeunz-hover-zoom.jeunz-mode-img_tag img {
    transform: scale(1);
}
.jeunz-gallery-item.jeunz-hover-zoom.jeunz-mode-img_tag:hover img {
    transform: scale(1.12);
}

/* Zoom Out */
.jeunz-gallery-item.jeunz-hover-zoom-out.jeunz-mode-background {
    background-size: 115%;
    transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.jeunz-gallery-item.jeunz-hover-zoom-out.jeunz-mode-background:hover {
    background-size: 100%;
}
.jeunz-gallery-item.jeunz-hover-zoom-out.jeunz-mode-img_tag img {
    transform: scale(1.12);
}
.jeunz-gallery-item.jeunz-hover-zoom-out.jeunz-mode-img_tag:hover img {
    transform: scale(1);
}

/* Slide Up */
.jeunz-gallery-item.jeunz-hover-slide-up.jeunz-mode-background {
    background-position-y: center;
    transition: background-position 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.jeunz-gallery-item.jeunz-hover-slide-up.jeunz-mode-background:hover {
    background-position-y: top;
}
.jeunz-gallery-item.jeunz-hover-slide-up.jeunz-mode-img_tag img {
    transform: translateY(0);
}
.jeunz-gallery-item.jeunz-hover-slide-up.jeunz-mode-img_tag:hover img {
    transform: translateY(-8px) scale(1.03);
}

/* Brightness */
.jeunz-gallery-item.jeunz-hover-brightness {
    filter: brightness(0.85);
}
.jeunz-gallery-item.jeunz-hover-brightness:hover {
    filter: brightness(1.05);
}

/* Blur → Sharp */
.jeunz-gallery-item.jeunz-hover-blur.jeunz-mode-background {
    filter: blur(2px);
}
.jeunz-gallery-item.jeunz-hover-blur.jeunz-mode-background:hover {
    filter: blur(0px);
}
.jeunz-gallery-item.jeunz-hover-blur.jeunz-mode-img_tag img {
    filter: blur(2px);
}
.jeunz-gallery-item.jeunz-hover-blur.jeunz-mode-img_tag:hover img {
    filter: blur(0px);
}

/* Grayscale → Color */
.jeunz-gallery-item.jeunz-hover-grayscale {
    filter: grayscale(100%);
}
.jeunz-gallery-item.jeunz-hover-grayscale:hover {
    filter: grayscale(0%);
}
.jeunz-gallery-item.jeunz-hover-grayscale.jeunz-mode-img_tag img {
    filter: grayscale(100%);
}
.jeunz-gallery-item.jeunz-hover-grayscale.jeunz-mode-img_tag:hover img {
    filter: grayscale(0%);
}

/* Overlay */
.jeunz-gallery-item.jeunz-hover-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(11, 29, 51, 0.4);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}
.jeunz-gallery-item.jeunz-hover-overlay:hover::after {
    opacity: 1;
}

/* None */
.jeunz-gallery-item.jeunz-hover-none:hover {
    /* No effect */
}

/* ─── CAPTIONS ─────────────────────────────────────── */

.jeunz-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
    color: #FFFFFF;
    background: rgba(11, 29, 51, 0.7);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.jeunz-gallery-item:hover .jeunz-gallery-caption {
    opacity: 1;
}

/* Caption positions */
.jeunz-gallery-item.jeunz-caption-top .jeunz-gallery-caption {
    top: 0;
    transform: translateY(-10px);
}
.jeunz-gallery-item.jeunz-caption-top:hover .jeunz-gallery-caption {
    transform: translateY(0);
}

.jeunz-gallery-item.jeunz-caption-center .jeunz-gallery-caption {
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    left: 10%;
    right: 10%;
    border-radius: 8px;
}
.jeunz-gallery-item.jeunz-caption-center:hover .jeunz-gallery-caption {
    transform: translateY(-50%) scale(1);
}

.jeunz-gallery-item.jeunz-caption-bottom .jeunz-gallery-caption {
    bottom: 0;
    transform: translateY(10px);
}
.jeunz-gallery-item.jeunz-caption-bottom:hover .jeunz-gallery-caption {
    transform: translateY(0);
}

/* ─── ACCESSIBILITY ────────────────────────────────── */

.jeunz-gallery-item:focus-visible {
    outline: 3px solid #D4A843;
    outline-offset: 2px;
}

.jeunz-gallery-grid a:focus-visible .jeunz-gallery-item {
    outline: 3px solid #D4A843;
    outline-offset: 2px;
}

/* ─── RESPONSIVE ───────────────────────────────────── */

@media (max-width: 1024px) {
    .jeunz-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .jeunz-gallery-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .jeunz-gallery-caption {
        opacity: 1;
        transform: none !important;
    }
}

/* ─── ANIMATION ON LOAD ───────────────────────────── */

@keyframes jeunzFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jeunz-gallery-item {
    animation: jeunzFadeIn 0.5s ease-out backwards;
}

.jeunz-gallery-item:nth-child(1)  { animation-delay: 0.00s; }
.jeunz-gallery-item:nth-child(2)  { animation-delay: 0.05s; }
.jeunz-gallery-item:nth-child(3)  { animation-delay: 0.10s; }
.jeunz-gallery-item:nth-child(4)  { animation-delay: 0.15s; }
.jeunz-gallery-item:nth-child(5)  { animation-delay: 0.20s; }
.jeunz-gallery-item:nth-child(6)  { animation-delay: 0.25s; }
.jeunz-gallery-item:nth-child(7)  { animation-delay: 0.30s; }
.jeunz-gallery-item:nth-child(8)  { animation-delay: 0.35s; }
.jeunz-gallery-item:nth-child(9)  { animation-delay: 0.40s; }
.jeunz-gallery-item:nth-child(10) { animation-delay: 0.45s; }
.jeunz-gallery-item:nth-child(11) { animation-delay: 0.50s; }
.jeunz-gallery-item:nth-child(12) { animation-delay: 0.55s; }

/* When inside a link */
.jeunz-gallery-grid a:nth-child(1)  .jeunz-gallery-item { animation-delay: 0.00s; }
.jeunz-gallery-grid a:nth-child(2)  .jeunz-gallery-item { animation-delay: 0.05s; }
.jeunz-gallery-grid a:nth-child(3)  .jeunz-gallery-item { animation-delay: 0.10s; }
.jeunz-gallery-grid a:nth-child(4)  .jeunz-gallery-item { animation-delay: 0.15s; }
.jeunz-gallery-grid a:nth-child(5)  .jeunz-gallery-item { animation-delay: 0.20s; }
.jeunz-gallery-grid a:nth-child(6)  .jeunz-gallery-item { animation-delay: 0.25s; }
.jeunz-gallery-grid a:nth-child(7)  .jeunz-gallery-item { animation-delay: 0.30s; }
.jeunz-gallery-grid a:nth-child(8)  .jeunz-gallery-item { animation-delay: 0.35s; }
.jeunz-gallery-grid a:nth-child(9)  .jeunz-gallery-item { animation-delay: 0.40s; }
.jeunz-gallery-grid a:nth-child(10) .jeunz-gallery-item { animation-delay: 0.45s; }
.jeunz-gallery-grid a:nth-child(11) .jeunz-gallery-item { animation-delay: 0.50s; }
.jeunz-gallery-grid a:nth-child(12) .jeunz-gallery-item { animation-delay: 0.55s; }
