/*
 * Eclair — Widget Page Famille v15
 * Mobile-first. clamp() partout. Animations élégantes.
 * Spécificité basse (.ecf-*) pour que les contrôles Elementor prennent le dessus.
 */

/* ═══════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════ */
.ecf-wrap {
    --ecf-p:        #D85A30;
    --ecf-radius:   16px;
    --ecf-radius-s: 10px;
    --ecf-gap:      clamp(20px, 4vw, 48px);
    --ecf-section:  clamp(40px, 6vw, 72px);
    --ecf-ease:     cubic-bezier(.22, 1, .36, 1);
    font-family: system-ui, -apple-system, sans-serif;
    color: #1a1a2e;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes ecf-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ecf-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ecf-scale-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes ecf-hero-ken {
    from { transform: scale(1.06); }
    to   { transform: scale(1); }
}

/* Classe utilitaire pour les éléments animés au scroll */
.ecf-anim {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .55s var(--ecf-ease), transform .55s var(--ecf-ease);
}
.ecf-anim.is-visible {
    opacity: 1;
    transform: none;
}
.ecf-anim-d1 { transition-delay: .08s; }
.ecf-anim-d2 { transition-delay: .16s; }
.ecf-anim-d3 { transition-delay: .24s; }
.ecf-anim-d4 { transition-delay: .32s; }

/* ═══════════════════════════════════════════
   HERO — full-bleed cinématique
═══════════════════════════════════════════ */
.ecf-hero {
    position: relative;
    overflow: hidden;
    background: #111;
    /*
     * Image pleine largeur : le hero déborde du container Elementor.
     * Le texte (.ecf-hero-body) est ramené dans les rails via margin inverse.
     */
    width: 100vw;
    margin-left:  calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: var(--ecf-section);
    min-height: clamp(320px, 55vh, 580px);
    display: flex;
    align-items: flex-end;
}

.ecf-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    z-index: 0;
    display: block;
    animation: ecf-hero-ken 8s var(--ecf-ease) forwards;
}

.ecf-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top,  rgba(0,0,0,.80) 0%, rgba(0,0,0,.30) 50%, rgba(0,0,0,.10) 100%),
        linear-gradient(to right, rgba(0,0,0,.30) 0%, transparent 60%);
}

/*
 * Texte dans les rails du container :
 * on annule le débord du hero avec des marges inverses.
 * calc(50vw - 50%) = exactement le débord ajouté côté gauche/droite.
 * + padding interne pour le gutter.
 */
.ecf-hero-body {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    /* Ramener dans les rails */
    margin-left:  calc(50vw - 50%);
    margin-right: calc(50vw - 50%);
    /* Gutter identique aux sections */
    padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px);
    animation: ecf-fade-up .7s var(--ecf-ease) .1s both;
}

.ecf-hero-kicker {
    display: inline-block;
    font-size: clamp(9px, 1.2vw, 11px);
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--ecf-p);
    filter: brightness(1.4);
    margin-bottom: clamp(10px, 2vw, 16px);
}

h1.ecf-h1 {
    font-size: clamp(32px, 5.5vw, 64px);
    font-weight: 900;
    color: #fff;
    margin: 0 0 clamp(12px, 2vw, 20px);
    line-height: .95;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.ecf-hero-sub {
    font-size: clamp(13px, 1.5vw, 16px);
    color: rgba(255,255,255,.78);
    margin: 0 0 clamp(20px, 3vw, 32px);
    line-height: 1.65;
    max-width: 520px;
    font-weight: 400;
}

.ecf-apps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ecf-app-badge {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: clamp(11px, 1.2vw, 13px);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 500;
    letter-spacing: .02em;
    backdrop-filter: blur(4px);
    transition: background .2s, border-color .2s;
}
.ecf-app-badge:hover {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.45);
}

/* ═══════════════════════════════════════════
   CONTAINER — wrapper sémantique des sections.
   Pas de padding propre : hérite de la colonne Elementor.
═══════════════════════════════════════════ */
.ecf-container {
    width: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════
   SECTIONS — espacements compacts
═══════════════════════════════════════════ */
.ecf-section {
    padding-top: clamp(36px, 5vw, 60px);
    margin-bottom: var(--ecf-section);
}

.ecf-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ecf-p);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ecf-kicker::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .2;
    max-width: 40px;
}

h2.ecf-h2 {
    font-size: clamp(22px, 3.2vw, 36px);
    font-weight: 900;
    color: #1a1a2e;
    margin: 0 0 8px;
    letter-spacing: -.025em;
    line-height: 1.1;
}

.ecf-intro {
    font-size: clamp(14px, 1.4vw, 15px);
    color: #666;
    margin: 0 0 clamp(24px, 4vw, 36px);
    max-width: 560px;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════
   PRÉSENTATION — 2 colonnes → 1 colonne
═══════════════════════════════════════════ */
.ecf-pres-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ecf-gap);
    align-items: center;
}

.ecf-desc-text {
    font-size: clamp(14px, 1.4vw, 15px);
    color: #444;
    line-height: 1.85;
}
.ecf-desc-text p { margin: 0 0 14px; }
.ecf-desc-text p:last-child { margin: 0; }

.ecf-pres-img {
    width: 100%;
    border-radius: var(--ecf-radius);
    object-fit: cover;
    aspect-ratio: 4/3;
    box-shadow: 0 16px 48px rgba(0,0,0,.10);
    transition: transform .5s var(--ecf-ease), box-shadow .5s var(--ecf-ease);
}
.ecf-pres-img:hover {
    transform: scale(1.02);
    box-shadow: 0 24px 64px rgba(0,0,0,.14);
}
.ecf-pres-noimg {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f0f0f0, #e4e4e4);
    border-radius: var(--ecf-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
}

.ecf-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: clamp(20px, 3vw, 28px);
}
.ecf-point {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(13px, 1.3vw, 14px);
    font-weight: 500;
    color: #2d2d2d;
    background: #f8f8fb;
    border: 1px solid #eaebee;
    border-radius: var(--ecf-radius-s);
    padding: 11px 16px;
    transition: background .2s, border-color .2s, transform .2s var(--ecf-ease);
}
.ecf-point:hover {
    background: #fff;
    border-color: var(--ecf-p);
    transform: translateX(4px);
}
.ecf-point-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   GALERIE — masonry léger
═══════════════════════════════════════════ */
.ecf-galerie {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: clamp(8px, 1.5vw, 14px);
}
.ecf-galerie-item {
    border-radius: var(--ecf-radius-s);
    overflow: hidden;
    position: relative;
    aspect-ratio: 3/4;
    cursor: zoom-in;
}
.ecf-galerie-item:first-child {
    grid-column: span 2;
    aspect-ratio: 16/9;
}
.ecf-galerie-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ecf-ease);
    display: block;
}
.ecf-galerie-item:hover .ecf-galerie-img { transform: scale(1.05); }
.ecf-galerie-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,.55));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════
   MAILLES — grille auto-fill élégante
═══════════════════════════════════════════ */
.ecf-mailles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: clamp(12px, 2vw, 18px);
}

.ecf-maille-card {
    background: #fff;
    border: 1.5px solid #eaebee;
    border-radius: var(--ecf-radius);
    overflow: hidden;
    transition:
        border-color .25s var(--ecf-ease),
        box-shadow    .25s var(--ecf-ease),
        transform     .25s var(--ecf-ease);
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.ecf-maille-card:hover {
    border-color: var(--ecf-p);
    box-shadow: 0 12px 32px rgba(0,0,0,.11);
    transform: translateY(-4px);
}
.ecf-maille-img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
    transition: transform .4s var(--ecf-ease);
}
.ecf-maille-card:hover .ecf-maille-img { transform: scale(1.04); }
.ecf-maille-noimg {
    width: 100%;
    aspect-ratio: 3/2;
    background: linear-gradient(135deg, #f5f5f7, #eaeaee);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ccc;
}
.ecf-maille-body  { padding: clamp(12px, 2vw, 16px); }
.ecf-maille-badge {
    display: inline-block;
    background: var(--ecf-p);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    margin-bottom: 7px;
    letter-spacing: .05em;
}
h3.ecf-maille-h3 {
    font-size: clamp(13px, 1.4vw, 15px);
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 5px;
    line-height: 1.3;
}
.ecf-maille-usage { font-size: 12px; color: #666; line-height: 1.5; margin: 0 0 6px; }
.ecf-maille-comp  { font-size: 10px; color: #aaa; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ecf-maille-tip   { margin-top: 8px; font-size: 11px; color: var(--ecf-p); font-weight: 600; line-height: 1.4; }

/* ═══════════════════════════════════════════
   GUIDE DEVIS
═══════════════════════════════════════════ */
.ecf-guide-section {
    background: #f8f8fb;
    border: 1px solid #eaebee;
    border-radius: var(--ecf-radius);
    padding: clamp(24px, 4vw, 48px);
}
.ecf-guide-section .ecl-header { display: none; }

/* ═══════════════════════════════════════════
   RESPONSIVE — tablette (< 900px)
═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .ecf-pres-grid {
        grid-template-columns: 1fr;
    }
    .ecf-pres-grid > div:last-child {
        order: -1;
    }
    .ecf-pres-img,
    .ecf-pres-noimg {
        aspect-ratio: 16/9;
        max-height: 280px;
    }
    .ecf-galerie {
        grid-template-columns: 1fr 1fr;
    }
    .ecf-galerie-item:first-child {
        grid-column: span 2;
        aspect-ratio: 16/7;
    }
    /* Mailles : scroll horizontal en shelf */
    .ecf-mailles-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        gap: 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        /* Débord pleine largeur comme le hero */
        width: 100vw;
        margin-left:  calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 4px clamp(16px, 5vw, 32px) 16px;
        /* Masquer la scrollbar tout en gardant le scroll */
        scrollbar-width: none;
    }
    .ecf-mailles-grid::-webkit-scrollbar { display: none; }
    .ecf-maille-card {
        flex: 0 0 240px;
        scroll-snap-align: start;
        transform: none !important; /* désactiver le translateY hover en scroll */
    }
    .ecf-maille-card:hover {
        transform: none !important;
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — mobile (< 600px)
═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .ecf-hero {
        min-height: clamp(260px, 60vw, 340px);
        align-items: flex-end;
    }
    .ecf-hero-body {
        padding: 20px 18px 28px;
    }
    h1.ecf-h1 {
        font-size: clamp(28px, 8vw, 40px);
        margin-bottom: 10px;
    }
    .ecf-hero-sub {
        font-size: 13px;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .ecf-app-badge {
        font-size: 11px;
        padding: 5px 11px;
    }
    .ecf-galerie {
        grid-template-columns: 1fr;
    }
    .ecf-galerie-item { aspect-ratio: 16/9; }
    .ecf-galerie-item:first-child {
        grid-column: span 1;
        aspect-ratio: 16/9;
    }
    /* Cartes mailles plus petites sur mobile */
    .ecf-maille-card {
        flex: 0 0 190px;
    }
    .ecf-point {
        padding: 9px 13px;
        font-size: 13px;
    }
    .ecf-guide-section {
        border-radius: var(--ecf-radius-s);
    }
    .ecf-section { margin-bottom: clamp(28px, 8vw, 44px); }
    .ecf-wrap { --ecf-section: clamp(28px, 8vw, 44px); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — petit mobile (< 380px)
═══════════════════════════════════════════ */
@media (max-width: 380px) {
    .ecf-maille-card { flex: 0 0 160px; }
    h1.ecf-h1 { font-size: 26px; }
}

/* ═══════════════════════════════════════════
   PRINT
═══════════════════════════════════════════ */
@media print {
    .ecf-hero { min-height: auto; margin-bottom: 24px; }
    .ecf-hero-overlay { display: none; }
    .ecf-app-badge { border: 1px solid #ccc; background: none; color: #000; }
    .ecf-maille-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .ecf-mailles-grid { display: grid !important; grid-template-columns: repeat(3,1fr) !important; overflow: visible !important; }
}

/* ═══════════════════════════════════════════
   HERO WIDGET — contenu texte seul
   (l'image est gérée par Elementor en background)
═══════════════════════════════════════════ */
.ecf-hero-content {
    width: 100%;
    box-sizing: border-box;
    padding: clamp(28px, 5vw, 56px) 0;
}
