/* ============================================================
   GALERIE — Design avancé avec diaporama par catégorie
   ============================================================ */

/* ── Filter bar ── */
.galerie-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--border);
}
.filter-label {
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-right: 4px;
    white-space: nowrap;
}
.gal-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--slate);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: all .25s;
    white-space: nowrap;
}
.gal-filter-btn i { font-size: .8rem; }
.gal-filter-btn:hover { border-color: var(--green); color: var(--green-dark); }
.gal-filter-btn.active {
    background: var(--green-dark);
    color: var(--white);
    border-color: var(--green-dark);
    box-shadow: 0 4px 14px rgba(27,94,32,.3);
}
.gal-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
}
.gal-filter-btn:not(.active) .gal-count {
    background: var(--border);
    color: var(--slate);
}

/* ── Gallery grid ── */
.galerie-masonry {
    columns: 4;
    column-gap: 12px;
}
.galerie-masonry .gal-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: block;
}
.galerie-masonry .gal-item img {
    width: 100%;
    display: block;
    transition: transform .5s ease;
    border-radius: var(--radius-sm);
}
.galerie-masonry .gal-item:hover img { transform: scale(1.05); }
.gal-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(27,94,32,.85) 100%);
    opacity: 0;
    transition: opacity .3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    border-radius: var(--radius-sm);
}
.gal-item:hover .gal-overlay { opacity: 1; }
.gal-overlay-title {
    color: var(--white);
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.gal-overlay-actions {
    display: flex;
    gap: 8px;
}
.gal-btn-action {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(4px);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    transition: background .2s;
}
.gal-btn-action:hover { background: var(--green); }

/* ── Category slideshow launch button ── */
.cat-slideshow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: var(--white);
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 4px 12px rgba(27,94,32,.3);
}
.cat-slideshow-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27,94,32,.4); }

/* ── LIGHTBOX / SLIDESHOW ── */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lb-overlay.open { display: flex; }

/* Top bar */
.lb-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, transparent 100%);
    z-index: 10;
}
.lb-title-area { display: flex; flex-direction: column; gap: 3px; }
.lb-title { color: var(--white); font-weight: 700; font-size: .95rem; }
.lb-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(125,194,30,.3);
    color: #AEE571;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
}
.lb-counter { color: rgba(255,255,255,.6); font-size: .85rem; font-weight: 700; }
.lb-actions { display: flex; gap: 8px; align-items: center; }
.lb-icon-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
    transition: background .2s;
}
.lb-icon-btn:hover { background: rgba(255,255,255,.25); }
.lb-icon-btn.playing { background: var(--green); }

/* Main image area */
.lb-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 80px 110px;
}
.lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    transition: opacity .3s ease;
    user-select: none;
}
.lb-img.fading { opacity: 0; }

/* Navigation arrows */
.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.15);
    color: var(--white);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    z-index: 5;
}
.lb-arrow:hover { background: var(--green); border-color: var(--green); transform: translateY(-50%) scale(1.05); }
.lb-arrow.lb-prev { left: 16px; }
.lb-arrow.lb-next { right: 16px; }

/* Bottom film strip */
.lb-strip {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 70px;
    background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, transparent 100%);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--green) rgba(255,255,255,.1);
    align-items: center;
    z-index: 5;
}
.lb-strip::-webkit-scrollbar { height: 3px; }
.lb-strip::-webkit-scrollbar-thumb { background: var(--green); border-radius: 2px; }
.lb-thumb {
    width: 60px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    opacity: .5;
    border: 2px solid transparent;
    transition: all .2s;
    flex-shrink: 0;
}
.lb-thumb.active { opacity: 1; border-color: var(--green); }
.lb-thumb:hover { opacity: .8; }

/* Progress bar */
.lb-progress {
    position: absolute;
    bottom: 98px;
    left: 0;
    height: 2px;
    background: var(--green);
    transition: width linear;
    z-index: 10;
}

/* Category section headers */
.cat-section {
    margin-bottom: 48px;
}
.cat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.cat-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--green-dark);
}
.cat-section-title .cat-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.cat-section-count { font-size: .8rem; color: var(--text-muted); font-weight: 600; }

/* Grid in each category section */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.cat-grid .gal-item { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; position: relative; }
.cat-grid .gal-item img { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform .4s; }
.cat-grid .gal-item:hover img { transform: scale(1.06); }

/* Empty state */
.gal-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}
.gal-empty i { font-size: 3rem; color: var(--border); display: block; margin-bottom: 12px; }

@media (max-width: 1024px) {
    .galerie-masonry { columns: 3; }
    .lb-stage { padding: 70px 60px 110px; }
    .lb-arrow.lb-prev { left: 8px; }
    .lb-arrow.lb-next { right: 8px; }
}
@media (max-width: 768px) {
    .galerie-masonry { columns: 2; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .cat-grid .gal-item img { height: 130px; }
    .lb-stage { padding: 60px 50px 100px; }
    .lb-arrow { width: 40px; height: 40px; font-size: .9rem; }
}
@media (max-width: 480px) {
    .galerie-masonry { columns: 2; }
    .gal-filter-btn { font-size: .78rem; padding: 7px 12px; }
}
