/* ============================================================
   1. VARIABLES & BASE
   ============================================================ */
:root {
    --sage: #949f89;
    --sage-dark: #7a8570;
    --cream: #f1eee6;
    --white: #ffffff;
    --dark-text: #333333;
    --gray-text: #666666;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: 0.3s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--cream);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

section {
    padding: 60px 20px;
    flex: 1;
}

p {
    margin-bottom: 20px;
    color: var(--gray-text);
}

h2 {
    font-size: 1.8rem;
    color: var(--sage);
    text-transform: uppercase;
    border-left: 5px solid var(--sage);
    padding-left: 20px;
    margin-bottom: 30px;
}

h3 {
    color: var(--dark-text);
    margin-bottom: 20px;
}

/* ============================================================
   2. MISE EN PAGE GLOBALE
   ============================================================ */
.page-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--white);
    padding: 60px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   3. NAVIGATION
   ============================================================ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
}

.logo span {
    color: var(--sage);
}

nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--sage);
}

nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--sage);
    transition: 0.3s;
    position: absolute;
    bottom: -5px;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

.nav-cv {
    background: var(--sage);
    color: white !important;
    padding: 8px 15px !important;
    border-radius: 20px;
    font-weight: 600;
    transition: 0.3s ease;
}

.nav-cv:hover {
    background: var(--sage-dark);
    transform: scale(1.05);
}

