/* --- VARIABLES GLOBALES (Rappel pour cohérence) --- */
:root {
    --bg-light: #E8EBE0;
    --bg-alt: #CAD2C5;
    --accent-green: #84A98C;
    --text-mid: #52796F;
    --text-dark: #354F52;
    --text-ultra: #2F3E46;
    --font-main: 'Inter', sans-serif;
    --font-title: 'Montserrat', sans-serif;
}

/* --- STYLE DES TAGS GÉNÉRIQUES --- */
.tag, .card-tag {
    display: inline-block;
    padding: 6px 15px;
    background-color: var(--accent-green);
    color: var(--bg-light);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.tag:hover, .card-tag:hover {
    background-color: var(--text-mid);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- NOUVELLE HERO SECTION (Bannière plein écran) --- */
.project-hero {
    position: relative;
    width: 100%;
    height: 75vh; /* Hauteur : 75% de l'écran */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Centrage flexible du contenu */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--text-dark); /* Couleur de repli pendant le chargement */
}

/* Filtre sombre (Overlay) pour lisibilité du texte blanc */
.project-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(53, 79, 82, 0.4), rgba(47, 62, 70, 0.9));
    z-index: 1;
}

.projet-layout {
    display: grid;
    /* Colonne 1 (Sommaire) | Colonne 2 (Texte Flexible) | Colonne 3 (Vide pour équilibrer) */
    grid-template-columns: 260px 1fr 260px;
    gap: 40px;
    align-items: start;
    position: relative;
}

.project-sidebar {
    grid-column: 1; /* Force à gauche */
    width: 100%; /* Prend toute la largeur de sa colonne (250px) */

    /* Sticky : Reste accroché en haut */
    position: -webkit-sticky;
    position: sticky;
    top: 120px; /* Marge du haut */
    z-index: 10;

    /* Scroll interne si l'écran est petit en hauteur */
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    scrollbar-width: none; /* Cache la barre de scroll (Firefox) */
}
.project-sidebar::-webkit-scrollbar { display: none; } /* Cache scroll (Chrome) */

/* Contenu de la bannière */
.hero-content {
    position: relative;
    z-index: 2; /* Au-dessus du filtre */
    padding: 0 30px;
    max-width: 1000px;
    color: #FFFFFF;
}

.hero-category {
    display: inline-block;
    background-color: var(--accent-green);
    color: var(--bg-light);
    padding: 8px 20px;
    border-radius: 50px;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.hero-title {
    font-family: var(--font-title);
    /* Clamp permet une taille fluide entre 40px (mobile) et 80px (desktop) */
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 800;
    margin: 0 0 30px 0;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.hero-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Style spécifique "verre dépoli" pour les tags sur fond sombre */
.tag.hero-tag-style {
    background-color: rgba(232, 235, 224, 0.15); /* Blanc cassé très transparent */
    color: #E8EBE0;
    backdrop-filter: blur(10px); /* Effet de flou derrière le tag */
    border: 1px solid rgba(232, 235, 224, 0.3);
    padding: 8px 20px;
}

.tag.hero-tag-style:hover {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-light);
}

/* --- CONTENEUR PRINCIPAL --- */
.projet-detail-container {
    /* ON PASSE DE 900px À 1600px */
    /* Cela laisse : 250px (gauche) + 800px (texte) + 250px (droite) + marges */
    max-width: 1600px;
    width: 95%; /* Sécurité pour les petits écrans */
    margin: 60px auto 100px auto;
    padding: 0 30px;
}

.projet-intro-text {
    font-size: 22px;
    text-align: center;
    color: var(--text-mid);
    margin-bottom: 50px;
    line-height: 1.6;
    font-weight: 500;
}

.projet-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-dark);
}

.projet-content p {
    margin-bottom: 25px;
}

