/* --- CONFIGURATION GLOBALE --- */
:root {
    --bg-light: #E8EBE0;
    --bg-alt: #CAD2C5;
    --accent-green: #84A98C;
    --text-mid: #52796F;
    --text-dark: #354F52;
    --text-ultra: #2F3E46;
    --font-title: 'Montserrat', sans-serif;
    --font-main: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-main);
    line-height: 1.6;
}

/* --- BANNIÈRE HERO --- */
.project-header {
    height: 60vh;
    min-height: 400px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 60px;
}

/* Overlay sombre pour lisibilité 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;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.header-category {
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-green);
    display: block;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.header-content h1 {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 5vw, 4rem); /* Taille fluide */
    margin: 0 0 10px;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.header-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.95;
    margin: 0;
    font-family: var(--font-title);
}

/* --- CONTENEUR PRINCIPAL (GRID 3 COLONNES) --- */
.project-container {
    max-width: 1600px; /* Élargi pour faire de la place aux 3 colonnes */
    width: 95%;
    margin: 0 auto 100px;
    padding: 0 30px;
    display: grid;
    /* Colonne 1 (Infos) | Colonne 2 (Contenu) | Colonne 3 (Sommaire) */
    grid-template-columns: 260px 1fr 260px;
    gap: 40px;
    align-items: start;
}

