/* ============================================================
   CONAGRIGET — GALERIE
   Version: 1.0.0
   ============================================================ */

/* === FILTRES === */
.section-gallery-filters {
    padding: var(--space-lg) 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.gallery-filter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.gallery-filter:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.gallery-filter.active {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(107, 26, 42, 0.2);
}

.gallery-filter i {
    font-size: var(--text-sm);
}

/* === GALERIE === */
.section-gallery-main {
    padding: var(--space-4xl) 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* === ITEM GALERIE === */
.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--transition-smooth);
    aspect-ratio: 4/3;
    background: var(--color-bg-dark);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.gallery-item-media {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-item-media img,
.gallery-item-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--transition-smooth);
}

.gallery-item:hover .gallery-item-media img {
    transform: scale(1.05);
}

/* === OVERLAY === */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(26, 10, 15, 0.9) 0%,
        rgba(26, 10, 15, 0.3) 50%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity 0.4s var(--transition-smooth);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-action {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-secondary);
    color: var(--color-text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    cursor: pointer;
}

.gallery-item:hover .gallery-item-action {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item-action:hover {
    background: var(--color-secondary-dark);
}

.gallery-item-info {
    text-align: left;
}

.gallery-item-category {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-secondary);
    margin-bottom: var(--space-xs);
}

.gallery-item-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: #FFFFFF;
    margin: 0;
}

/* === ITEM VIDÉO === */
.gallery-item-video .gallery-item-media video {
    object-fit: cover;
}

.gallery-item-video .gallery-item-overlay {
    pointer-events: none;
}

/* === LIGHTBOX === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--transition-smooth);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 10, 15, 0.95);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 96px rgba(0, 0, 0, 0.4);
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--color-secondary);
    color: var(--color-text-dark);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-secondary);
    color: var(--color-text-dark);
}

.lightbox-caption {
    text-align: center;
    margin-top: var(--space-md);
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-primary);
    font-size: var(--text-base);
}

/* === RESPONSIVE === */
@media (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 767px) {
    .gallery-filters {
        gap: var(--space-xs);
    }

    .gallery-filter {
        padding: 8px 16px;
        font-size: var(--text-xs);
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .gallery-item {
        aspect-ratio: 4/3;
    }

    .gallery-item-overlay {
        padding: var(--space-md);
    }

    .gallery-item-title {
        font-size: var(--text-base);
    }

    .lightbox-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: var(--text-base);
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: var(--text-sm);
    }
}

@media (max-width: 374px) {
    .gallery-filter {
        font-size: 10px;
        padding: 6px 12px;
    }
}