.projet-content-wrapper {
    grid-column: 2; /* Se place au milieu */

    display: flex;
    flex-direction: column;
    align-items: center; /* Centre le texte dans la colonne du milieu */

    width: 100%;
    max-width: 850px; /* Largeur de lecture optimale */
    margin: 0 auto; /* Centre le bloc lui-même */
}

/* --- STYLES DES MÉDIAS DYNAMIQUES (Conservés) --- */
.media-container {
    margin-top: 40px;
    margin-bottom: 40px;
    display: block;
    max-width: 100%;
}

.media-container img {
    width: 100%;
    height: auto;
    border-radius: 16px; /* Arrondi plus prononcé */
    display: block;
    filter: drop-shadow(0 15px 40px rgba(47, 62, 70, 0.15));
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(47, 62, 70, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* Responsivité médias sur mobile */
/* Dès que l'écran est plus petit que 1300px, on passe le sommaire au-dessus */
@media (max-width: 1300px) {
    .projet-layout {
        display: flex;
        flex-direction: column-reverse; /* Sommaire passe au dessus */
        gap: 40px;
    }

    .project-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        max-height: none;
        z-index: 1;
        /* On retire la grille spécifique sidebar */
        grid-column: auto;
    }

    /* Le texte prend toute la place disponible */
    .projet-content-wrapper {
        grid-column: auto;
        max-width: 100%;
    }

    /* On rétrécit un peu le conteneur principal */
    .projet-detail-container {
        max-width: 900px;
    }
}

/* --- SYSTÈME DE GRID --- */
.media-grid {
    display: flex;
    gap: 15px; /* Espace entre les images */
    margin: 30px auto; /* Centré par défaut */
    justify-content: center;
}

.grid-item {
    flex: 1; /* Chaque image prend la même largeur disponible */
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit le cadre sans déformer */
    border-radius: 12px;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(47, 62, 70, 0.1));
}

.grid-item .video-wrapper {
    width: 100%;
    height: 100%; /* Important pour que la vidéo suive la hauteur des images si possible */
}

/* Responsivité : sur mobile, on passe les grilles en colonne */
@media (max-width: 600px) {
    .media-grid {
        flex-direction: column;
        width: 100% !important;
    }
}

/* --- CAROUSEL (Version Hybride Portrait/Paysage) --- */
/* --- CONFIGURATION DU CAROUSEL --- */
.carousel-container {
    position: relative;
    margin: 40px auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(47, 62, 70, 0.15);
    background-color: var(--text-ultra);
    /* Pas d'aspect-ratio ici, il est défini dans les variantes ci-dessous */
}

/* --- MODE PAYSAGE (Horizontal) --- */
/* Idéal pour le 16/9 ou les photos classiques */
.carousel-container.mode-paysage {
    aspect-ratio: 16 / 9;
}

/* --- MODE PORTRAIT (Vertical) --- */
.carousel-container.mode-portrait {
    /* On passe en 4/5 (Standard Instagram/Web) c'est un peu moins haut et plus harmonieux */
    aspect-ratio: 4 / 5;

    /* IMPORTANT : On limite la largeur maximale plus strictement */
    /* 500px de large = 625px de haut. Ça rentre sur tous les écrans d'ordinateur portables */
    max-width: 500px;

    /* On s'assure qu'il est bien centré si la largeur est réduite */
    margin-left: auto;
    margin-right: auto;
}

/* --- FIX SUPP : Sécurité pour le fond flouté --- */
/* Ajoute ceci pour garantir que le fond gris ne se voit jamais */
.slide-blur-bg {
    /* ... tes styles existants ... */
    /* Ajoute ces lignes pour forcer le remplissage : */
    min-height: 100%;
    min-width: 100%;
}

/* --- RESPONSIVITÉ --- */
@media (max-width: 600px) {
    /* Sur mobile, le portrait prend toute la largeur */
    .carousel-container.mode-portrait {
        max-width: 100% !important;
    }
}

.carousel-slide {
    display: none;
    height: 100%;
    width: 100%;
    position: relative; /* Important pour superposer les couches */
    animation: fadeEffect 0.5s;
}

