/* ============================================
   06 - GALERIE (filtres pétants + lightbox)
   ============================================ */

.jm-galerie {
    padding: var(--jm-section-y) 0;
    position: relative;
}

/* Filtres */
.jm-galerie__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    position: relative;
    z-index: 3;
}
.jm-filter {
    border: 2px solid var(--jm-grey-300);
    background: var(--jm-white);
    color: var(--jm-grey-700);
    font-family: var(--jm-font-display);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 11px 22px;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--jm-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.jm-filter:hover {
    border-color: var(--jm-blue);
    color: var(--jm-blue);
    transform: translateY(-2px);
}
.jm-filter.is-active {
    background: var(--jm-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 25px rgba(212, 32, 42, 0.35);
    transform: translateY(-2px);
}
.jm-filter i { font-size: 0.85rem; }

/* Grille */
.jm-galerie__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    position: relative;
    z-index: 3;
}

.jm-gitem {
    position: relative;
    overflow: hidden;
    border-radius: var(--jm-radius-lg);
    margin: 0;
    cursor: pointer;
    aspect-ratio: 4 / 5;
    background: var(--jm-grey-900);
    box-shadow: var(--jm-shadow);
    transition: all 0.5s cubic-bezier(.2,.7,.2,1);
    transform: translateY(0);
}
.jm-gitem.is-hidden { display: none; }
.jm-gitem img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.jm-gitem:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--jm-shadow-lg);
}
.jm-gitem:hover img {
    transform: scale(1.12);
}

.jm-gitem figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 26px 24px;
    color: #fff;
    background: linear-gradient(0deg, rgba(6, 26, 79, 0.96) 0%, rgba(6, 26, 79, 0.6) 60%, transparent 100%);
    transform: translateY(20%);
    opacity: 0;
    transition: all 0.4s ease;
}
.jm-gitem:hover figcaption {
    transform: translateY(0);
    opacity: 1;
}
.jm-gitem__tag {
    display: inline-block;
    background: var(--jm-red);
    color: #fff;
    font-family: var(--jm-font-display);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 10px;
    box-shadow: 0 6px 14px rgba(212, 32, 42, 0.4);
}
.jm-gitem h4 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

/* Icone zoom */
.jm-gitem__zoom {
    position: absolute;
    top: 16px; right: 16px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: var(--jm-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transform: scale(0.7) rotate(-45deg);
    transition: all 0.4s cubic-bezier(.2,.7,.2,1);
    z-index: 2;
}
.jm-gitem:hover .jm-gitem__zoom {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Lightbox */
.jm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 12, 30, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 30px;
    backdrop-filter: blur(8px);
}
.jm-lightbox.is-open { display: flex; animation: jmFadeIn 0.3s ease; }
.jm-lightbox img {
    max-width: 90vw;
    max-height: 86vh;
    border-radius: var(--jm-radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.jm-lightbox__close,
.jm-lightbox__nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    transition: all var(--jm-transition);
}
.jm-lightbox__close {
    position: absolute;
    top: 22px; right: 22px;
    width: 46px; height: 46px;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
}
.jm-lightbox__close:hover { background: var(--jm-red); border-color: var(--jm-red); }
.jm-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 1.4rem;
}
.jm-lightbox__nav--prev { left: 22px; }
.jm-lightbox__nav--next { right: 22px; }
.jm-lightbox__nav:hover { background: var(--jm-blue); border-color: var(--jm-blue); }
