body {
	font-family: Macan Regular, "A1 Gothic R", Noto Sans JP, sans-serif;
}
.main-container{
    padding: 0 40px;
}

h2,h3{
	display: flex;
	justify-content: center;
}
.page-title,.pageTitle {
    text-align: center;
    font-weight: 500;
    font-family: "Poppins",sans-serif;
    letter-spacing: -.04em;
    line-height: 1
}

.page-title {
    font-size: 20px;
    margin: 0;
    padding: 10px 0;
    background-color: #1a1a4e;
    color: #fff
}

.pageTitle {
    font-size: 50px;
    margin: 2.5rem;
}
.container {
	max-width: 1200px;
	margin: 0 auto;
}

h1 {
	text-align: center;
	margin-bottom: 30px;
	color: #333;
}

/* Styles pour le slider avant/après */
/* 1. Section globale (pour centrer le slider sur la page) */
.slider-section {
    display: flex;
    justify-content: center; /* Centre le bloc slider au milieu de l'écran */
    width: 100%;
    padding: 20px 0;
}

/* 2. Le cadre du Slider */
.slider-container {
    position: relative;
    
    /* MAGIE ICI : Le conteneur s'adapte à la taille de l'image */
    width: fit-content; 
    max-width: 100%; /* Ne dépasse jamais la largeur de l'écran mobile */
    
    /* Pas de hauteur fixe ici, elle est définie par l'image */
    overflow: hidden;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Dans realisationDetails.css */

.image-container {
    /* On active la grille pour la superposition */
    display: grid;
    /* On crée une zone unique nommée "stack" */
    grid-template-areas: "stack";
    
    width: 100%;
    /* PLUS BESOIN de ratio fixe ! La grille va s'adapter au contenu */
    /* aspect-ratio: 4 / 3;  <-- À supprimer */
    
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 3. Les Images */
/* Dans realisationDetails.css */

.image-before, 
.image-after {
    /* Les deux images se mettent l'une sur l'autre dans la même case */
    grid-area: stack;
    
    width: 100%;
    
    /* MAGIE ICI : */
    /* On laisse la hauteur en auto pour que l'image la plus haute définisse la taille */
    height: 700px; 
    
    /* Astuce : Si les ratios sont différents, on force l'image à remplir la case */
    /* (Celle qui est plus petite va s'étirer/rogner pour matcher la grande) */
    min-height: 100%; 
    object-fit: cover; 
    object-position: center;
}

/* NOUVEAU CODE */
.image-before {
    /* C'est l'image Avant qui doit être au-dessus pour être celle qu'on "découpe" */
    z-index: 2; 
}
.image-after {
    z-index: 1;
}
@media (max-width: 768px) {
    .image-container {
        width: 100%;
        /* Force un carré parfait sur mobile, très propre pour Instagram/Facebook style */
        aspect-ratio: 1 / 1; 
    }
    .image-before, .image-after {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Remplit le carré */
    }
}

/* 4. Éléments du slider (Ligne et Poignée) */
.slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    z-index: 10;
    left: 50%;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    z-index: 11;
    cursor: col-resize;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    /* Vos icônes flèches... */
}

.slider-handle:hover {
	transform: translate(-50%, -50%) scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.slider-handle:active {
	transform: translate(-50%, -50%) scale(0.95);
}

.slider-handle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	background: white;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

.slider-handle::after {
	content: '⟷';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #4CAF50;
	font-size: 14px;
	font-weight: bold;
}

.slider-labels {
	position: absolute;
	bottom: 20px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 20px;
	z-index: 30;
}

.slider-label {
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: bold;
	backdrop-filter: blur(10px);
}

/* Styles pour la grille d'images existante */
.image-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, 250px);
	gap: 20px;
	padding: 20px 0;
	justify-content: center;
}

.image-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	width: 250px;
	height: 250px;
	cursor: pointer;
}

.image-item:hover {
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5)
}

.image-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.image-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
	color: white;
	padding: 20px 15px 15px;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.image-item:hover .image-caption {
	transform: translateY(0);
}

/* Lightbox styles */
.lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.lightbox.active {
	display: flex;
	opacity: 1;
}

.lightbox-content {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	position: relative;
}

.lightbox-image {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	font-size: 24px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
	backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
	left: 20px;
}

.lightbox-next {
	right: 20px;
}

.lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background-color: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	font-size: 24px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
	backdrop-filter: blur(10px);
}

.lightbox-close:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	background-color: rgba(0, 0, 0, 0.5);
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 14px;
	backdrop-filter: blur(10px);
}

.lightbox-title {
	position: absolute;
	bottom: 60px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	text-align: center;
	font-size: 18px;
	font-weight: bold;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.description {
	padding: 20px;
	border-radius: 8px;
	line-height: 1.6;
	color: #333;
    text-align: center;
}

/* =========================================
   RESPONSIVE (Modifié pour garder l'image entière)
   ========================================= */

@media (max-width: 768px) {
    /* 1. On retire la hauteur fixe du slider ! */
    .slider-container {
        height: auto; /* Laisse l'image définir la hauteur */
        width: 100%;  /* Prend toute la largeur disponible */
    }

    /* 2. On adapte la grille d'images */
    .image-grid {
        /* On réduit la taille des colonnes pour tablette */
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .image-item {
        /* L'item prend la largeur de la grille au lieu d'une taille fixe */
        width: 100%; 
        height: auto; /* Hauteur auto pour garder le ratio, ou une hauteur fixe plus petite */
        aspect-ratio: 1 / 1; /* Force un carré parfait (optionnel, moderne) */
    }

    /* Lightbox ajustements */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px; /* Un peu plus d'espace sur les bords */
    }

    /* 1. Slider Mobile : Toujours en hauteur auto */
    .slider-container {
        height: auto;
    }
    
    /* 2. Grille Mobile */
    .image-grid {
        /* 2 colonnes sur mobile ou 1 grosse selon la place */
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
    }

    .image-item {
        width: 100%;
        /* On garde aspect-ratio pour avoir des carrés propres */
        aspect-ratio: 1 / 1; 
        height: auto;
    }

    /* Ajustement titre */
    .pageTitle {
        font-size: 32px; /* Plus petit sur mobile */
        margin: 1.5rem 0;
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 80vh; /* Évite que l'image passe sous les barres de nav mobile */
    }
}