.carousel-slide.active {
    display: block;
}



/* --- COUCHE 1 : LE FOND FLOUTÉ --- */
.slide-blur-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.7); /* Flou + légèrement assombri */
    transform: scale(1.1); /* Zoom pour éviter les bords blancs du flou */
    z-index: 1;
}

/* --- COUCHE 2 : L'IMAGE NETTE --- */
.slide-main-img {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 2; /* Au-dessus du flou */

    /* "Contain" affiche l'image en entier sans couper */
    object-fit: contain;

    /* Optionnel : ombre portée pour détacher l'image du fond */
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

/* --- VIDÉOS --- */
.carousel-slide .video-wrapper {
    height: 100%;
    width: 100%;
    padding-bottom: 0;
    border-radius: 0;
    position: relative;
    z-index: 2;
    background: #000; /* Fond noir pour vidéo */
}

/* --- ANIMATION ET BOUTONS (MANQUANTS) --- */

/* Animation de fondu pour les slides */
@keyframes fadeEffect {
    from {opacity: 0.6;}
    to {opacity: 1;}
}

/* Styles des boutons Précédent / Suivant */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(47, 62, 70, 0.6); /* Fond semi-transparent */
    color: white;
    border: none;
    cursor: pointer;
    padding: 0; /* Reset padding */
    width: 50px;
    height: 50px;
    font-size: 24px; /* Flèche plus visible */
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10; /* Important : pour être au-dessus de l'image */
}

.carousel-btn:hover {
    background-color: var(--accent-green);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 15px;
}

.carousel-btn.next {
    right: 15px;
}

/* Responsivité pour les boutons */
@media (max-width: 600px) {
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* --- VIDÉO LOCALE --- */
.local-video-player {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow: 0 10px 30px rgba(47, 62, 70, 0.15);
    background-color: #000; /* Fond noir si la vidéo ne remplit pas tout */
}

/* Ajustement spécifique pour le Grid */
.grid-item .local-video-player {
    height: 100%;
    object-fit: cover; /* Pour s'aligner avec les images à côté */
}

/* --- TYPOGRAPHIE & EFFETS DE TEXTE (DA: Alexis Cardon) --- */

/* 1. VARIANTES DE TAILLE (Pour hiérarchiser sans changer de balise h1/h2) */
.text-huge {
    font-family: var(--font-title);
    font-size: clamp(3rem, 6vw, 5rem); /* Très gros, fluide */
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-ultra);
    margin-bottom: 20px;
}

.text-xl {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 40px;
    margin-bottom: 15px;
}

.text-lg {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-top: 30px;
    margin-bottom: 10px;
}

/* 2. EFFETS CRÉATIFS */

/* Effet "Gradient" : Le texte prend un dégradé de vos verts */
.text-gradient {
    background: linear-gradient(135deg, var(--text-ultra) 0%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block; /* Nécessaire pour le clip */
}

/* Effet "Surligneur" : Comme un marqueur sur le texte */
.text-highlight {
    background: linear-gradient(120deg, transparent 0%, var(--accent-green) 0%);
    background-size: 100% 40%; /* Ne surligne que le bas */
    background-repeat: no-repeat;
    background-position: 0 85%; /* Position en bas */
    color: var(--text-ultra);
    padding: 0 5px;
    transition: background-size 0.3s ease;
}

.text-highlight:hover {
    background-size: 100% 100%; /* Remplit tout au survol */
    color: var(--bg-light); /* Le texte devient clair */
}

/* Effet "Outline" : Texte transparent avec contour (Style moderne) */
.text-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--text-dark); /* Contour */
    font-family: var(--font-title);
    font-weight: 800;
    letter-spacing: 1px;
}

