/* =========================================
   1. VARIABLES & UTILITAIRES DE BASE
========================================= */
:root {
    --clr-primary: #10B981;
    --clr-primary-hover: #059669;
}

.text-primary { color: var(--clr-primary); }
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.bg-white { background-color: #ffffff; }
.bg-gradient-dark { background: linear-gradient(to bottom right, #000000, #111827); }
.section-padding { padding: 5rem 0; }
.text-center { text-align: center; }

/* =========================================
   2. HERO SECTION
========================================= */
.page-hero {
    padding: 10rem 1rem 5rem 1rem;
    background-color: #000;
}
.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.page-subtitle {
    font-size: 1.25rem;
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* =========================================
   3. GRILLE DE LA GALERIE
========================================= */
.gallery-grid {
    display: grid;
    /* 1 colonne sur mobile, auto-adaptation sur PC/Tablette */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    aspect-ratio: 1 / 1; /* Maintient les images sous forme de carrés parfaits */
    background-color: #f3f4f6; /* Couleur de fond pendant le chargement */
}

/* Image */
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Overlay sombre au survol */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
}

/* Contenu du texte sur l'image */
.gallery-info {
    padding: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-badge {
    display: inline-block;
    background-color: var(--clr-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.gallery-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.125rem;
    margin: 0;
}

/* === EFFETS AU SURVOL (HOVER) === */
.gallery-item:hover .gallery-img {
    transform: scale(1.1); /* Zoom de l'image */
}
.gallery-item:hover .gallery-overlay {
    opacity: 1; /* Apparition du fond sombre */
}
.gallery-item:hover .gallery-info {
    transform: translateY(0); /* Le texte remonte légèrement */
}

/* =========================================
   4. LIGHTBOX MODAL (PLEIN ÉCRAN)
========================================= */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.hidden {
    opacity: 0;
    visibility: hidden;
}

.lightbox-content {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox:not(.hidden) .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.lightbox-close svg {
    width: 2rem;
    height: 2rem;
}

.lightbox-close:hover {
    color: var(--clr-primary);
}

/* =========================================
   5. MOTEUR D'ANIMATIONS AU SCROLL
========================================= */
.animate-on-scroll { opacity: 0; }
.fade-in-up { transform: translateY(30px); transition: all 0.8s ease-out; }
.is-visible { opacity: 1 !important; transform: translate(0) !important; }