/* Variables globales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --bg-color: #ecf0f1;
    --text-color: #fff;
    --font-family: 'Arial', sans-serif;
}

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

/* Corps */
body {
    font-family: var(--font-family);
    color: var(--primary-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    padding-top: 100px; /* Ajoute un espace sous le menu pour éviter le chevauchement */
}

/* Menu avec bordure inférieure et texte en noir */
.main-header {
    background: rgba(255, 255, 255, 0.9); /* Fond légèrement transparent */
    color: #000; /* Texte en noir */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: fixed; /* Fixe le menu en haut de la page */
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1); /* Bordure inférieure subtile */
}

/* Logo */
.logo img {
    height: 60px;
}

/* Navigation */
nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem; /* Réduction de l’espace entre les liens */
    padding: 0;
}

/* Liens de navigation avec texte en noir */
.nav-links li a {
    color: #000; /* Texte en noir */
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.3s, color 0.3s;
}

.nav-links li a:hover {
    background: var(--secondary-color);
    color: #fff;
}

/* Sous-menu */
.nav-links li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.7); /* Fond semi-transparent pour sous-menu */
    padding: 0.5rem 0;
    border-radius: 8px;
    list-style: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-links li ul li a {
    color: var(--text-color);
    padding: 0.5rem 1rem;
    display: block;
    transition: background 0.3s;
}

.nav-links li ul li a:hover {
    background: var(--secondary-color);
    color: #fff;
}

/* Affichage du sous-menu au survol */
.nav-links li:hover ul {
    display: block;
}

/* Menu hamburger */
.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger-menu span {
    background: var(--primary-color);
    height: 3px;
    width: 25px;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9); /* Fond semi-transparent pour mobile */
        padding: 1rem 0;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
    }
}

/* Section Héros */
#hero {
    background: url('images/FondAccueil.JPG') no-repeat center center/cover;
    height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-align: center;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.5); /* Fond semi-transparent pour lisibilité */
    padding: 2rem;
    border-radius: 8px;
}

.hero-overlay h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-overlay p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-color);
}

/* Section Mosaïque de logos */
#logos {
    padding: 3rem 1rem; /* Réduction modérée du padding supérieur */
    text-align: center;
    background: var(--bg-color);
    margin-top: -0.5rem; /* Réduction subtile de l’espace entre la photo et les logos */
}

.logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly; /* Même espace entre les logos et aux bords */
    align-items: center;
    row-gap: 2rem; /* espace vertical entre les lignes si ça revient à la ligne */
    max-width: 100%;
    margin: 0 auto;
}

.logo-grid img {
    width: min(18vw, 140px); /* s'adapte à la largeur d'écran mais reste limité sur grand écran */
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Adaptation spécifique pour les petits écrans */
@media (max-width: 600px) {
    .logo-grid img {
        width: 22vw;   /* un peu plus petit pour tenir confortablement sur mobile */
        max-width: 90px;
    }
}

/* Section résultats */
#results {
    padding: 4rem 1rem;
    text-align: center;
    background: var(--bg-color);
}