/* Modification du style Badge pour correspondre aux Tags */
.text-badge {
    display: inline-block;
    font-size: 0.50em; /* Légèrement plus petit que le texte courant */
    font-family: var(--font-main), serif;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;

    /* On applique le style "Tag" : Fond vert, texte clair */
    background-color: var(--accent-green);
    color: var(--bg-light);

    padding: 4px 12px; /* Plus d'espace pour respirer */
    border-radius: 50px; /* Forme de "pilule" (Pill shape) */

    vertical-align: middle;
    margin: 0 4px;
    border: none; /* SUPPRESSION de la bordure qui faisait "bizarre" */

    /* Petit ajustement pour qu'il soit bien aligné avec le texte */
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Légère ombre pour le relief */
}

/* 3. ALIGNEMENT */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
/* --- DESIGN DU SOMMAIRE (Refonte Esthétique) --- */

/* 1. La boite principale */
.toc-container {
    background-color: rgba(255, 255, 255, 0.6); /* Fond légèrement blanc/transparent */
    padding: 30px;
    border-radius: 16px; /* Gros arrondis comme vos images */
    border: 1px solid rgba(132, 169, 140, 0.3); /* Bordure fine verte pâle */
    box-shadow: 0 10px 30px rgba(82, 121, 111, 0.1); /* Ombre douce verte/grise */
    backdrop-filter: blur(10px); /* Effet de flou derrière (Glassmorphism) */
    transition: transform 0.3s ease;
}

/* 2. Le Titre "SOMMAIRE" */
.toc-title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px; /* Espacement des lettres pour le style "Editorial" */
    text-transform: uppercase;
    color: var(--accent-green); /* Le vert vif pour le titre */
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(132, 169, 140, 0.2);
    padding-bottom: 10px;
    display: block;
}

/* 3. La liste (On enlève les puces moches) */
#toc-list {
    list-style: none !important; /* Force la suppression des puces noires */
    padding: 0;
    margin: 0;
    position: relative;
}

#toc-list li {
    margin-bottom: 0; /* On gère l'espacement via le lien a */
    position: relative;
}

/* 4. Les Liens */
#toc-list a {
    text-decoration: none;
    display: block;
    padding: 8px 0;
    color: var(--text-mid); /* Gris-vert moyen par défaut */
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animation fluide */
    border-left: 3px solid transparent; /* Bordure invisible à gauche pour l'animation */
    padding-left: 15px; /* Espace pour le texte */
}

/* 5. Effet au Survol (Hover) */
#toc-list a:hover {
    color: var(--text-ultra); /* Devient foncé */
    border-left-color: var(--accent-green); /* La barre verte apparaît à gauche */
    padding-left: 20px; /* Le texte se décale vers la droite */
    background: linear-gradient(90deg, rgba(132, 169, 140, 0.1) 0%, transparent 100%); /* Petit fond subtil */
    border-radius: 0 8px 8px 0;
}

/* 6. Hiérarchie Visuelle (Indentation selon la taille du titre) */

/* Titres [HUGE] : Gros, gras, peu indentés */
#toc-list a.toc-link-huge {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    margin-top: 10px; /* Espace avant une nouvelle section majeure */
}

/* Titres [XL] : Moyen, indentés */
#toc-list a.toc-link-xl {
    font-weight: 600;
    font-size: 14px;
    margin-left: 5px;
    border-left-width: 2px; /* Ligne plus fine */
}

/* Titres [LG] : Petits, très indentés (sous-parties) */
#toc-list a.toc-link-lg {
    font-weight: 400;
    font-size: 13px;
    margin-left: 15px;
    color: #84A98C; /* Légèrement plus clair */
    border-left-width: 1px;
}

/* --- LOGIQUE PLIABLE DU SOMMAIRE --- */

