/* ==========================================================================
   STYLE GALERIE LIFESTYLE - "L'Instant Normand"
   ========================================================================== */

.lifestyle-gallery {
    padding: 40px 0;
    background-color: #3A3D41 !important; /* Force le fond si hérité */
}
/* --- TEXTE D'INTRODUCTION LIFESTYLE --- */
.lifestyle-subtitle {
    text-align: center;      /* Aligne les lignes de texte au milieu */
    max-width: 800px;        /* Empêche le texte de s'étaler sur toute la largeur */
    margin: 0 auto 40px;     /* 'auto' centre le bloc, 40px crée l'espace avec la grille */
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.9;
    padding: 0 20px;         /* Protection pour les petits écrans */
}

/* --- GRILLE --- */
.lifestyle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
    gap: 20px;
    padding: 0 40px;
}

/* --- ITEMS & EFFET GRAYSCALE --- */
.lifestyle-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #2D3034;
    z-index: 1; /* Assure que le contexte d'empilement est propre */
}

.lifestyle-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Force l'état initial */
    filter: grayscale(100%) !important; 
    -webkit-filter: grayscale(100%) !important;
    transition: filter 0.8s ease, transform 0.8s ease !important;
}

/* --- HOVER : RETOUR COULEUR --- */
.lifestyle-item:hover img {
    filter: grayscale(0%) !important;
    -webkit-filter: grayscale(0%) !important;
    transform: scale(1.05);
}

/* --- CRÉDIT PHOTO & EFFET FLOU (BACKDROP) --- */
.photo-credit {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 10;
    font-size: 0.7rem;
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 2px;
    
    /* Le fond avec transparence */
    background: rgba(0, 0, 0, 0.4) !important;
    
    /* L'effet de flou (Glassmorphism) */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    
    /* Animation */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, backdrop-filter 0.4s ease;
}

.lifestyle-item:hover .photo-credit {
    opacity: 1;
    transform: translateY(0);
}

/* --- FORMATS --- */
.lifestyle-item.tall { grid-row: span 3; }
.lifestyle-item.wide { grid-column: span 2; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .lifestyle-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 150px;
        padding: 0 20px;
    }
    /* Sur mobile, on désactive le grayscale pour économiser de la batterie et car le hover n'existe pas */
    .lifestyle-item img {
        filter: grayscale(0%) !important;
        -webkit-filter: grayscale(0%) !important;
    }
    .photo-credit {
        opacity: 0.9;
        transform: translateY(0);
    }
}