/* --- BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #121212;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- NAVIGATION --- */
.navbar {
    position: absolute;
    top: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 30px 5%;
    z-index: 100;
}
.nav-links { display: flex; list-style: none; gap: 20px; }
.nav-links a { 
    color: white; text-decoration: none; font-size: 0.9rem; 
    letter-spacing: 1px; transition: 0.3s;
}
.nav-links a:hover { color: #aaa; }

/* --- HERO & CAROUSEL --- */
.hero { 
    position: relative; 
    height: 100vh; 
    width: 100%; 
    overflow: hidden; 
}

/* On utilise # car c'est l'ID que ton JS cible */
#carousel {
    position: absolute;
    inset: 0;
    background-color: #000; /* Fond noir si l'image est plus petite */
    z-index: 1;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: contain;    /* On voit toute la peinture */
    background-repeat: no-repeat; /* EMPÊCHE LA DUPLICATION */
    background-position: center;  /* Centre la peinture horizontalement et verticalement */
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

/* Le voile sombre par-dessus (optionnel si tu es déjà en contain sur fond noir) */
#carousel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3); 
    z-index: 2;
    pointer-events: none; /* Pour ne pas bloquer les clics */
}

.overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Doit être supérieur au z-index du carousel */
    text-align: center;
    width: 100%;
}

.btn-discover:visited {
    color: rgb(255, 0, 0); /* On force le blanc même si le lien est dans l'historique */
}

/* --- GRILLE DYNAMIQUE --- */
.container {
    max-width: 1600px; /* On donne de l'air pour les 4 colonnes */
    margin: 0 auto;
    padding: 80px 20px;
}

.gallery-grid {
    display: grid;
    /* 4 colonnes sur PC, s'adapte tout seul si l'écran réduit */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 25px;
}

/* --- LA CARTE (Le retour du Hover) --- */
.paint-card {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.paint-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

/* --- L'IMAGE --- */
.paint-card img {
    width: 100%;
    /* On force un ratio 4/5 ou 1/1 pour que la grille soit droite */
    aspect-ratio: 1 / 1; 
    /* Le secret pour ton caméléon : 
       On utilise 'cover' pour remplir le cadre proprement. 
       Si c'est un portrait, il sera centré. */
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.paint-card:hover img {
    transform: scale(1.05); /* Petit zoom au hover */
}


/* --- LAZY LOADING --- */
img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Une fois que l'image est chargée, on la montre */
img[src] {
    opacity: 1;
}

/* --- INFOS --- */
.paint-info {
    padding: 15px;
    background: #1e1e1e;
    border-top: 1px solid #333;
    text-align: center;
}

.paint-info h3 {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- MODALE --- */
.modal {
    display: none; 
    position: fixed; z-index: 1000;
    padding-top: 50px; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: zoom-out;
}

.modal-content {
    margin: auto; display: block;
    max-width: 90%; max-height: 80vh;
    object-fit: contain; /* L'image entière apparaît ici */
}

.close {
    position: absolute; top: 20px; right: 35px;
    color: white; font-size: 40px; cursor: pointer;
}

/* --- SCROLL UP --- */
#backToTop {
    display: none; 
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000; /* Toujours au-dessus de tout */
    
    /* Dimensions et Forme */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    
    /* Look "Effet de Verre" */
    background: rgba(255, 255, 255, 0.1); /* Fond blanc très transparent */
    backdrop-filter: blur(10px);          /* Floute ce qu'il y a derrière */
    -webkit-backdrop-filter: blur(10px);   /* Pour Safari */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Bordure fine et subtile */
    
    /* Texte (la flèche) */
    color: white;
    font-size: 24px;
    cursor: pointer;
    
    /* Centrage de la flèche */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Animation */
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#backToTop:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px); /* Petit saut vers le haut au survol */
    border-color: rgba(255, 255, 255, 0.5);
}


/* --- FOOTER --- */
footer {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid #333;
}

.footer-simple {
    display: flex;
    justify-content: center; /* Centre la ligne */
    align-items: center;
    flex-wrap: wrap; /* Passe à la ligne proprement sur petit mobile */
    gap: 25px; /* Espace entre les éléments */
    font-size: 0.85rem;
    color: #777;
}

.footer-simple a {
    color: #777;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-simple a:hover {
    color: #f5b146; /* Petite touche de couleur au survol */
}

.footer-simple span {
    cursor: default;
}

.footer-icon {
    width: 20px;   /* On force une petite taille */
    height: 20px;
    vertical-align: middle; /* Pour l'aligner parfaitement avec le texte à côté */
    transition: transform 0.2s;
}

.footer-icon:hover {
    transform: scale(1.2); /* Un petit effet de zoom sympa au survol */
}

/* --- BURGER LOOK --- */
.burger {
    display: none; /* Caché sur PC */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.burger span {
    width: 30px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* --- MOBILE VERSION (Media Query) --- */
@media (max-width: 768px) {
    .burger { display: flex; } /* On affiche le burger */

    .nav-links {
        position: fixed;
        right: -100%; /* Caché à droite de l'écran */
        top: 0;
        height: 100vh;
        width: 70%;
        background: rgba(18, 18, 18, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s ease-in-out;
        z-index: 1000;
    }

    /* Quand le menu est ouvert */
    .nav-links.active {
        right: 0; /* Il glisse vers la gauche pour apparaître */
    }
}

/* Animation des barres en croix */
.toggle-burger span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.toggle-burger span:nth-child(2) {
    opacity: 0; /* La barre du milieu disparaît */
}
.toggle-burger span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* --- TRANSITION DE PAGE --- */

/* On définit le mouvement */
@keyframes apparition {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* On crée la classe à appliquer */
.effet-chargement {
    animation: apparition 0.6s ease-out forwards;
}