/* 1. L'en-tête cliquable */
.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 2px solid rgba(132, 169, 140, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

/* Effet au survol du titre */
.toc-header:hover .toc-title {
    color: var(--text-ultra);
}

.toc-title {
    /* ... tes styles existants ... */
    margin-bottom: 0; /* On retire la marge car c'est le header qui gère l'espace */
    border-bottom: none; /* On déplace la bordure sur le header */
    padding-bottom: 0;
    user-select: none; /* Empêche de sélectionner le texte quand on clique */
}

/* 2. La petite flèche (Icone) */
.toc-icon {
    font-size: 12px;
    color: var(--accent-green);
    transition: transform 0.4s ease; /* Animation de rotation */
}

/* 3. Le Wrapper de la liste (Nécessaire pour l'animation de hauteur) */
.toc-content-wrapper {
    overflow: hidden; /* Cache le contenu quand la hauteur est à 0 */
    max-height: 500px; /* Une hauteur max arbitraire (suffisante pour ton plus long sommaire) */
    opacity: 1;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease, margin-top 0.4s ease;
}

/* --- ÉTAT FERMÉ (COLLAPSED) --- */

/* Quand la classe 'is-closed' est ajoutée via JS : */

/* A. On tourne la flèche */
.toc-container.is-closed .toc-icon {
    transform: rotate(-90deg);
}

/* B. On réduit la hauteur à 0 et on rend transparent */
.toc-container.is-closed .toc-content-wrapper {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* C. On retire la bordure du header pour faire plus propre quand fermé */
.toc-container.is-closed .toc-header {
    border-bottom-color: transparent;
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .project-sidebar {
        position: relative; /* On annule le sticky */
        top: 0;
        width: 100%;
        max-height: none;
    }
}

/* --- TEXTE EN COLONNES --- */
.text-columns-container {
    display: flex;
    flex-wrap: wrap; /* Permet de passer à la ligne si besoin */
    gap: 40px; /* Espace entre les colonnes */
    margin: 40px 0;
    align-items: flex-start; /* Aligne les textes en haut */
}

.text-column-item {
    flex: 1; /* Chaque colonne prend la même largeur */
    min-width: 250px; /* Largeur minimum avant de passer à la ligne sur mobile */
}

/* RESPONSIVITÉ */
@media (max-width: 768px) {
    .text-columns-container {
        flex-direction: column; /* On empile les colonnes sur mobile */
        gap: 30px;
    }

    .text-column-item {
        width: 100%;
    }
}

/* --- STYLE CITATION (Ajouté pour que [CITATION:] fonctionne) --- */
.citation-style {
    display: block;
    border-left: 5px solid var(--accent-green); /* Barre verte à gauche */
    background-color: rgba(132, 169, 140, 0.15); /* Fond vert très léger */
    padding: 20px 30px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;

    font-family: var(--font-title); /* Police titre pour le style */
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.6;

    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.citation-style::before {
    content: "“";
    font-family: serif;
    font-size: 60px;
    color: var(--accent-green);
    opacity: 0.4;
    position: absolute;
    top: -10px;
    left: 10px;
    line-height: 1;
}

/* --- STYLE PDF (Visualisation Améliorée) --- */
.pdf-wrapper {
    width: 100%;
    /* Couleur gris foncé comme Adobe Reader pour faire pro */
    background-color: #525659;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 40px 0;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
}

.pdf-viewer {
    width: 100%;
    /* C'est ICI que ça se joue : */
    height: 80vh; /* Prend 80% de la hauteur de l'écran */
    min-height: 600px; /* Minimum 600px pour être lisible */
    border: none;
    display: block;
}

.pdf-actions {
    padding: 20px;
    text-align: center;
    background-color: var(--bg-light); /* Fond clair pour le bouton */
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Texte explicatif à côté du bouton (optionnel) */
.pdf-actions::before {
    content: "Document PDF";
    font-weight: 600;
    color: var(--text-dark);
    margin-right: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .pdf-viewer {
        /* Sur mobile, on réduit la hauteur pour ne pas bloquer tout le scroll */
        height: 50vh;
        min-height: 400px;
    }

    .pdf-actions {
        flex-direction: column;
        gap: 10px;
    }

    .pdf-actions::before {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* --- TOOLTIPS TYPE WIKIPEDIA (Correction pour les Titres) --- */

/* Le mot souligné */
.wiki-word {
    /* On remplace la bordure par text-decoration, incassable sur les gros titres */
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--accent-green);
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;

    color: inherit; /* Il garde la couleur exacte du titre ou du texte */
    font-weight: inherit; /* Il garde la graisse du titre */

    cursor: help;
    position: relative;
    transition: background 0.3s ease;
}

.wiki-word:hover {
    background-color: rgba(132, 169, 140, 0.2);
}

/* L'infobulle */
.wiki-popup {
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background-color: var(--text-ultra);
    color: var(--bg-light);
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 100;

    /* CORRECTION DU DÉCALAGE : On utilise calc() pour fixer un écart strict de 15px, peu importe la taille du titre */
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);

    /* PROTECTION TYPOGRAPHIQUE : On empêche le popup d'hériter de la taille géante et du gras du titre */
    font-family: var(--font-main), sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal; /* Autorise le retour à la ligne */

    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--accent-green);

    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
}

/* La petite flèche en bas de la bulle */
.wiki-popup::after {
    content: "";
    position: absolute;
    top: 100%; /* S'accroche pile sous la bulle */
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: var(--text-ultra) transparent transparent transparent;
}

/* Affichage au survol */
.wiki-word:hover .wiki-popup {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media (max-width: 600px) {
    .wiki-popup {
        width: 200px;
        left: 0;
        transform: translateX(-20%);
    }
    .wiki-word:hover .wiki-popup {
        transform: translateX(-20%) translateY(0);
    }
    .wiki-popup::after {
        left: 20%;
    }
}

/* --- BANNIÈRE HERO AVEC CONTROLE DE ZOOM --- */
.project-header {
    height: 60vh;
    min-height: 400px;
    position: relative; /* Important pour contenir les enfants absolute */
    overflow: hidden;   /* Empêche l'image zoomée de dépasser */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 60px;
}

/* L'image de fond qui sera zoomée/bougée */
.hero-background-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit tout l'espace */
    z-index: 0; /* Tout au fond */
    /* Les propriétés transform et object-position seront injectées via PHP */
}

/* L'overlay sombre (au dessus de l'image, en dessous du texte) */
.header-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(47, 62, 70, 0.4), rgba(47, 62, 70, 0.8));
    z-index: 1;
}

/* Le contenu texte (au dessus de tout) */
.header-content {
    position: relative;
    z-index: 2; /* Au premier plan */
    max-width: 900px;
    padding: 20px;
}

.code-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f4f4f4;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Inter', sans-serif;
    margin: 20px 0;
}

