@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Dancing+Script:wght@700&display=swap');

html, body {
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: #fff7e6;
    color: #111;
    padding-top: 90px; /* Compense le header fixed ! */
    overflow-x: hidden;
    font-family: 'Montserrat', Arial, sans-serif;
}

/* HEADER */
header {
    background: #b5a491;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0;
    position: relative;
}
.logo {
    height: 90px;
    width: 200px;
    object-fit: contain;
    background: none;
    border: none;
}
.logo-link {
    display: flex;
    align-items: center;
    margin-right: 0;
    padding-left: 2vw; /* espace à gauche */
}

/* NAVBAR */
.navbar {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding-right: 2vw; /* espace à droite */
}
.navbar a, .dropbtn {
    color: #111;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.07rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    transition: background 0.17s, color 0.17s;
    letter-spacing: 0.01em;
    background: none;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', Arial, sans-serif;
}
.navbar a:hover, .dropbtn:hover, .active {
    background: #ceb692;
    color: #111;
}
.dropdown {
    position: relative;
}
.dropdown-content {
    display: block; /* pour permettre le fondu, on contrôle l'affichage avec opacity/visibility */
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background: #b5a491;
    min-width: 140px;
    box-shadow: 0 6px 24px rgba(44,56,107,0.11);
    z-index: 99;
    border-radius: 8px;
    border: 2px solid #ceb692; /* bordure couleur */
    transition: opacity 0.22s ease, visibility 0.22s;
    pointer-events: none;
}
.dropdown-content a {
    color: #111;
    padding: 0.75rem 1rem;
    display: block;
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* BURGER */
.burger {
    display: none;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
}
.burger img {
    width: 36px;
    height: 36px;
}

/* MOBILE MENU (fermé par défaut, fondu rapide) */
.mobile-menu {
    display: flex;
    flex-direction: column;
    background: #b5a491;
    position: absolute;
    top: 90px;
    right: 0;
    left: auto;
    width: 340px;
    max-width: 90vw;
    z-index: 500;
    padding: 1.5rem 0 1.5rem 0;
    box-shadow: 0 12px 24px rgba(44,56,107,0.11);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border: 2px solid #ceb692;
    border-radius: 24px; /* arrondi sur les 4 coins */
    transition: opacity 0.22s ease, visibility 0.22s;
}
.mobile-menu a {
    color: #111;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 0 1rem 6vw;
    transition: background 0.2s, color 0.2s;
}
.mobile-menu a:hover {
    background: #ceb692;
    color: #111;
}
.mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: flex;
}

/* Responsive : adapte la largeur du menu sur petits écrans */
@media (max-width: 500px) {
    .mobile-menu {
        width: 98vw;
        max-width: 98vw;
        right: 0;
        left: auto;
        border-radius: 18px;
    }
}

/* MAIN + CARDS */
main {
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
    /* padding/margin selon ton design */
    max-width: 1235px;
    margin: 6.5rem auto 0 auto;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    margin-bottom: 0; /* Supprime le margin-bottom qui poussait le footer ! */
}
.card, section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(44,56,107,0.08);
    max-width: 1235px;
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    box-sizing: border-box;
    width: 100%; /* Ajouté pour limiter la largeur et éviter le débordement */
}

/* TITRES CENTRES & ESPACÉS */
h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 0.4rem;
    color: #111;
    letter-spacing: 1px;
}

h2 {
    font-family: 'Montserrat', Arial, sans-serif;
    text-align: center;
    font-size: 1.3rem;
    margin-top: 1.1em;
    margin-bottom: 1.1em;
}

/* TITRES DES MISSIONS GAUCHE */
.titre-mission {
    font-family: 'Montserrat', Arial, sans-serif;
    text-align: left !important;
    font-size: 1.18rem;
    margin-top: 1.1em;
    margin-bottom: 0.5em;
    font-weight: 700;
}