/* Titre de la page de résultats en orange */
.results-content h1 {
    color: #e67e22; /* Orange */
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Texte lisible */
.results-content p {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Conteneur de la barre de progression */
.progress-bar-container {
    width: 100%;
    max-width: 600px;
    height: 30px;
    background: #ddd;
    border-radius: 15px;
    margin: 0 auto 2rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Barre de progression */
.progress-bar {
    width: 0;
    height: 100%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    border-radius: 15px;
    transition: width 0.1s ease-in-out; /* Transition fluide */
}

/* Grille de photos avec 3 colonnes */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes fixes */
    gap: 1rem;
    padding: 1rem;
}

/* Conteneur des images avec taille automatique */
.photo-grid img {
    width: 100%;
    height: auto; /* Ajustement automatique de la hauteur */
    object-fit: contain; /* Ajuste l'image sans découpe ni déformation */
    background-color: #f8f8f8; /* Fond neutre autour des images */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 5px;
    transition: transform 0.3s;
}

.photo-grid img:hover {
    transform: scale(1.05); /* Effet de zoom au survol */
}

/* Modale en pleine page */
.modal {
    display: none; /* Masquée par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fond noir semi-transparent */
    justify-content: center;
    align-items: center;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Bouton de fermeture */
.modal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
}

.modal .close:hover {
    color: #bbb;
}

/* Section À propos */
#about {
    text-align: center;
    background: var(--bg-color);
    color: var(--primary-color);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.about-content p {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Image de la carte */
.about-image {
    width: 100%;
    max-width: 800px; /* Limite la taille maximale de la carte */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

/* Section Contact */
#contact {
    padding: 4rem 1rem;
    text-align: center;
    background: var(--bg-color);
    color: var(--primary-color);
}

.contact-content {
    max-width: 900px;
    margin: 0 auto;
}

.contact-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Formulaire moderne */
.contact-form {
    display: grid;
    gap: 2rem;
    text-align: left;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin: 0 auto;
}

/* Champs de formulaire */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.1rem;
    width: 100%;
    background: #f9f9f9;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Bouton stylisé */
.contact-form button {
    padding: 1rem 2rem;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.contact-form button:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* Pied de page */
.main-footer {
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}


/* === Ajouts pour corriger l'affichage mobile === */

@media (max-width: 768px) {
    /* Corrige le bouton sur mobile */
    .btn-primary {
        display: inline-block;
        width: 90%;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    /* Empêche les logos de déborder */
    .logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly; /* Même espace entre les logos et aux bords */
    align-items: center;
    row-gap: 2rem; /* espace vertical entre les lignes si ça revient à la ligne */
    max-width: 100%;
    margin: 0 auto;
}

    .logo-grid img {
    width: min(18vw, 140px); /* s'adapte à la largeur d'écran mais reste limité sur grand écran */
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Adaptation spécifique pour les petits écrans */
@media (max-width: 600px) {
    .logo-grid img {
        width: 22vw;   /* un peu plus petit pour tenir confortablement sur mobile */
        max-width: 90px;
    }
}
}



/* Corrige l'affichage des sous-menus sur mobile */
@media (max-width: 768px) {
    .nav-links li {
        position: relative;
    }

    .nav-links li ul {
        display: none;
        position: relative;
        background: rgba(255, 255, 255, 0.95);
        padding-left: 1rem;
        box-shadow: none;
        border-radius: 0;
    }

    .nav-links li.show-submenu ul {
        display: block;
    }

    .nav-links li ul li a {
        color: #000;
    }
}



/* Ajoute une couleur de fond aux liens du menu sur mobile */
@media (max-width: 768px) {
    .nav-links li a {
        background-color: #ffffff;
        color: #000000;
        border-bottom: 1px solid #ddd;
        padding: 1rem;
    }

    .nav-links li a:hover {
        background-color: #f0f0f0;
    }
}



/* Style amélioré du menu déroulant sur mobile */
@media (max-width: 768px) {
    .nav-links li a {
        background-color: #ffffff;
        color: #2c3e50;
        border-bottom: 1px solid #e0e0e0;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 600;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .nav-links li a:hover {
        background-color: #3498db;
        color: #ffffff;
    }

    .nav-links {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 10px 10px;
    }

    .hamburger-menu span {
        background: #3498db;
    }
}


/* Liens du bas de page */
.legal-links {
    margin-top: 1rem;
}

.legal-links a {
    color: #000;
    text-decoration: none;
    margin: 0 0.5rem;
}

.legal-links a:hover {
    text-decoration: underline;
}

/* === site-core (externalized) === */
:root{ --container-max: 1200px; --pad: clamp(12px,3vw,24px); }
/* Header 110px site-wide */
header, .site-header, .main-header, header.navbar, .navbar, .navbar-default{
  height:110px !important; min-height:110px !important;
}
header .inner, header .container, header .container-fluid,
.site-header .container, .navbar .container, .main-header .container{
  display:flex !important; align-items:center !important;
}
/* Home: logos pyramid — centered with wider spacing */
#logos .logo-pyramid{ display:grid; grid-template-rows:auto auto; row-gap:18px; width:fit-content; margin:0 auto; }
#logos .logo-pyramid .row{ display:grid; grid-auto-flow:column; grid-auto-columns:max-content;
  justify-content:center; align-items:center; column-gap: clamp(36px,5.5vw,96px); }
#logos .logo-pyramid img{ width:120px; height:120px; object-fit:contain; border-radius:50%; }
@media (max-width:1024px){ #logos .logo-pyramid img{ width:100px; height:100px; } }
@media (max-width:768px){
  #logos .logo-pyramid .row{ column-gap:18px; }
  #logos .logo-pyramid img{ width:88px; height:88px; }
}
/* About: container, title, and map use the same width and centering */
#about-clean{ display:block !important; margin:0 auto; padding:clamp(16px,2.5vh,28px) var(--pad); max-width:var(--container-max); }
#about-title{
  color:#2563eb !important; text-align:center !important; font-weight:800 !important;
  font-size: clamp(40px,4.2vw,64px) !important; line-height:1.15 !important; margin:0 0 clamp(14px,2vh,20px) 0 !important;
}
#clients-map{
  width:100% !important; max-width:var(--container-max) !important; margin:0 auto !important;
  height: min(60vh, 560px) !important; min-height:360px !important; border-radius:14px;
}
@media (max-width:1024px){ :root{ --container-max: 92vw; } }
@media (max-width:768px){ #clients-map{ height:min(58vh,420px) !important; } }
/* === /site-core === */


/* === fix: strong centering for home logos === */
section#logos, #logos{ display:block; }
#logos .logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly; /* Même espace entre les logos et aux bords */
    align-items: center;
    row-gap: 2rem; /* espace vertical entre les lignes si ça revient à la ligne */
    max-width: 100%;
    margin: 0 auto;
}
#logos .logo-pyramid{ width:fit-content !important; margin-left:auto !important; margin-right:auto !important; }
#logos .logo-pyramid .row{
  display:grid !important;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: center !important;
  align-items: center !important;
}
/* === /fix === */


/* === fix: precise centering for About title === */
#about-clean{ text-align: initial; } /* keep default for section */
#about-title{
  display: table !important;          /* shrink to text width */
  margin-left: auto !important;
  margin-right: auto !important;      /* centers precisely */
  padding-inline: 0 !important;
  text-align: center !important;
}
/* === /fix === */


/* === About vertical centering for title between header and map === */
:root{ --header-h: 110px; --map-h: clamp(360px, 60vh, 560px); }
#clients-map{ height: var(--map-h) !important; min-height: 360px !important; }
#about-clean{
  /* push the title down so it sits roughly midway between header and map */
  padding-top: max(12px, calc((100vh - var(--header-h) - var(--map-h) - 64px) / 2)) !important;
}
@media (max-width: 768px){
  :root{ --map-h: clamp(320px, 58vh, 420px); }
  #about-clean{ padding-top: max(8px, calc((100vh - var(--header-h) - var(--map-h) - 48px) / 2)) !important; }
}
/* === /About vertical centering === */


/* === About: equal vertical centering of title between header and map (grid spacers) === */
:root{ --header-h: 110px; --map-h: clamp(360px, 60vh, 560px); }
#clients-map{ height: var(--map-h) !important; min-height: 360px !important; }

#about-clean{
  display: grid !important;
  grid-template-rows: 1fr auto 1fr auto; /* spacer / title / spacer / map */
  padding-top: 40px !important;
  padding-bottom: clamp(8px, 1.5vh, 16px) !important;
}

#about-clean::before, #about-clean::after{ content:""; }

#about-title{ 
  grid-row: 2;
  margin: 0 auto 0 auto !important; 
}

#clients-map{ grid-row: 4; }
/* On small screens, reduce min-height so the layout remains breathable */
@media (max-width: 768px){
  :root{ --map-h: clamp(320px, 58vh, 420px); }
  #about-clean{ min-height: calc(100vh - var(--header-h) - 10px); }
}
/* === /About grid centering === */

/* Carte clients — logos non déformés */
.client-logo-icon { background: transparent !important; border: 0 !important; }
.client-logo-icon img { display:block; height:65px; width:auto; object-fit:contain; }
@media (max-width:768px){ .client-logo-icon img { height:42px; } }