.loc-counter {
    font-size: 1.4rem;
    color: #52796F;
    font-weight: 800;
}

.counter-label {
    font-weight: 600;
    color: #555;
}

/* --- STYLE DES TITRES STANDARD HTML --- */
.dynamic-content h1,
.dynamic-content h2 {
    font-family: var(--font-title);
    font-size: clamp(2rem, 4vw, 3rem); /* Taille fluide, un peu plus petite que hero */
    font-weight: 800;
    color: var(--text-ultra);
    margin: 60px 0 20px 0;
    line-height: 1.2;
}

.dynamic-content h3 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 40px 0 15px 0;
}

.dynamic-content h4 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-mid);
    margin: 30px 0 10px 0;
}

.dynamic-content h5,
.dynamic-content h6 {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-green);
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- BADGE ÉQUIPE (Mise en avant sur la bannière) --- */
.hero-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15); /* Effet verre dépoli */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    margin-top: -10px; /* Rapproche le badge du titre */
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.hero-team-badge:hover {
    transform: translateY(-3px);
    background: var(--accent-green); /* S'allume en vert au survol */
    border-color: var(--accent-green);
    color: var(--bg-light);
}

.carousel-slide {
    display: none; /* Cache toutes les images par défaut */
}

.carousel-slide.active {
    display: block; /* Affiche uniquement celle qui a la classe active ajoutée par le JS */
}