/* ESPACES TEXTE */
p, ul, li {
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* SOUS-MENU PROJETS */
.submenu {
    display: flex;
    justify-content: center;
    gap: 3vw;
    margin-bottom: 2rem;
}
.btn-projet {
    flex: 1 1 0;
    background: #ceb692;
    color: #111;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 40px;
    padding: 1.2rem 0;
    text-align: center;
    margin: 0 1rem;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    border: none;
    box-shadow: 0 2px 8px rgba(44,56,107,0.11);
    cursor: pointer;
    text-decoration: none;
}
.btn-projet.active, .btn-projet:hover {
    background: #b5a491;
    color: #fff;
    border: 2px solid #ceb692;
}
.btn-projet.ecole {
    background: #fff7e6;
    color: #111;
    border: 2px solid #ceb692;
}
.btn-projet.ecole.active, .btn-projet.ecole:hover {
    background: #b5a491;
    color: #fff;
    border: 2px solid #ceb692;
}
.btn-projet.entreprise {
    background: #fff7e6;
    color: #111;
    border: 2px solid #ceb692;
}
.btn-projet.entreprise.active, .btn-projet.entreprise:hover {
    background: #b5a491;
    color: #fff;
    border: 2px solid #ceb692;
}

/* Ligne séparatrice sous les boutons projets */
.projets-separator {
    width: 100%;
    height: 0;
    border: none;
    border-top: 3px solid #ceb692;
    margin: 0 0 2.5rem 0;
    box-shadow: 0 2px 8px rgba(44,56,107,0.10);
    background: transparent;
}

/* ABOUT SECTION */
.about-flex {
    display: flex;
    align-items: center; /* centre verticalement */
    gap: 2.5rem;
}
.about-text {
    flex: 2 1 0;
    min-width: 0;
}
.about-img {
    flex: 1 1 260px;
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: center;     /* centre verticalement */
}
.about-img img {
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid #ceb692;
    box-shadow: 0 6px 24px rgba(44,56,107,0.11);
    background: #fff7e6;
    object-fit: cover;
}

/* Responsive : pile le texte et l'image en colonne sur mobile */
@media (max-width: 700px) {
    .about-flex {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    .about-img {
        justify-content: center;
        margin-bottom: 1.5rem;
        align-items: center;
    }
    .about-img img {
        max-width: 240px;
    }
}

/* FOOTER */
footer {
    background: #b5a491;
    color: #111;
    text-align: center;
    padding: 1.2rem 0;
    font-size: 1rem;
    margin-top: auto; /* Le point clé ! */
    margin-bottom: 0;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 -2px 8px rgba(44,56,107,0.03);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

footer p {
    margin: 0;
    text-align: center !important;
}

.contact a {
    color: #ceb692;
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 1250px) {
    .navbar { display: none; }
    .burger { display: block; }
}

@media (max-width: 1100px) {
    .navbar { display: none; }
    .burger { display: block; }
    body {
        padding-top: 64px; /* hauteur du header en mobile/tablette */
    }
    header {
        min-height: 64px;
    }
    .logo { 
        height: 72px; 
        width: 160px;
        display: block;
        margin-top: 0;
        margin-bottom: 0;
    }
    .burger img { width: 36px; height: 36px; }
    .burger { margin-left: 1vw; }
    .nav-container { padding: 0.25rem 0;}
    .logo-link { padding-left: 3vw; }
    .navbar { padding-right: 3vw; }
    .mobile-menu { top: 58px; }
    .submenu { flex-direction: column; gap: 1.5rem; }
    .btn-projet { margin: 0.3rem 0; font-size: 1rem; }
    .card, section { padding: 1.2rem 0.5rem; }
    main { padding: 0.5rem 0; }
    .about-img img { max-width: 200px; }
}

/* Unifie la taille du header pour <=1000px et <=800px */
@media (max-width: 1000px), (max-width: 800px) {
    body {
        padding-top: 64px;
    }
    header {
        min-height: 64px;
    }
    .logo { 
        height: 72px; 
        width: 160px;
    }
    .burger img { width: 36px; height: 36px; }
    .mobile-menu { top: 58px; }
}

@media (max-width: 950px) {
    .nav-container, main { max-width: 98vw; }
    main, .card, section {
        max-width: 98vw;
    }
}

/* (L'ancien breakpoint 1000px et 800px peuvent être supprimés ou conservés pour affiner si besoin) */
@media (max-width: 800px) {
    .navbar { display: none; }
    .burger { display: block; }
    .logo { 
        height: 100px; 
        width: 222px;
        display: block;
        margin-top: 0;
        margin-bottom: 0;
    }
    .burger img { width: 48px; height: 48px; }
    .burger { margin-left: 1vw; }
    .nav-container { padding: 0.4rem 0;}
    .logo-link { padding-left: 3vw; }
    .navbar { padding-right: 3vw; }
    .mobile-menu { top: 65px; }
    .submenu { flex-direction: column; gap: 1.5rem; }
    .btn-projet { margin: 0.3rem 0; font-size: 1rem; }
    .card, section { padding: 1.2rem 0.5rem; }
    main { padding: 0.5rem 0; }
}

/* ACCORDION PROJETS */
.accordion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.accordion-item {
    border-radius: 10px;
    border: 2px solid #ceb692;
    margin-bottom: 1.2rem;
    background: #fff7e6;
    box-shadow: 0 2px 8px rgba(44,56,107,0.06);
    overflow: hidden;
    transition: box-shadow 0.18s;
}
.accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    padding: 1.1rem 1.2rem;
    font-size: 1.13rem;
    font-family: inherit;
    font-weight: 700;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
}
.accordion-toggle:hover, .accordion-item.open .accordion-toggle {
    background: #ceb692;
    color: #fff;
}
.accordion-arrow {
    font-size: 1.2em;
    transition: transform 0.22s;
}
.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}
.accordion-content {
    padding: 0 1.2rem 0 1.2rem;
    font-size: 1.08rem;
    color: #222;
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1);
    opacity: 0;
    pointer-events: none;
}
.accordion-item.open .accordion-content {
    padding-bottom: 1.2rem;
    opacity: 1;
    pointer-events: auto;
    /* max-height set inline by JS */
}
.timeline {
    position: relative;
    padding-left: 40px;
    background: #fff;
    box-sizing: border-box;
    width: 100%;
    max-width: 1235px;
    margin-left: auto;
    margin-right: auto;
}

