/* ==========================================================================
   PERGOW — FINITIONS PREMIUM
   Animations discrètes, confort mobile et accessibilité.
   Chargé après style.css : ce fichier peut être retiré sans rien casser.
   ========================================================================== */

/* --- Sélection de texte et focus clavier aux couleurs de la marque --- */
::selection {
    background-color: var(--accent);
    color: #ffffff;
}

:focus-visible {
    outline: 3px solid rgba(214, 0, 28, 0.45);
    outline-offset: 3px;
    border-radius: 6px;
}

/* --- Barre de progression de lecture --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent) 0%, #ff4d5e 100%);
    z-index: 2000;
    pointer-events: none;
}

/* --- Entrée du hero : les éléments montent l'un après l'autre --- */
.hero-content > * {
    opacity: 0;
    transform: translateY(26px);
    animation: premium-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2) { animation-delay: 0.28s; }
.hero-content > *:nth-child(3) { animation-delay: 0.42s; }
.hero-content > *:nth-child(4) { animation-delay: 0.56s; }

@keyframes premium-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicateur "faire défiler" en bas du hero (ordinateur) */
.hero-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    animation: premium-rise 0.9s 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-scroll-cue span {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    position: relative;
}

.hero-scroll-cue span::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background-color: #ffffff;
    animation: premium-scroll-dot 1.8s ease-in-out infinite;
}

@keyframes premium-scroll-dot {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}

/* --- Soulignement des titres qui se dessine à l'apparition --- */
.section-header.reveal h2.with-underline::after {
    width: 0;
    transition: width 0.9s 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header.reveal.active h2.with-underline::after {
    width: 60px;
}

/* --- Reflet lumineux sur les boutons principaux --- */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    transform: skewX(-20deg);
    transition: left 0.75s ease;
    pointer-events: none;
}

.btn-primary:hover::after {
    left: 130%;
}

/* --- Images : apparition en fondu une fois chargées --- */
img.premium-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

img.premium-fade.is-loaded {
    opacity: 1;
}

/* --- Cartes : légère élévation au survol (ordinateur uniquement) --- */
@media (hover: hover) {
    .review-card,
    .gallery-item,
    .avis-card {
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    }

    .avis-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-medium);
    }
}

/* ==========================================================================
   MOBILE : boutons flottants compacts et zones tactiles confortables
   ========================================================================== */
@media (max-width: 768px) {
    /* Le bouton "Nous contacter" devient une pastille ronde pour libérer l'écran */
    .floating-widget-container {
        bottom: 18px;
        left: 16px;
    }

    .floating-launcher-btn {
        position: relative;
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .floating-launcher-btn > span:not(.floating-launcher-badge) {
        display: none;
    }

    .floating-launcher-badge {
        position: absolute;
        top: 5px;
        right: 5px;
    }

    /* Le contenu du pied de page n'est plus masqué par les boutons flottants */
    footer {
        padding-bottom: 96px;
    }

    /* Zones tactiles d'au moins ~44 px */
    .menu-toggle {
        padding: 13px;
        box-sizing: content-box;
        margin-right: -13px;
    }

    .footer-link,
    .footer-legal-link,
    .footer-phone-list a {
        display: inline-block;
        padding: 8px 0;
    }

    .marketing-modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    .hero-scroll-cue {
        display: none;
    }
}

/* ==========================================================================
   ACCESSIBILITÉ : réduire les animations si le visiteur le demande
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .hero-content > *,
    img.premium-fade {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   COMPARATEUR AVANT / APRÈS ET ÉTUDE DE CAS
   ========================================================================== */
.ba-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1206 / 552;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    background-color: #1f252b;
    user-select: none;
    touch-action: pan-y;
}

.ba-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ba-before {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.ba-label {
    position: absolute;
    top: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background-color: rgba(18, 20, 23, 0.65);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.ba-label-before { left: 14px; }
.ba-label-after { right: 14px; background-color: rgba(214, 0, 28, 0.85); }

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 3px;
    margin-left: -1.5px;
    background-color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.ba-handle::after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Le curseur natif couvre toute l'image : glisser au doigt, à la souris ou au clavier */
.ba-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    -webkit-appearance: none;
    appearance: none;
}

.ba-range:focus-visible + .ba-handle,
.ba-slider:focus-within .ba-handle::after {
    outline: 3px solid rgba(214, 0, 28, 0.6);
}

.case-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    background-color: rgba(214, 0, 28, 0.08);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.case-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: center;
}

.case-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.case-info p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.case-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.case-list li {
    position: relative;
    padding-left: 30px;
    font-weight: 500;
    color: var(--primary);
}

.case-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: -1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-gallery-title {
    margin: 50px 0 16px 0;
    font-weight: 700;
    color: var(--primary);
}

.case-gallery-title span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.case-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.case-thumb {
    position: relative;
    padding: 0;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    background-color: #e2e8f0;
}

.case-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-thumb:hover img {
    transform: scale(1.06);
}

.case-thumb-tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 14px;
    background-color: rgba(18, 20, 23, 0.7);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Navigation dans l'agrandissement (galerie du chantier) */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 2;
}

.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

/* Encart "Chantier à la une" de l'accueil */
.home-case {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 900px) {
    .case-layout,
    .home-case {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .case-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ba-slider {
        border-radius: 14px;
    }
}

/* Cartes "chantier" de la galerie (plusieurs photos) */
.project-card {
    cursor: zoom-in;
}

.project-photo-count {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 5px 11px;
    border-radius: 20px;
    background-color: rgba(18, 20, 23, 0.75);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    pointer-events: none;
}

.duo-ba {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    height: 100%;
}

.duo-ba figure {
    position: relative;
    margin: 0;
    overflow: hidden;
}

.duo-ba .gallery-img {
    height: 100%;
}

.duo-ba figcaption {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 9px;
    border-radius: 12px;
    background-color: rgba(18, 20, 23, 0.75);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.duo-ba figure:last-child figcaption {
    background-color: rgba(214, 0, 28, 0.85);
}

/* Badge reCAPTCHA masqué : la mention obligatoire figure dans le pied de page */
.grecaptcha-badge {
    visibility: hidden !important;
}
