/* =========================================
   GALLERY PAGE SPECIFIC STYLES
   ========================================= */

/* Gallery Hero Section */
.gallery-hero {
    height: 35vh;
    min-height: 250px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 90px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    /* Ajout d'une ombre portée subtile */
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/hero_main.png') center/cover;
    opacity: 0.35;
    /* Augmenté pour plus de texture */
    filter: contrast(1.2) brightness(0.9);
    /* Renforce le contraste de l'image de fond */
    z-index: 0;
}

.gallery-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Remplacement par un dégradé radial pour un effet "spotlight" plus premium */
    background: radial-gradient(circle at center, rgba(193, 154, 107, 0.7) 0%, rgba(160, 127, 85, 0.95) 90%);
    mix-blend-mode: multiply;
    /* Fusionne mieux avec l'image du dessous */
    z-index: 1;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #FFFFFF;
    padding: 0 1rem;
}

.gallery-hero-title {
    font-size: 3.5rem;
    /* Légèrement réduit pour l'harmonie */
    margin-bottom: 0.5rem;
    color: #FFFFFF;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.gallery-hero-subtitle {
    font-size: 1.2rem;
    /* Ajusté */
    opacity: 0.95;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Main Section */
.gallery-main {
    background-color: var(--white);
    padding: 4rem 0;
    /* Un peu moins de padding */
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    /* Réduit */
    padding: 0 1rem;
}

.filter-btn {
    padding: 12px 28px;
    /* Un peu plus compact */
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color);
    transition: width 0.4s ease, height 0.4s ease;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.filter-btn:hover {
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(193, 154, 107, 0.3);
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(193, 154, 107, 0.4);
}

/* Gallery Grid */
.gallery-grid-main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 5rem;
}

.gallery-item-main {
    position: relative;
    height: 350px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    transform: scale(1);
}

/* Filtrage - Items cachés */
.gallery-item-main.hide {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.gallery-item-main.show {
    opacity: 1;
    transform: scale(1);
    position: relative;
}

.gallery-img-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item-main:hover .gallery-img-main {
    transform: scale(1.12);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(193, 154, 107, 0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    /* Allows clicks to pass through to the image */
    cursor: pointer;
}

.gallery-item-main:hover .gallery-overlay {
    opacity: 1;
}

.gallery-category {
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-item-main:hover .gallery-category {
    transform: translateY(0);
}

/* Call to Action */
.gallery-cta {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--white) 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.gallery-cta h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--black);
}

.gallery-cta p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Dark Theme Adjustments */
body.dark-theme .gallery-cta {
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--white) 100%);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 1200px) {
    .gallery-grid-main {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .gallery-hero {
        height: 30vh;
        min-height: 200px;
        margin-top: 70px;
    }

    .gallery-hero-title {
        font-size: 3rem;
    }

    .gallery-hero-subtitle {
        font-size: 1.1rem;
    }

    .gallery-grid-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .gallery-item-main {
        height: 300px;
    }

    .gallery-cta h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .gallery-hero-title {
        font-size: 2.5rem;
    }

    .gallery-hero-subtitle {
        font-size: 1rem;
    }

    .gallery-filters {
        gap: 0.8rem;
    }

    .filter-btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .gallery-grid-main {
        grid-template-columns: repeat(2, 1fr);
        /* 2 colonnes pour réduire la taille */
        gap: 0.8rem;
        /* Espacement réduit */
    }

    .gallery-item-main {
        height: 180px;
        /* Hauteur réduite pour éviter le zoom excessif */
    }

    .gallery-cta {
        padding: 3rem 1.5rem;
    }

    .gallery-cta h3 {
        font-size: 1.5rem;
    }

    .gallery-cta p {
        font-size: 1rem;
    }
}

/* =========================================
   LIGHTBOX MODAL
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 45px;
    color: #FFFFFF;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-align: center;
    padding: 15px 30px;
    background: rgba(193, 154, 107, 0.9);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(193, 154, 107, 0.8);
    color: #FFFFFF;
    border: none;
    font-size: 2.5rem;
    padding: 20px 25px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Mobile Lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 80vh;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 15px 18px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: 1rem;
        padding: 10px 20px;
        bottom: 15px;
        max-width: 90%;
    }
}

/* Animation for filter transitions */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item-main.show {
    animation: fadeInScale 0.5s ease forwards;
}

/* Lightbox Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}