/* ==========================================================================
   PAGE RÉFÉRENCES (Ils nous font confiance)
   ========================================================================== */

.references-page {
    background-color: var(--bg-color);
}

/* --- Hero Section --- */
.references-hero {
    padding: 120px 0 80px 0;
    background-color: var(--bg-color);
}

.references-hero .overline-text {
    display: block;
    font-family: var(--font-family);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 600;
}

.references-hero .elegant-title {
    font-family: var(--font-family); /* Force le Montserrat */
    font-size: 3.5rem; /* Légèrement réduit car Montserrat prend plus de place que Playfair */
    line-height: 1.2;
    font-weight: 700; /* On le met bien en gras pour l'impact */
    margin-bottom: 30px;
}

.text-primary-color {
    color: var(--primary-color);
}

.hero-desc {
    font-family: var(--font-family);
    font-size: 1.15rem;
    color: #555;
    line-height: 1.6;
    max-width: 750px;
    margin: 0 auto;
}

/* --- Alternance des fonds --- */
.bg-white {
    background-color: #ffffff;
}

.bg-grey {
    background-color: #f8f9fa; /* Le gris très clair de ta charte globale */
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
}

/* --- Section des Secteurs --- */
.sector-section {
    padding: 80px 0;
}

.sector-header {
    text-align: center;
    margin-bottom: 60px;
}

.sector-title {
    font-family: var(--font-family); /* Force le Montserrat */
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700; /* En gras pour bien délimiter les sections */
}

.sector-subtitle {
    font-family: var(--font-family);
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

/* --- Grille des Logos --- */
.logos-grid {
    display: grid;
    /* Crée automatiquement autant de colonnes que possible (min 200px de large) */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

/* --- Carte Logo --- */
.logo-card {
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.logo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.08); /* Ombre très légèrement bleutée */
    border-color: #e0e6ed;
}

/* Conteneur de l'image pour forcer des dimensions uniformes */
.logo-wrapper {
    height: 120px; /* Agrandissement pour plus d'espace */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Le Logo 100% couleur */
.company-logo {
    max-width: 95%; /* Élargissement du logo dans sa zone */
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

/* Au survol de la carte, le logo zoome légèrement */
.logo-card:hover .company-logo {
    transform: scale(1.05);
}

/* Nom de l'entreprise */
.company-name {
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    width: 80%;
}

/* --- Réactivité Mobile et Tablette --- */
@media (max-width: 768px) {
    .references-hero {
        padding: 80px 0 50px 0;
    }

    .references-hero .elegant-title {
        font-size: 2.8rem;
    }

    .sector-section {
        padding: 50px 0;
    }

    .sector-title {
        font-size: 2rem;
    }

    .sector-subtitle {
        font-size: 0.85rem;
    }

    /* Sur mobile, on force 2 colonnes pour les logos, c'est plus joli qu'1 seule gigantesque */
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .logo-card {
        padding: 20px 10px;
    }

    .logo-wrapper {
        height: 90px; /* Augmenté proportionnellement pour mobile */
    }
    
    .company-name {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   SECTION TÉMOIGNAGES (Masonry / Fallback avatars)
   ========================================================================== */

.testimonials-section {
    padding: 80px 0;
    background-color: #f4f7f9; 
    border-top: 1px solid #eaeaea;
}

/* --- Grille Masonry --- */
.testimonials-masonry {
    column-count: 2; 
    column-gap: 40px; /* On augmente un peu l'écart pour bien respirer */
    margin-top: 20px;
}

/* --- Carte du témoignage --- */
.testimonial-card {
    box-sizing: border-box; /* ÉVITE LE CHEVAUCHEMENT : inclut le padding dans les 100% de largeur */
    break-inside: avoid; /* Évite qu'une carte ne soit coupée sur deux colonnes */
    -webkit-column-break-inside: avoid; /* Support pour les anciens navigateurs WebKit */
    page-break-inside: avoid;
    
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 35px 30px;
    margin: 0 0 35px 0; /* Remplace le margin-bottom pour plus de sécurité dans les colonnes */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    display: inline-block;
    width: 100%;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.08); 
}

/* --- Contenu & Texte --- */
.quote-icon {
    font-size: 2rem;
    color: var(--primary-color, #003366);
    opacity: 0.15;
    margin-bottom: 15px;
    display: block;
}

.testimonial-content p {
    font-family: var(--font-family);
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 30px;
    font-style: italic;
}

/* --- Footer du témoignage (Avatar + Info + Logo entreprise) --- */
.testimonial-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid #eaeaea;
    padding-top: 25px;
    gap: 15px;
}

/* Avatar et gestion de l'image de secours */
.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color, #003366);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-initials {
    z-index: 1;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background-color: #ffffff;
}

/* Info texte (Nom et Rôle) */
.author-info {
    flex-grow: 1;
}

.author-name {
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px 0;
}

.author-role {
    font-family: var(--font-family);
    font-size: 0.85rem;
    color: #777;
    display: block;
}

/* Logo de l'entreprise dans le footer du témoignage */
.author-company {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    justify-content: flex-end;
}

.testimonial-logo {
    max-width: 100%;
    max-height: 60px; /* Agrandissement de 45px à 60px pour plus de présence */
    object-fit: contain;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablettes & Mobiles)
   ========================================================================== */

/* Grandes tablettes (iPad pro) et petits écrans d'ordinateur */
@media (max-width: 1024px) {
    .testimonials-masonry {
        column-gap: 25px; /* Réduit l'écart entre les colonnes */
    }
    .testimonial-card {
        padding: 25px;
    }
}

/* Tablettes standard et grands téléphones */
@media (max-width: 850px) {
    .testimonials-section {
        padding: 60px 0;
    }
    .testimonials-masonry {
        column-count: 1; /* On passe à 1 seule colonne ! */
        column-gap: 0;
    }
    .testimonial-card {
        margin: 0 0 25px 0; /* Réduit l'espace vertical entre les cartes */
    }
}

/* Petits téléphones mobiles */
@media (max-width: 576px) {
    .testimonial-footer {
        flex-direction: column; /* Aligne l'avatar, le nom et le logo de haut en bas */
        text-align: center;
        gap: 10px;
    }
    .author-company {
        justify-content: center; /* Centre le logo */
        margin-top: 10px;
    }
}