/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #4a0e1b;
    /* Rouge bordeaux sombre */
    color: white;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    padding: 20px;
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    width: 100%;
}

/* --- Bouton Retour --- */
header {
    margin-bottom: 40px;
}

.btn-retour {
    display: inline-block;
    border: 1px solid white;
    padding: 8px 25px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-retour:hover {
    background: white;
    color: #4a0e1b;
    transform: translateY(-2px);
}

/* --- Section Hero (Titre + Vidéo) --- */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 0%;
}

.hero-text {
    flex: 1;
    padding-top: 150px;
}

.hero-text h1 {
    font-family: 'Bodoni Moda', serif;
    font-size: 7rem;
    font-weight: 400;
    line-height: 1;
}

.hero-text h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    margin-top: 5px;
}

.contexte-video-wrapper {
    flex: 1;
    max-width: 600px;
}

.video-embed-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* Ratio 16:9 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Styles pour les boîtes de texte (Description & Détails) --- */
.bordered-box {
    margin-bottom: 90px;
}

.bordered-box p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0 auto;
    /* Correction de la marge droite trop grande qui écrasait le texte */
    margin-right: 0; 
    max-width: 95%;
    color: white;
    text-decoration: none;
}

.bordered-box h3 {
    font-size: 2rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 20px;
}

.bordered-box.description {
    margin-top: 70px;
}

/* --- Grille pour Détails et Outils --- */
.grid-section {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Styles Outils & Icônes */
.tools {
    display: flex;
    flex-direction: column;
    /* Ajout pour centrer le contenu de la boite outils */
    align-items: center; 
}

.icons-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

.icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
}

.icon-img:hover {
    transform: scale(1.15);
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.project-btn {
    display: inline-block;
    background-color: #380710;
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin-top: 50px;
}

.project-btn:hover {
    background-color: #550a18;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Correction : J'ai enlevé la marge de 1000px qui cassait tout */
.texte-projet {
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: center;
    font-size: 1rem;
}

/* --- Footer Galerie --- */
.gallery {
    display: flex;
    gap: 20px;
    margin-top: 50px;
    align-items: flex-start;
}

.gallery-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-column h1 {
    font-size: 1.2rem;
    margin: 0;
    text-transform: uppercase;
}

.video-thumb {
    background-color: #ddd;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-thumb:hover {
    transform: scale(1.05);
    border-color: white;
}

/* --- Styles du Pop-up (MODAL) --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal-box {
    background-color: #380710;
    width: 90%;
    max-width: 900px;
    padding: 30px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 15px 5px #ff0000;
    border: 2px solid #ff0000;
    display: flex;
    flex-direction: column; 
}

.modal-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

.modal-video-container {
    flex: 1.5;
    aspect-ratio: 16/9;
    background: black;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-video-container video,
.modal-video-container iframe,
#modalImageDisplay {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Cache l'image par défaut */
#modalImageDisplay {
    display: none;
}

.modal-text-container {
    flex: 1;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: justify;
    max-height: 300px;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: -15px;
    left: -15px;
    background-color: #ff0000;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px #ff0000;
    transition: transform 0.2s;
    z-index: 1001;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* =========================================
   RESPONSIVE (Version Mobile & Tablette)
   ========================================= */

@media (max-width: 992px) {
    /* Tablette : on réduit un peu le titre */
    .hero-text h1 {
        font-size: 5rem;
    }
}

@media (max-width: 768px) {
    /* --- Mobile --- */

    /* 1. Hero Section : On empile (Texte en haut, Vidéo en bas) */
    .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .hero-text {
        padding-top: 20px;
        width: 100%;
    }

    .hero-text h1 {
        font-size: 3.5rem; /* Beaucoup plus petit pour mobile */
    }

    .contexte-video-wrapper {
        width: 100%;
        max-width: 100%;
    }

    /* 2. Grille Détails/Outils : On empile en 1 colonne */
    .grid-section {
        grid-template-columns: 1fr;
    }

    .bordered-box p {
        margin-right: 0; /* Utilise toute la largeur */
        text-align: left;
    }

    /* 3. Footer Galerie : On empile les colonnes verticalement */
    .gallery {
        flex-direction: column;
    }
    
    .gallery-column {
        width: 100%;
    }

    /* 4. Modal : Vidéo au dessus, texte en dessous */
    .modal-content {
        flex-direction: column;
    }
    
    .modal-video-container {
        width: 100%;
    }
    
    .modal-text-container {
        width: 100%;
        text-align: left;
    }

    /* Ajustement bouton close */
    .close-btn {
        top: 10px;
        left: auto;
        right: 10px; /* On le met à droite sur mobile, plus naturel */
    }
    
    .modal-box {
        padding: 40px 15px 15px 15px; /* De la place pour le bouton close */
    }
}