/* ========================= */
/* STYLE GLOBAL */
/* ========================= */

body {
    background: #000;
    color: #fff;
    margin: 0;
    font-family: "Georgia", serif;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

/* Titre */
h1 {
    text-align: center;
    color: #c7a17a;
    letter-spacing: 2px;
    margin-bottom: 40px;
}

/* ========================= */
/* GRILLE DES APERCUS */
/* ========================= */

#avant-apres-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 20px;
}

/* ========================= */
/* APERCU 50/50 */
/* ========================= */

.before-after-preview {
    position: relative;
    height: 180px;
    overflow: hidden;
    cursor: pointer;
}

/* Les deux images */
.before-after-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Masquage 50% de l’image “après” */
.before-after-preview .after {
    clip-path: inset(0 0 0 50%);
}

/* ========================= */
/* CADRE CUIR */
/* ========================= */

.frame {
    background: #1a1a1a;
    border: 4px solid #3a2f28;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

/* ========================= */
/* LIGHTBOX */
/* ========================= */

#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
    animation: fadeIn 0.3s ease-out;
    z-index: 9999;
}

/* Fade-in */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Zoom-in du contenu */
#lightbox-content {
    max-width: 900px;
    width: 100%;
    position: relative;
    animation: zoomIn 0.25s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Bouton fermer */
#close-lightbox {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #3a2f28;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 22px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#close-lightbox:hover {
    background: #5a463c;
}
/* Lightbox : centrer et adapter à l'image */
#lightbox-content {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    display: inline-block;
}


/* Le cadre cuir doit s'adapter aussi */
.before-after.frame {
    padding: 0; /* plus de marge interne */
    border-radius: 12px;
    border: 4px solid #3a2f28;
    background: #1a1a1a;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden; /* important pour que l’image épouse le cadre */
}


/* L’image doit prendre toute la largeur disponible */
.before-after img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* remplit le cadre sans marge */
}


/* ========================= */
/* SLIDER */
/* ========================= */

.before-after {
    position: relative;
    overflow: hidden;
    max-height: 85vh;
}

.before-after img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.before-after .after {
    position: absolute;
    inset: 0;
    clip-path: inset(0 0 0 50%);
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #fff;
    cursor: ew-resize;
}

/* ========================= */
/* BOUTONS PRECEDENT / SUIVANT */
/* ========================= */

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(58, 47, 40, 0.9);
    color: white;
    border: none;
    font-size: 32px;
    width: 55px;
    height: 80px;
    cursor: pointer;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    z-index: 10001;
}

.nav-btn:hover {
    background: rgba(90, 70, 60, 0.95);
}

#prev { left: -70px; }
#next { right: -70px; }

@media (max-width: 768px) {
    .categories button,
    .categories .avant-apres-link,
    .btn-retour {
        padding: 18px 28px;
        font-size: 1.3em;
        border-width: 3px;
    }
}