/* Répétition conservée selon instructions */
nav ul {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

/* ============================================================
   4. BOUTONS & CTA
   ============================================================ */
.btn, .card-link {
    text-decoration: none;
    display: inline-block;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: 2px solid var(--sage);
    cursor: pointer;
    background: transparent;
    color: var(--sage);
}

.card-link {
    margin-top: auto;
    background: var(--white);
}

.btn:hover,
.card-link:hover {
    background: var(--sage);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(148, 159, 137, 0.4);
}

.cta-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ============================================================
   5. GRILLES & CARTES (SERVICES & CONTACT)
   ============================================================ */
.services-grid,
.contact-grid {
    display: grid;
    gap: 20px;
    margin-top: 30px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-card,
.contact-card {
    padding: 30px 20px;
    border-radius: 12px;
    transition: 0.3s;
    background: var(--cream);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover,
.contact-card:hover {
    transform: translateY(-5px);
    background: var(--white);
    box-shadow: var(--shadow);
    border: 1px solid var(--sage);
}

.icon-circle {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--sage);
}

.icon-circle svg {
    width: 28px;
    height: 28px;
}

/* ============================================================
   6. ACCUEIL (HERO)
   ============================================================ */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    margin-bottom: 60px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    text-transform: uppercase;
}

.hero-content .highlight {
    color: var(--sage);
    display: block;
}

.hero-image {
    flex: 0 0 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid var(--cream);
    box-shadow: var(--shadow);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   7. PAGE À PROPOS (SKILLS)
   ============================================================ */
.skill-group {
    margin-bottom: 30px;
}

.skill-group h4 {
    margin-bottom: 15px;
    color: var(--sage-dark);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-item {
    width: 90px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    transition: 0.3s;
}

.skill-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: grayscale(100%);
    opacity: 0.6;
}

.skill-item span {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.skill-item:hover {
    background: var(--cream);
}

.skill-item:hover img {
    filter: none;
    opacity: 1;
}

/* ============================================================
   8. PAGE PROJETS (LISTE)
   ============================================================ */
.projets-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 30px;
}

.projets {
    background: var(--cream);
    padding: 30px;
    border-radius: 12px;
    border-left: 6px solid var(--sage);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.projets-link:hover .projets {
    transform: translateX(10px);
    background: var(--white);
    box-shadow: var(--shadow);
    border-left-color: var(--sage-dark);
}

.projet-img-wrapper {
    flex: 0 0 220px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
}

.projet-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   9. PAGES DÉTAILS SAE (GÉNÉRAL)
   ============================================================ */
.back-link {
    display: inline-block;
    color: var(--sage);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
}

.project-main-image {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.project-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tags span {
    background: var(--cream);
    color: var(--sage-dark);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============================================================
   10. STYLE ISOLÉ : PAGE DÉTAIL SAE (COMPACTE & LARGE)
   ============================================================ */
.projet-detail .back-link {
    display: inline-block;
    margin-bottom: 15px;
}

.projet-detail .project-header {
    margin-bottom: 25px;
    text-align: center;
}

.projet-detail .project-header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
}

.projet-detail .project-subtitle {
    color: var(--sage);
    font-size: 0.9rem;
    letter-spacing: 2px;
    display: inline-block;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--sage);
}

.projet-detail .sae-objective-top {
    margin-bottom: 5px;
}

.projet-detail .separator {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 25px 0;
    width: 100%;
}

.projet-detail .concept-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    align-items: center;
}

.projet-detail .concept-image,
.projet-detail .showcase-imgs {
    background: #f4f4f4;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    width: 100%;
}

.projet-detail .concept-image img,
.projet-detail .showcase-imgs img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
}

.projet-detail .showcase-imgs.double {
    gap: 10px;
}

.projet-detail .showcase-imgs.double img {
    width: 49%;
}

.projet-detail .showcase-gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.projet-detail .showcase-item {
    display: flex;
    align-items: center;
    gap: 35px;
}

.projet-detail .showcase-item.reverse {
    flex-direction: row-reverse;
}

.projet-detail .showcase-imgs {
    flex: 2;
}

.projet-detail .showcase-text {
    flex: 1;
}

.projet-detail .showcase-text h4 {
    color: var(--sage);
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.projet-detail .project-footer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.projet-detail .footer-card {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: 0.4s;
}

.projet-detail .footer-card:hover {
    transform: translateY(-3px);
    border-color: var(--sage);
}

.projet-detail .card-icon {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.projet-detail .footer-card h3 {
    color: var(--sage-dark);
    font-size: 1rem;
    margin-bottom: 5px;
}

.projet-detail .tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.projet-detail .tags span {
    background: var(--sage);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.projet-detail .center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ============================================================
   11. UNIFORMISATION SAE
   ============================================================ */
.projet-detail .concept-image,
.projet-detail .showcase-imgs,
.projet-detail .footer-card {
    background: #f8f8f8;
    border: 1px solid #eeeeee;
    box-shadow: var(--shadow);
    border-radius: 12px;
}

.projet-detail .project-header h1 {
    color: var(--dark-text);
}

.projet-detail .project-subtitle,
.projet-detail .showcase-text h4,
.projet-detail .footer-card h3 {
    color: var(--sage);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.projet-detail .card-icon {
    color: var(--sage);
    filter: sepia(0.2);
}

.projet-detail .tags span {
    background: var(--sage);
    color: #ffffff;
    border: none;
}

.projet-detail .btn {
    background: transparent;
    border: 2px solid var(--sage);
    color: var(--sage);
}

.projet-detail .btn:hover {
    background: var(--sage);
    color: #ffffff;
}

.projet-detail .separator {
    border-top: 1px solid #e5e5e5;
    margin: 30px 0;
}

.projet-detail .showcase-item {
    display: flex;
    align-items: center;
    gap: 40px;
}

.projet-detail .showcase-imgs img {
    max-height: 400px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ============================================================
   12. STYLE SPÉCIFIQUE : SAE 105 (DONNÉES & TABLEAUX)
   ============================================================ */

.sae105-data-container {
    margin-top: 30px;
    overflow-x: auto;
}

.sae105-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.sae105-table th {
    background: var(--sage);
    color: white;
    padding: 15px;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.sae105-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.sae105-table tr:hover {
    background-color: #f9f9f9;
}

/* Blocs de code / scripts */
.sae105-code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 20px 0;
    position: relative;
    border-left: 5px solid var(--sage);
}

/* Grille de statistiques */
.sae105-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    background: var(--cream);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border-bottom: 3px solid var(--sage);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--sage-dark);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--gray-text);
}

/* Badges outils */
.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--sage);
    padding: 8px 15px;
    border-radius: 50px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================================
   13. FIX SPÉCIFIQUE SECTION PARTENAIRES (AGRANDISSEMENT)
   ============================================================ */

/* On force l'empilement vertical pour le titre en haut / images au milieu / texte en bas */
.projet-detail .showcase-item:last-of-type {
    display: flex;
    flex-direction: column !important;
    align-items: center;
    gap: 25px;
}

/* Le conteneur des deux logos */
.projet-detail .showcase-item:last-of-type .showcase-imgs {
    display: flex !important;
    flex-direction: row !important; 
    justify-content: center;
    align-items: center;
    gap: 20px; /* Espace entre les deux logos */
    width: 100% !important;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ON AGRANDIT LES LOGOS ICI */
.projet-detail .showcase-item:last-of-type .showcase-imgs img {
    width: 48% !important; /* Prend presque la moitié de la largeur chacun */
    max-width: 400px;      /* Limite maximale pour ne pas que ça devienne géant sur grand écran */
    height: auto;
    max-height: 450px;     /* Augmenté pour laisser l'image s'épanouir en hauteur */
    object-fit: contain;
}

/* Texte en dessous bien centré */
.projet-detail .showcase-item:last-of-type .showcase-text {
    width: 100% !important;
    text-align: center;
    margin-top: 10px;
}

/* ============================================================
   FIX FINAL SAE 105 : STYLE EXACT SAE 102 (ZÉRO DOUBLE LIGNE)
   ============================================================ */

/* Grille principale */
.project-details-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-top: 50px !important;
    text-align: left !important;
}

/* Cartes blanches avec zoom */
.white-card-effect {
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 15px !important;
    border: 1px solid #eee !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease-in-out !important;
}

.white-card-effect:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 10px 25px rgba(148, 159, 137, 0.2) !important;
    border-color: var(--sage) !important;
}

/* TITRES H3 : Correction définitive de la double ligne */
.details-column h3 {
    color: var(--sage) !important;
    text-transform: uppercase !important;
    font-size: 1rem !important;
    letter-spacing: 1px !important;
    margin-bottom: 10px !important; /* Réduit pour coller au texte en dessous */
    
    /* Nettoyage total des bordures parasites */
    border: none !important; 
    border-bottom: 2px solid var(--sage) !important; 
    
    display: inline-block !important;
    padding: 0 0 5px 0 !important;
}

/* Petit texte de description sous le H3 */
.white-card-effect p {
    font-size: 0.9rem !important;
    color: var(--gray-text) !important;
    margin-bottom: 20px !important;
    line-height: 1.4 !important;
}

/* Les petits OVALES verts (Badges) */
.details-column .tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.details-column .tags span {
    background: var(--sage) !important;
    color: white !important;
    padding: 8px 18px !important;
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}
/* ============================================================
   13. FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 30px;
    background: var(--sage);
    color: var(--white);
    margin-top: auto;
}

footer p {
    color: white;
    margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE UNIFIÉ & CORRECTIF IMAGES (ZÉRO DÉBORDEMENT)
   ============================================================ */

/* --- SÉCURITÉ GLOBALE --- */
* {
    box-sizing: border-box !important;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
}

/* --- ADAPTATION DES IMAGES & VIDÉOS --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* --- TABLETTES ET MOBILES (Moins de 950px) --- */
@media (max-width: 950px) {

    /* Conteneurs principaux */
    .page-container, section, .projets, .hero-section {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Navigation */
    nav {
        flex-direction: column !important;
        text-align: center;
        padding: 15px !important;
    }

    nav ul {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        margin-top: 15px !important;
        list-style: none;
    }

    /* Grilles : On force le passage en colonne */
    .services-grid, 
    .project-details-grid, 
    .contact-grid, 
    .concept-grid,
    .showcase-item,
    .project-grid-info,
    .project-footer-info,
    .icon-grid {
        display: flex !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 25px !important;
    }

    /* --- CORRECTIF PAGE PROJETS (L'image au dessus du texte) --- */
    .projets {
        flex-direction: column !important; /* Empile l'image et le texte */
        height: auto !important;
    }

    .projet-img-wrapper {
        width: 100% !important;
        height: 220px !important; /* Hauteur fixe pour que l'image soit visible */
        flex-basis: auto !important;
    }

    .projet-img-wrapper img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* Remplit tout l'espace sans déformer */
    }

    .projet-content {
        width: 100% !important;
        padding: 20px !important;
    }

    /* Hero Section (Accueil) */
    .hero-section {
        flex-direction: column-reverse !important;
    }

    .hero-image img {
        max-width: 200px !important;
        margin: 0 auto;
    }

    /* SAE 102 (Flyers doubles) */
    .showcase-imgs.double {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .showcase-imgs.double img {
        width: 100% !important;
        max-width: 450px !important;
        margin-bottom: 15px;
    }
}

/* --- PETITS MOBILES (Moins de 500px) --- */
@media (max-width: 500px) {
    h1 { font-size: 1.6rem !important; }
    h2 { font-size: 1.4rem !important; }

    .cta-group {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px;
    }

    .btn {
        width: 100% !important;
        text-align: center;
    }
}