.timeline-container {
    position: relative;
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    min-height: 60px;
    display: flex;
    align-items: flex-start;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background: #ceb692;
    border-radius: 50%;
    border: 3px solid #b5a491;
    position: absolute;
    left: -40px;
    top: 8px;
    z-index: 2;
}

.timeline-date {
    font-weight: bold;
    color: #b5a491;
    min-width: 90px;
    margin-right: 1.3rem;
    font-size: 1.07rem;
}

.timeline-content {
    background: #fff7e6;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    box-shadow: 0 2px 8px rgba(44,56,107,0.06);
    color: #222;
    font-size: 1.08rem;
    flex: 1;
}

.timeline-details {
    display: block;
    margin-top: 0.2em;
    font-weight: 400;
    font-size: 1.04em;
    line-height: 1.5;
}

.timeline-container::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 0;
    width: 4px;
    height: 100%;
    background: #ceb692;
    border-radius: 2px;
    z-index: 1;
}

@media (max-width: 700px) {
    .timeline {
        padding-left: 20px;
    }
    .timeline-dot {
        left: -24px;
        width: 12px;
        height: 12px;
    }
    .timeline-container::before {
        left: -18px;
        width: 2px;
    }
    .timeline-date {
        min-width: 65px;
        font-size: 1rem;
        margin-right: 0.7rem;
    }
    .timeline-content {
        font-size: 1rem;
        padding: 0.7rem 0.8rem;
    }
}

/* PROJETS GRID */
.projets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cases par ligne */
    gap: 3rem 4vw; /* plus d'espace entre les cases */
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    justify-items: center;
    align-items: start;
    justify-content: center;
}

.projet-card,
.projet-card-link {
    background: #fff7e6;
    border: 2px solid #ceb692;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(44,56,107,0.10);
    padding: 2.2rem 2.2rem 1.5rem 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* centre verticalement le contenu, y compris le logo */
    min-width: 400px;
    max-width: 600px;
    min-height: 260px;
    height: 260px; /* hauteur fixe pour uniformiser toutes les cases */
    margin: 0;
    transition: box-shadow 0.18s, background 0.18s, border-color 0.18s;
    text-decoration: none;
    cursor: pointer;
}

.projet-card-link:hover,
.projet-card-link:focus {
    background: #ceb692;
    border-color: #b5a491;
    color: #fff;
    box-shadow: 0 4px 16px rgba(44,56,107,0.13);
}

.projet-titre {
    font-family: inherit;
    font-weight: 700;
    font-size: 1.4rem; /* police un peu plus grande */
    text-align: center;
    color: #111;
    margin: 0 0 2rem 0; /* marge basse augmentée pour descendre le titre */
    padding: 0 0.5rem;
    word-break: break-word;
}

.projet-logo {
    flex: 1 1 auto; /* occupe tout l'espace vertical disponible */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;   /* hauteur mini de la zone logo */
    width: 100%;
    margin-bottom: 1.1rem;
}

.projet-logo img {
    max-width: 120px;    /* taille max encore réduite */
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.projet-desc {
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1.08rem;
    color: #222;
    text-align: center;
    margin-top: auto;
    margin-bottom: 0.2rem;
    width: 100%;
    padding: 0 0.7rem;
    box-sizing: border-box;
    background: transparent;
    letter-spacing: 0.01em;
}

/* Responsive */
@media (max-width: 950px) {
    .projets-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        justify-content: center;
    }
    .projet-card,
    .projet-card-link {
        max-width: 98vw;
        min-width: 0;
        padding: 1.5rem 1rem 1rem 1rem;
    }
}
@media (max-width: 700px) {
    .projets-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        justify-content: center;
    }
    .projet-card,
    .projet-card-link {
        max-width: 100%;
        aspect-ratio: 1 / 1;
        padding: 0.7rem 0.3rem;
    }
}
    .projet-card {
        max-width: 180px;
        padding: 0.7rem 0.4rem;
    }
    /* On retire la taille forcée pour laisser la taille max s'appliquer */

@media (max-width: 700px) {
    .projets-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        justify-content: center;
    }
    .projet-card {
        max-width: 100%;
        aspect-ratio: 1 / 1;
        padding: 0.7rem 0.3rem;
    }
    /* On retire la taille forcée pour laisser la taille max s'appliquer */
}

.projet-titre {
    /* Remet la police et couleur par défaut */
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    text-align: center;
    color: #111;
}
