/* Style de la page réalisations */
.realisations-container {
    padding: 80px 40px;
    background: #0e0e0e;
    color: #fff;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    transition: background-color 0.6s ease, color 0.6s ease;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #00C9A7;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    z-index: 2;
    transition: color 0.6s ease;
}

/* Catégories */
.category {
    margin-bottom: 80px;
}

.category-title {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 40px;
    color: #00C9A7;
    position: relative;
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
}

.category-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, #00C9A7, #007CFF);
    bottom: -10px;
    left: 0;
    transform: translateX(0);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    position: relative;
    z-index: 1;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1c1c1c;
    padding: 30px 20px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 201, 167, 0.15);
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s ease, background-color 0.6s ease, box-shadow 0.3s ease, color 0.6s ease;
}

.project-card h2 {
    font-size: 1.3rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #00C9A7;
    transition: color 0.6s ease;
}

.project-card p {
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    color: #eaeaea;
    transition: color 0.6s ease;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(0,201,167,0.2), rgba(0,124,255,0.2));
    z-index: 0;
    transition: left 0.5s ease;
}

.project-card:hover .project-overlay {
    left: 0;
}

.project-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.project-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    z-index: 1;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #333;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    border-radius: 10px;
    width: 70%;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    overflow-x: hidden;
    box-sizing: border-box;
    z-index: 10001;
    transition: background-color 0.6s ease;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #00C9A7;
    transition: background-color 0.6s ease;
}

.modal-content p {
    font-size: 1.1rem;
    color: #ddd;
    margin-bottom: 40px;
    margin-top: 35px;
    transition: background-color 0.6s ease;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    max-height: 600px;
    object-fit: contain;
    display: block;
    margin: 0 auto 15px;
}

.modal-content iframe {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Conteneur du carrousel */
#modalCarousel {
    display: block;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    overflow: visible;     /* autorise débordement pour éviter coupure */
    padding: 0 30px;
    height: auto;          /* s'adapte à l'image */
    max-height: none;      /* suppression de la limite de hauteur */
    margin-bottom: 20px;
    position: relative;    /* référence pour flèches */
}


/* slide du carousel */
#modalCarousel .swiper-slide {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* image de la slide */
#modalCarousel .swiper-slide img {
    width: 100%;         /* s'adapte à la largeur du carousel */
    max-width: 100%;     /* ne dépasse pas le carousel */
    height: auto;        /* conserve proportions */
    max-height: none;    /* pas de limite de hauteur */
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    object-fit: contain; /* conserve l'image entière */
}

/* Force les slides et la wrapper à remplir tout l’espace */
#modalCarousel .swiper-wrapper,
#modalCarousel .swiper-slide {
    height: auto !important; /* hauteur automatique pour s’adapter au contenu */
}


/* flèches du carousel */
#modalCarousel .swiper-button-prev {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-image: linear-gradient(90deg, #00C9A7, #007CFF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: 1.5rem; /* taille réduite */
}

#modalCarousel .swiper-button-next {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-image: linear-gradient(90deg, #007CFF, #00C9A7);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: 1.5rem;
}

/* Faites ressortir les flèches sur fond sombre */
.swiper-button-prev,
.swiper-button-next {
    color: #fff;
}

/* Ajustez l’autoplay : pas d’interruption au survol */
.swiper-container:hover .swiper-button-prev,
.swiper-container:hover .swiper-button-next {
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2.5rem;
    padding: 10px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.6s ease , color 0.3s ease;
    z-index: 10002;
}

.close-btn:hover{
    color: #aeaeae;
}

/* ===== THÈME CLAIR ===== */
body.light .realisations-container {
    background-color: #fef9f3;
    color: #111;
}

body.light .page-title {
    color: #007CFF;
}

body.light .project-card {
    background-color: #d8d8d8;
    color: #111;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light .project-card h2 {
    color: #007CFF;
}

body.light .project-card p {
    color: #111;
}

body.light .modal-content {
    background-color: #d8d8d8;
}

body.light .modal-content h2 {
    color: #007CFF;
}

body.light .modal-content p {
    color: #111;
}

body.light .close-btn {
    color: #7e7d7d;
}

/* === Responsive Design === */
@media screen and (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    .category-title {
        font-size: 2rem;
    }
    .modal-content {
        width: 80%;
    }
}

@media screen and (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .modal-content {
        width: 90%;
    }
    .category-title {
        font-size: 1.8rem;
    }
}

@media screen and (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .category-title {
        font-size: 1.6rem;
    }
    .modal-content {
        width: 95%;
    }
    .project-image {
        height: 300px;
    }
    .page-title {
        font-size: 2rem;
    }
}
