/* ============================================
   IDSW Institut - Page Galerie
   ============================================ */

:root {
    --black: #000;
    --red: #DD0000;
    --gold: #FFCC00;
    --green: #2E7D32;
    --white: #fff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #6b7280;
    --gray-800: #1f2937;
    --font: 'Poppins', sans-serif;
    --shadow-md: 0 4px 15px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.15);
    --transition: all .3s ease;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-full: 50px;
}

/* ========== HERO ========== */
.gallery-hero {
    position: relative;
    background: linear-gradient(135deg, var(--black), #1a1a1a 40%, var(--red));
    padding: 80px 0 60px;
    text-align: center;
    color: var(--white);
}
.gallery-hero .hero-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,204,0,.1), transparent 60%);
}
.gallery-hero .hero-content { position: relative; z-index: 1; }
.gallery-hero h1 { font-size: 2.8rem; font-weight: 900; text-transform: uppercase; margin-bottom: 8px; }
.gallery-hero p { font-size: 1.1rem; opacity: .85; margin-bottom: 16px; }
.gallery-hero .breadcrumb {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.08); padding: 8px 20px; border-radius: var(--radius-full);
    font-size: .82rem;
}
.gallery-hero .breadcrumb a { color: var(--gold); text-decoration: none; }
.gallery-hero .breadcrumb i { font-size: .6rem; opacity: .5; }
.gallery-hero .breadcrumb span { font-weight: 600; }

/* ========== FILTRES ========== */
.gallery-filter-section {
    padding: 25px 0 10px;
    background: var(--white);
    position: sticky; top: 70px; z-index: 50;
    border-bottom: 1px solid var(--gray-200);
}
.filter-buttons {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.filter-btn {
    padding: 9px 22px; border: 2px solid var(--gray-200); background: var(--white);
    border-radius: var(--radius-full); cursor: pointer; font-weight: 600;
    font-size: .85rem; color: var(--gray-800); transition: var(--transition);
    font-family: var(--font);
}
.filter-btn.active,
.filter-btn:hover { background: var(--red); color: var(--white); border-color: var(--red); }

/* ========== GALERIE ========== */
.gallery-section { padding: 40px 0 70px; background: var(--white); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.gallery-item { opacity: 1; transition: opacity .3s; }
.gallery-item.hidden { display: none; }
.gallery-item-inner {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    cursor: pointer; aspect-ratio: 4/3; background: var(--gray-200);
}
.gallery-item-inner img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s ease;
}
.gallery-item-inner:hover img { transform: scale(1.08); }

.gallery-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 40%, transparent 70%);
    display: flex; align-items: flex-end; padding: 20px;
    opacity: 0; transition: var(--transition);
}
.gallery-item-inner:hover .gallery-overlay { opacity: 1; }
.gallery-overlay-content { width: 100%; }
.gallery-category {
    display: inline-block; background: var(--red); color: var(--white);
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: .7rem; font-weight: 600; margin-bottom: 8px;
}
.gallery-title {
    color: var(--white); font-size: .9rem; font-weight: 600; margin-bottom: 10px;
}
.gallery-zoom {
    background: var(--gold); color: var(--black); border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: var(--transition);
}
.gallery-zoom:hover { background: var(--white); transform: scale(1.1); }

.gallery-empty {
    text-align: center; padding: 60px 20px; color: var(--gray-600);
}
.gallery-empty i { font-size: 3rem; margin-bottom: 15px; display: block; color: var(--gray-200); }

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,.92);
    cursor: pointer;
}
.lightbox-container {
    position: relative; z-index: 1; max-width: 90vw; max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-content { position: relative; }
.lightbox-content img {
    max-width: 85vw; max-height: 80vh; object-fit: contain;
    border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-info {
    position: absolute; bottom: -50px; left: 0; right: 0;
    text-align: center; color: var(--white);
}
.lightbox-counter { font-size: .85rem; opacity: .7; display: block; }
.lightbox-title { font-size: 1.1rem; font-weight: 600; margin-top: 4px; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute; z-index: 2; border: none; cursor: pointer;
    color: var(--white); transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.lightbox-close {
    top: -50px; right: 0; width: 40px; height: 40px;
    border-radius: 50%; background: rgba(255,255,255,.15);
    font-size: 1.1rem;
}
.lightbox-close:hover { background: var(--red); }
.lightbox-prev {
    left: -60px; top: 50%; transform: translateY(-50%);
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,.1); font-size: 1.2rem;
}
.lightbox-next {
    right: -60px; top: 50%; transform: translateY(-50%);
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,.1); font-size: 1.2rem;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--red); }

/* ========== ANIMATION ========== */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.9); }
    to { opacity: 1; transform: scale(1); }
}
.lightbox.active .lightbox-content img { animation: fadeInScale .4s ease; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px)  { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-hero h1 { font-size: 2rem; }
    .gallery-filter-section { top: 60px; }
    .filter-btn { padding: 7px 16px; font-size: .78rem; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: -45px; right: 0; }
    .lightbox-content img { max-width: 95vw; }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .gallery-hero h1 { font-size: 1.6rem; }
    .gallery-overlay { padding: 12px; }
    .gallery-title { font-size: .75rem; }
}