/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Open+Sans:wght@400;600&display=swap');

:root {
    --primary-red: #E30613;
    --deep-black: #1A1A1A;
    --white: #FFFFFF;
    --glass-white: rgba(255, 255, 255, 0.97);
    --font-titles: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--deep-black);
    line-height: 1.6;
    
    /* --- CONFIGURATION DU FOND D'ÉCRAN --- */
    background-image: url('../images/backgrounds/taches-peinture.webp');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

h1, h2, h3 { font-family: var(--font-titles); text-transform: uppercase; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; width: 100%; }

/* ==========================================================================
   2. NAVIGATION
   ========================================================================== */
.main-header {
    background: var(--white);
    border-bottom: 4px solid var(--primary-red);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: padding 0.3s;
}

.header-scrolled { padding: 0.4rem 0; background: rgba(255, 255, 255, 0.98); }

.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo strong { color: var(--primary-red); font-weight: 900; }
.nav-menu ul { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-menu a { font-weight: 600; font-size: 0.95rem; }
.nav-menu a:hover, .nav-menu a.active { color: var(--primary-red); }

.burger-menu { display: none; cursor: pointer; background: none; border: none; }
.burger-menu span { display: block; width: 25px; height: 3px; background: var(--deep-black); margin: 5px 0; }

/* ==========================================================================
   3. SECTIONS ACCUEIL (HERO & GRILLES)
   ========================================================================== */
.hero { padding: 100px 5%; background: var(--deep-black); color: var(--white); text-align: center; }
.hero-cta { display: flex; justify-content: center; gap: 20px; margin-top: 30px; }

/* MISE À JOUR : Cadre autour des titres de section sur l'accueil */
/* ==========================================================================
   MISE À JOUR : TITRES AVEC EFFET DE TRANSPARENCE DOUCE
   ========================================================================== */
.section-title { 
    text-align: center; 
    margin: 80px auto 50px; 
    position: relative;
    padding: 20px 60px;
    z-index: 1;
}

/* Le voile de lisibilité derrière le texte */
.section-title::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%; /* Plus large que le texte pour un effet diffus */
    height: 140%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%
    );
    z-index: -1;
    filter: blur(10px); /* Adoucit les bords */
}

/* Petit détail : une fine ligne rouge sous le titre pour assoir le texte */
.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-red);
    margin: 10px auto 0;
}

.about-brief {
    background: var(--glass-white); padding: 4rem; margin: 40px auto;
    border-radius: 0; /* Angles carrés */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: left;
}
.about-brief h2 { text-align: center; margin-bottom: 20px; }

/* Grille Services de l'Accueil - MISE À JOUR : ALIGNEMENT SUR 3 COLONNES */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Aligne les 3 services sur une ligne */
    gap: 2rem;
    padding-bottom: 60px;
}

.service-card {
    background: var(--white); overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); transition: 0.3s;
    opacity: 0; transform: translateY(20px); 
    border: 4px solid transparent; 
    border-radius: 0; /* Angles carrés */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card img { width: 100%; height: 230px; object-fit: cover; display: block; }

.service-content { 
    padding: 1.5rem; 
    text-align: left; 
    flex-grow: 1; /* Permet au contenu de s'étirer */
    display: flex;
    flex-direction: column;
}

.service-content p { margin-bottom: 20px; }

.link-more {
    margin-top: auto; /* Aligne le bouton en bas de la carte */
    font-weight: 700;
    color: var(--primary-red);
}

/* Effet survol Accueil - Bordure + Ombre Rouge */
.service-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--primary-red); 
    box-shadow: 0 15px 30px rgba(227, 6, 19, 0.2);
}

/* ==========================================================================
   4. PAGES DÉTAILS (SERVICES & RÉALISATIONS)
   ========================================================================== */
.page-header { background: var(--deep-black); color: white; padding: 60px 0; text-align: center; margin-bottom: 30px; }

/* Liste Services (Page Services) */
.service-detail-item {
    display: flex; align-items: center; gap: 50px;
    background: var(--glass-white); padding: 40px; margin: 40px 0;
    border-radius: 0; /* Angles carrés */
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    opacity: 0; transform: translateY(20px);
    border: 4px solid transparent; 
    transition: 0.3s;
}
.service-detail-item.reverse { flex-direction: row-reverse; }

/* Effet survol Blocs Détails Services - Bordure + Ombre */
.service-detail-item:hover {
    border-color: var(--primary-red);
    box-shadow: 0 10px 40px rgba(227, 6, 19, 0.15);
}

.service-detail-img { flex: 1; height: 400px; overflow: hidden; border-radius: 0; cursor: pointer; border: 4px solid transparent; transition: 0.3s; }
.service-detail-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.service-detail-img:hover img { transform: scale(1.02); }
.service-detail-img:hover { border-color: var(--primary-red); }

.service-detail-content { flex: 1; text-align: left; }
.technical-list { list-style: none; margin: 20px 0; }
.technical-list li { margin-bottom: 8px; padding-left: 25px; position: relative; }
.technical-list li::before { content: "✔"; color: var(--primary-red); position: absolute; left: 0; font-weight: bold; }
.red-bar { width: 60px; height: 4px; background: var(--primary-red); margin: 15px 0; }

/* Grille Réalisations (Page Réalisations) */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; padding: 40px 0; }
.project-card { 
    background: var(--white); border-radius: 0; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    opacity: 0; transform: translateY(20px); 
    border: 4px solid transparent; 
    transition: 0.3s;
}

/* Effet survol Réalisations / Derniers travaux - Bordure + Ombre */
.project-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(227, 6, 19, 0.2);
}

.project-img-wrapper { width: 100%; height: 300px; overflow: hidden; cursor: pointer; border-bottom: 4px solid transparent; transition: 0.3s; }
.project-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.project-img-wrapper:hover img { transform: scale(1.02); }
.project-img-wrapper:hover { border-color: var(--primary-red); }
.project-info { padding: 20px; text-align: left; }

/* ==========================================================================
   5. CONTACT & FORMULAIRES
   ========================================================================== */
.contact-grid { 
    display: grid; 
    grid-template-columns: 1fr 1.5fr; 
    gap: 30px; 
    padding: 40px 0; 
}

.info-card { 
    background: var(--deep-black); 
    color: var(--white); 
    padding: 3rem; 
    border-left: 6px solid var(--primary-red); 
    height: fit-content;
    border-radius: 0; /* Angles carrés */
}

.main-form { 
    background: var(--glass-white); 
    padding: 3rem; 
    border-radius: 0; /* Angles carrés */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 0; /* Angles carrés */
    font-family: var(--font-body);
}

/* Animation d'apparition globale */
.fade-in-visible { opacity: 1 !important; transform: translateY(0) !important; }

/* ==========================================================================
   6. LIGHTBOX & BOUTONS
   ========================================================================== */
.btn-red { background: var(--primary-red); color: white !important; padding: 12px 24px; font-weight: 700; border: none; display: inline-block; cursor: pointer; border-radius: 0; }
.btn-outline { border: 2px solid var(--white); color: white; padding: 10px 20px; font-weight: 700; display: inline-block; border-radius: 0; }
.btn-red-outline { border: 2px solid var(--primary-red); color: var(--primary-red); padding: 10px 20px; font-weight: 700; display: inline-block; margin-top: 15px; border-radius: 0; }

.lightbox {
    display: none; position: fixed; z-index: 2000; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); justify-content: center; align-items: center;
}
.lightbox.active { display: flex; }
.lightbox-content { max-width: 90%; max-height: 85%; border: 3px solid white; box-shadow: 0 0 20px var(--primary-red); border-radius: 0; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 40px; cursor: pointer; }

/* ==========================================================================
   7. RESPONSIVE (MOBILE)
   ========================================================================== */
@media (max-width: 992px) {
    .burger-menu { display: block; }
    .nav-menu {
        position: fixed; top: 75px; left: -100%; width: 100%; height: calc(100vh - 75px);
        background: var(--white); transition: 0.4s; z-index: 999; overflow-y: auto;
    }
    .nav-menu.active { left: 0; }
    .nav-menu ul { flex-direction: column; padding: 40px 5%; gap: 1.5rem; }

    .hero-cta { flex-direction: column; }
    .contact-grid { grid-template-columns: 1fr; } 
    .about-brief { padding: 2rem; }
    .services-grid { grid-template-columns: 1fr; } /* Repasse sur une colonne sur mobile */
    
    .service-detail-item, .service-detail-item.reverse { flex-direction: column; padding: 20px; }
    .service-detail-img { width: 100%; height: 250px; }
}

/* ==========================================================================
   8. PIED DE PAGE (FOOTER)
   ========================================================================== */
.main-footer {
    background-color: var(--deep-black);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 50px;
    border-top: 6px solid var(--primary-red);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--primary-red);
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    display: inline-block;
}

.footer-desc { color: #ccc; font-size: 0.9rem; line-height: 1.6; }
.footer-links, .contact-infos { list-style: none; }
.footer-links li, .contact-infos li { margin-bottom: 10px; }
.footer-links a { color: #ccc; transition: 0.3s; }
.footer-links a:hover { color: var(--primary-red); padding-left: 5px; }

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.legal-link { color: #888; text-decoration: underline; }
.legal-link:hover { color: var(--white); }

@media (max-width: 768px) {
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* --- Mode Avant/Après --- */
.comparison-container {
    display: flex;
    height: 100%;
    width: 100%;
}

.comparison-side {
    position: relative;
    flex: 1;
    overflow: hidden;
    border-right: 2px solid var(--white);
}

.comparison-side:last-child {
    border-right: none;
}

.comparison-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.5s ease !important; /* Pour éviter les conflits d'animation */
}

/* Étiquettes sur les photos */
.label-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 10px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    z-index: 10;
}

.label-tag.after {
    left: auto;
    right: 10px;
    background: var(--primary-red);
}

/* On s'assure que le survol fonctionne toujours sur les deux côtés */
.comparison-side:hover img {
    transform: scale(1.05);
}


/* --- Conteneur du bouton en bas de l'accueil avec effet halo --- */
.view-all-projects-container {
    text-align: center;
    margin-top: 50px;
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

/* Le halo de lumière identique aux titres */
.view-all-projects-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px; /* Largeur du halo */
    height: 180%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%
    );
    z-index: -1;
    filter: blur(15px);
}

/* Style du bouton noir pour un contraste maximal */
.btn-dark {
    background-color: var(--deep-black);
    color: var(--white) !important;
    padding: 14px 30px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    border: none;
    transition: all 0.3s ease;
}

.btn-dark:hover {
    background-color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}