.archi-schema-v3 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 30px !important;
    background: #fdfdfd !important;
    border: 1px solid #CAD2C5 !important;
    padding: 40px !important;
    border-radius: 12px !important;
    margin: 40px 0 !important;
    font-family: 'Inter', sans-serif !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.archi-schema-v3 h3 {
    margin: 0 !important;
    color: #2F3E46 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 800 !important;
    font-size: 22px !important;
    text-align: center !important;
    margin-bottom: 10px !important;
}

.archi-v3-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    box-sizing: border-box !important;
}

.archi-v3-node {
    background: #2F3E46 !important;
    color: #FFFFFF !important;
    padding: 25px !important;
    border-radius: 8px !important;
    text-align: center !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    min-width: 160px !important;
    position: relative !important;
    transition: transform 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.archi-v3-node:hover {
    transform: translateY(-5px) !important;
    background: #354F52 !important;
}

.archi-v3-node.node-highlight {
    background: #52796F !important;
    color: #FFFFFF !important;
}

.node-icon-v3 {
    font-size: 30px !important;
    display: block !important;
    margin-bottom: 10px !important;
    color: #FFFFFF !important;
}

.node-title-v3 {
    font-weight: 700 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px !important;
    display: block !important;
    margin-bottom: 4px !important;
    color: #FFFFFF !important;
    line-height: 1.2 !important;
}

.node-desc-v3 {
    font-size: 13px !important;
    opacity: 0.9 !important;
    color: #FFFFFF !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.schema-arrow-v3 {
    color: #84A98C !important;
    font-size: 30px !important;
    font-weight: bold !important;
    animation: pulseArrowV3 2s infinite !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 60px !important;
}

@keyframes pulseArrowV3 {
    0% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.5; }
}

/* --- TIMELINE DE MONTAGE --- */
.nle-timeline-v1 {
    background: #1e1e1e !important; /* Gris très sombre façon interface Adobe */
    border-radius: 8px !important;
    padding: 20px 10px 20px 60px !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 40px 0 !important;
    font-family: 'Inter', sans-serif !important;
}

/* La tête de lecture (Ligne rouge animée) */
.nle-playhead {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 2px !important;
    background: #e63946 !important; /* Rouge vif */
    z-index: 10 !important;
    animation: scanTimeline 4s infinite linear !important;
}
.nle-playhead::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -5px !important;
    border-left: 6px solid transparent !important;
    border-right: 6px solid transparent !important;
    border-top: 8px solid #e63946 !important;
}

/* Les pistes (Tracks) */
.nle-track {
    display: flex !important;
    align-items: center !important;
    height: 30px !important;
    margin-bottom: 5px !important;
    background: #2a2a2a !important;
    border-radius: 4px !important;
    position: relative !important;
}
.nle-track::before {
    content: attr(data-track) !important;
    position: absolute !important;
    left: -50px !important;
    color: #888 !important;
    font-size: 11px !important;
    font-weight: bold !important;
}

/* Les clips (Morceaux de vidéo/audio) */
.nle-clip {
    height: 100% !important;
    border-radius: 3px !important;
    border: 1px solid rgba(0,0,0,0.3) !important;
    color: #fff !important;
    font-size: 10px !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 5px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}
.clip-vfx { background: #9d4edd !important; width: 30% !important; margin-left: 10% !important; }
.clip-color { background: #fca311 !important; width: 80% !important; margin-left: 5% !important; }
.clip-vid { background: #457b9d !important; width: 45% !important; margin-right: 2px !important; }
.clip-vid2 { background: #457b9d !important; width: 40% !important; }
.clip-audio { background: #2a9d8f !important; width: 85% !important; margin-left: 5% !important; }

@keyframes scanTimeline {
    0% { left: 60px; }
    100% { left: calc(100% - 20px); }
}