/* --- SIDEBARS (GAUCHE & DROITE) --- */
.project-sidebar {
    grid-column: 1;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.project-sidebar-right {
    grid-column: 3;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    scrollbar-width: none;
}
.project-sidebar-right::-webkit-scrollbar { display: none; }

.project-content {
    grid-column: 2;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* --- SIDEBAR (GAUCHE) --- */
.project-sidebar {
    /* Sticky : reste accroché quand on scrolle */
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-block {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.sidebar-block h3 {
    font-family: var(--font-title);
    color: var(--text-ultra);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-green);
    display: inline-block;
}

/* Listes d'infos (Entreprise, Lieu...) */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
}

.info-list li strong {
    color: var(--text-mid);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

/* Liste des Missions (Tech Stack style) */
.tech-stack {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-stack li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.tech-stack li::before {
    content: '✔'; /* Ou une icône SVG si tu préfères */
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

/* --- CONTENU PRINCIPAL (DROITE) --- */
.project-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.intro-block h2 {
    font-family: var(--font-title);
    color: var(--text-ultra);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.divider {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 40px 0;
}

/* --- CONTENU DYNAMIQUE (HTML ADMIN) --- */
.dynamic-content {
    line-height: 1.8;
    color: var(--text-dark);
}

.dynamic-content h2 { color: var(--text-ultra); font-family: var(--font-title); margin-top: 40px; }
.dynamic-content h3 { color: var(--text-mid); font-family: var(--font-title); margin-top: 30px; }
.dynamic-content p { margin-bottom: 20px; }
.dynamic-content ul { padding-left: 20px; margin-bottom: 20px; }
.dynamic-content li { margin-bottom: 10px; }

/* Images dans le contenu */
.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* --- VIDÉOS / PDF (MÉDIAS) --- */
.media-container {
    margin: 40px 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.video-wrapper iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.pdf-wrapper {
    background: #525659;
    border-radius: 8px;
    overflow: hidden;
}
.pdf-viewer {
    width: 100%;
    height: 600px;
    border: none;
}
.pdf-actions {
    padding: 15px;
    text-align: center;
    background: #fff;
}

/* --- RESPONSIVE MOBILE --- */
/* --- RESPONSIVE MOBILE --- */
@media (max-width: 1300px) {
    .project-container {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile/tablette */
        max-width: 900px;
        gap: 40px;
    }

    .project-sidebar, .project-sidebar-right, .project-content {
        grid-column: auto;
        position: relative;
        top: 0;
        max-height: none;
    }

    /* On force l'ordre d'affichage vertical : 1. Sommaire, 2. Contenu, 3. Infos */
    .project-sidebar-right { order: -2; }
    .project-content { order: -1; padding: 25px; }
    .project-sidebar { order: 0; }

    .project-header {
        height: 50vh;
    }
}

/* --- TOOLTIPS TYPE WIKIPEDIA (Charte Graphique) --- */

/* Le mot souligné */
.wiki-word {
    border-bottom: 2px dotted var(--accent-green); /* Soulignement vert pointillé */
    cursor: help; /* Curseur ? */
    position: relative;
    transition: background 0.3s ease;
    font-weight: 500;
    color: var(--text-dark);
}

.wiki-word:hover {
    background-color: rgba(132, 169, 140, 0.2); /* Surlignage léger au survol */
    color: var(--text-ultra);
}

/* L'infobulle (Cachée par défaut) */
.wiki-popup {
    visibility: hidden;
    opacity: 0;
    width: 280px; /* Largeur confortable */
    background-color: var(--text-ultra); /* Fond très sombre (#2F3E46) */
    color: var(--bg-light); /* Texte clair (#E8EBE0) */
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 100;

    /* Positionnement : Au dessus du mot */
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* Décalage pour l'animation */

    /* Style */
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--accent-green); /* Bordure fine verte */

    /* Animation */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none; /* Pour ne pas gêner la souris */
}

/* La petite flèche en bas de la bulle */
.wiki-popup::after {
    content: "";
    position: absolute;
    top: 100%; /* En bas de 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);
}

/* Si l'écran est petit (Mobile), on s'assure que la bulle ne dépasse pas trop */
@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 (Mise à jour pour le zoom) --- */
.project-header {
    height: 60vh;
    min-height: 400px;
    position: relative; /* Indispensable pour contenir les éléments en absolute */
    overflow: hidden;   /* Pour que l'image zoomée ne dépasse pas */
    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 sans déformation */
    z-index: 0; /* Tout au fond */
}

/* L'overlay sombre */
.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; /* Au-dessus de l'image */
}

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

/* --- DESIGN DU SOMMAIRE (Copie de projet-detail.css) --- */
.toc-container {
    background-color: rgba(255, 255, 255, 0.6);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(132, 169, 140, 0.3);
    box-shadow: 0 10px 30px rgba(82, 121, 111, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.toc-title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-green);
    margin-bottom: 0;
    user-select: none;
}

#toc-list { list-style: none !important; padding: 0; margin: 0; }
#toc-list li { margin-bottom: 0; position: relative; }

#toc-list a {
    text-decoration: none; display: block; padding: 8px 0 8px 15px;
    color: var(--text-mid); font-family: var(--font-main);
    font-size: 15px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#toc-list a:hover {
    color: var(--text-ultra); border-left-color: var(--accent-green);
    padding-left: 20px;
    background: linear-gradient(90deg, rgba(132, 169, 140, 0.1) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
}

#toc-list a.toc-link-huge { font-weight: 700; font-size: 16px; color: var(--text-dark); margin-top: 10px; }
#toc-list a.toc-link-xl { font-weight: 600; font-size: 14px; margin-left: 5px; border-left-width: 2px; }
#toc-list a.toc-link-lg { font-weight: 400; font-size: 13px; margin-left: 15px; color: #84A98C; border-left-width: 1px; }

.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;
}
.toc-header:hover .toc-title { color: var(--text-ultra); }
.toc-icon { font-size: 12px; color: var(--accent-green); transition: transform 0.4s ease; }

.toc-content-wrapper {
    overflow: hidden; max-height: 500px; opacity: 1;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease, margin-top 0.4s ease;
}

.toc-container.is-closed .toc-icon { transform: rotate(-90deg); }
.toc-container.is-closed .toc-content-wrapper { max-height: 0; opacity: 0; margin-top: 0; }
.toc-container.is-closed .toc-header { border-bottom-color: transparent; margin-bottom: 0; }

/* Styles Titres formatés ajoutés de projet.php */
.text-huge { font-family: var(--font-title); font-size: clamp(3rem, 6vw, 5rem); 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; }

/* --- 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;
}

/* ==========================================================================
   EFFETS DE TEXTE CRÉATIFS (Surlignage, Dégradé, Badge, Contour, Citation)
   ========================================================================== */

/* 1. 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 */
}

/* 2. 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, color 0.3s ease;
}

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

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

/* 4. Effet "Badge" : Petite pilule pour mettre en avant un mot court */
.text-badge {
    display: inline-block;
    font-size: 0.6em; /* Plus petit que le texte courant */
    font-family: var(--font-main), serif;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    background-color: var(--accent-green);
    color: var(--bg-light);
    padding: 4px 12px;
    border-radius: 50px; /* Forme de "pilule" */
    vertical-align: middle;
    margin: 0 4px;
    transform: translateY(-2px); /* Alignement optique */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 5. Effet "Citation" : Bloc mis en évidence avec guillemet */
.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 20px 40px; /* Un peu plus d'espace à gauche pour le guillemet */
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    font-family: var(--font-title);
    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);
}

/* Le gros guillemet décoratif de la citation */
.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;
}

/* 6. Classes d'alignement (Utiles si vous utilisez [CENTER:], [RIGHT:], etc.) */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }