/* Styles globaux du site */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
}

body {
    color: var(--text-color);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

section {
    scroll-margin-top: 80px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
}
/*
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin-top: 0.5rem;
}*/

/* Styles communs */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--dark-bg); border-color: var(--dark-bg); }

/* Utilitaires */
.shadow-hover {
    transition: box-shadow 0.3s ease;
}
.maincontent{
    margin-top: 10%;
}
.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeIn 0.6s ease forwards;
    }

    @keyframes fadeIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* PLACEHOLDERS — empêche tout débordement sur les sections suivantes */
.placeholder-box {
    position: relative;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    overflow: hidden;
    isolation: isolate; /* <<< crée un stacking context indépendant */
}

    .placeholder-box::before,
    .placeholder-box::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(45deg, transparent 49%, #ced4da 50%, transparent 51%);
        opacity: .5;
        pointer-events: none;
        z-index: 0; /* <<< sous le contenu */
    }

    .placeholder-box::after {
        background: linear-gradient(-45deg, transparent 49%, #ced4da 50%, transparent 51%);
    }

.placeholder-label {
    position: absolute;
    left: .5rem;
    bottom: .35rem;
    font-size: .9rem;
    color: #6c757d;
    z-index: 1; /* au-dessus des diagonales */
}

/* ENGAGEMENTS — petits réglages d’affichage */
#engagements .d-flex {
    align-items: flex-start;
}

#engagements h2 {
    margin-bottom: 1.25rem;
}

#engagements p {
    margin-bottom: 0;
}

/* Sécurité : chaque section s’empile correctement */
section {
    scroll-margin-top: 80px;
    position: relative;
    z-index: 0;
}

/* ===== Before/After overlap ===== */
.ba-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem; /* espace de base (sera partiellement “mangé” par l’overlap) */
    align-items: center;
    position: relative;
}

/* Carte d’image stylée */
.ba-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.05);
    transition: transform .25s ease, box-shadow .25s ease;
    isolation: isolate; /* évite tout débordement des placeholders */
}

    .ba-card .ratio > .placeholder-box,
    .ba-card .ratio > .ba-img {
        width: 100%;
        height: 100%;
        border: none;
    }

    /* Légende “pills” dans l’image */
    .ba-card figcaption {
        position: absolute;
        left: 12px;
        bottom: 10px;
        background: rgba(0,0,0,.55);
        color: #fff;
        font-size: .9rem;
        padding: .35rem .6rem;
        border-radius: 999px;
        z-index: 2;
    }

    /* Scroll animation for cards */
    .ba-card {
        position: relative;
        overflow: hidden;
        /* other styles */
    }

    .ba-card .scroll-reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .ba-card.is-in-view .scroll-reveal {
        opacity: 1;
        transform: translateY(0);
    }

    /* On dirait que les textes apparaissent en scrollant */
    @keyframes slideIn {
        0% {
            opacity: 0;
            transform: translateY(10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Les titres des sections glissent vers le haut au survol */
    h2:hover {
        animation: slideIn 0.6s forwards;
    }

/* Overlap élégant : la carte de droite empiète légèrement sur la gauche */
.ba-before {
    z-index: 1;
}

.ba-after {
    z-index: 2;
    margin-left: -6%;
}

/* Micro-interactions */
.ba-wrap:hover .ba-after {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(16,24,40,.10);
}

.ba-wrap:hover .ba-before {
    transform: translateY( 4px);
}

/* Mobile / tablette : empilement harmonieux */
@media (max-width: 991.98px) {
    .ba-wrap {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .ba-after {
        margin-left: 0;
        margin-top: -1.5rem;
    }
    /* légère superposition verticale */
}

/* Option image réelle en background (si tu remplaces le placeholder) */
.ba-img {
    background-size: cover;
    background-position: center;
}

/* Placeholders (déjà présents chez toi, on garde) */
.placeholder-box {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

    .placeholder-box::before, .placeholder-box::after {
        content: "";
        position: absolute;
        inset: 0;
        opacity: .5;
        pointer-events: none;
        z-index: 0;
        background: linear-gradient(45deg, transparent 49%, #adb5bd 50%, transparent 51%);
    }

    .placeholder-box::after {
        background: linear-gradient(-45deg, transparent 49%, #adb5bd 50%, transparent 51%);
    }

    /* Barre d’info sous le héros */
    .hero-info {
    scroll-margin-top: 80px;
}
/* ======= COMPARAISON AVANT/APRÈS ======= */
.compare-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.js-compare {
    position: relative;
    display: block;
}

.compare-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.compare-before {
    z-index: 1;
}

.compare-after {
    z-index: 2;
    /* on masque la partie gauche de l'image "après" selon --pos */
    clip-path: inset(0 0 0 var(--pos,50%));
}

/* support images réelles */
.ba-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* placeholders si pas encore d’images */
.compare-layer .placeholder-box {
    width: 100%;
    height: 100%;
    border: 0;
}

.placeholder-box {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    overflow: hidden;
    isolation: isolate;
}

    .placeholder-box::before, .placeholder-box::after {
        content: "";
        position: absolute;
        inset: 0;
        opacity: .5;
        pointer-events: none;
        z-index: 0;
        background: linear-gradient(45deg, transparent 49%, #adb5bd 50%, transparent 51%);
    }

    .placeholder-box::after {
        background: linear-gradient(-45deg, transparent 49%, #adb5bd 50%, transparent 51%);
    }

    /* Légendes “pill” */
    .compare-label {
    position: absolute;
    bottom: 10px;
    padding: .35rem .6rem;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 999px;
    font-size: .9rem;
    z-index: 3;
}

    .compare-label.start {
        left: 12px;
    }

    .compare-label.end {
        right: 12px;
    }

    /* Poignée + ligne verticale */
    .compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos,50%);
    width: 0;
    border-left: 2px solid rgba(255,255,255,.95);
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset;
}

    .compare-handle::before {
        content: "";
        position: absolute;
        top: 50%;
        left: -14px;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid rgba(0,0,0,.12);
        box-shadow: 0 6px 14px rgba(0,0,0,.12);
    }

    /* Slider invisible (capte drag/touch/clavier) */
    .compare-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 5;
}

    /* Responsive : marge confortable sur petit écran */
    @media (max-width: 991.98px) {
    .compare-card {
        border-radius: 12px;
    }
}
.hero-tagline {
    letter-spacing: .2px;
}

@media (max-width: 575.98px) { /* lisible sur mobile */
    .hero-tagline {
        font-size: 1.6rem;
    }
}

/* Effet reveal commun */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease, filter .6s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform, filter;
}

    /* Visible */
    .reveal-on-scroll.is-visible {
        opacity: 1;
        transform: none;
        filter: none;
    }

    /* Variantes (optionnelles) via data-reveal="..." */
    .reveal-on-scroll[data-reveal="fade"] {
        transform: none;
    }

    .reveal-on-scroll[data-reveal="up"] {
        transform: translateY(16px);
    }

    .reveal-on-scroll[data-reveal="down"] {
        transform: translateY(-16px);
    }

    .reveal-on-scroll[data-reveal="left"] {
        transform: translateX(16px);
    }

    .reveal-on-scroll[data-reveal="right"] {
        transform: translateX(-16px);
    }

    .reveal-on-scroll[data-reveal="scale"] {
        transform: scale(.98);
    }

    .reveal-on-scroll[data-reveal="soft-glow"] {
        filter: blur(2px);
    }

    .reveal-on-scroll.is-visible[data-reveal="left"],
    .reveal-on-scroll.is-visible[data-reveal="right"],
    .reveal-on-scroll.is-visible[data-reveal="down"],
    .reveal-on-scroll.is-visible[data-reveal="up"],
    .reveal-on-scroll.is-visible[data-reveal="scale"],
    .reveal-on-scroll.is-visible[data-reveal="fade"],
    .reveal-on-scroll.is-visible[data-reveal="soft-glow"] {
        transform: none;
        filter: none;
    }

/* Respect de l’accessibilité */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

