/*
 * V4 — HEADER composite (« shell » HERO + SLIDER).
 *
 * Le SHELL porte le fond partagé pleine largeur ; HERO/SLIDER sont posés
 * par-dessus dans une grille CENTRÉE, sans fond propre (transparents).
 * Reproduit .em-landing-header + .em-landing-hero-row du site.
 *
 * Source UNIQUE partagée par le front (aperçu V4) ET le back (inliné via
 * em_wp_v4_front_render_css()).
 */

/* Fond de repli = orange du site (#ff6f00) quand aucune couleur FOND n'est
   choisie. La couleur FOND (--em-rubrique-bg) reste prioritaire si définie.
   Spécificité .em-rubrique.em-header-shell : bat le repli sombre de .em-rubrique. */
.em-rubrique.em-header-shell {
    background-color: var(--em-rubrique-bg, #ff6f00);
}

/* Calque image de fond : MÊME filtre que le site (modules/header/header.css). */
.em-header-shell::before {
    filter: brightness(1.18) saturate(0.92);
}

.em-header-shell__inner {
    position: relative;
    z-index: 1;
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 44px 0 68px;
    display: grid;
    gap: 28px;
    align-items: start;
}

.em-header-shell__inner.is-single {
    grid-template-columns: minmax(0, 1fr) !important;
}

.em-header-shell__col {
    position: relative;
    z-index: 1;
    min-width: 0;
}

/* Colonne slider en FLUX BLOC (pas flex) : sinon le wrapper V4 .em-rubrique
   devient un flex-item shrink-to-fit (largeur = contenu) et .em-slider--mayami
   (width:100%) s'effondre à la largeur de son footer (~150px). En bloc, le
   wrapper remplit la piste grid (320–430px) exactement comme le slider legacy
   (.em-landing-hero-row__column--slider), donc width:100% = largeur de piste. */
.em-header-shell__col--slider .em-rubrique,
.em-header-shell__col--slider .em-rubrique__row,
.em-header-shell__col--slider .em-rubrique__col {
    width: 100%;
}

.em-header-shell__col--slider .em-slider--mayami {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

/* HERO/SLIDER posés dans le shell : pas de fond propre (le shell porte le fond). */
.em-header-shell .em-rubrique {
    background-color: transparent !important;
}

.em-header-shell .em-rubrique::before {
    display: none !important;
}

/* SLIDER : collé aux bords de sa piste, aucun padding latéral propre → on ne
   touche jamais à sa taille/position. Le HERO, lui, CONSERVE ses espacements
   Gauche/Droite (--em-rubrique-pl/pr réglés dans APPARENCE) : c'est ainsi qu'on
   l'éloigne du slider en réduisant la largeur de son contenu, sans bouger les
   pistes de la grille (donc sans toucher au slider). */
.em-header-shell__col--slider .em-rubrique {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 960px) {
    .em-header-shell__inner,
    .em-header-shell__inner.is-slider-first {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 760px) {
    /* Mobile header: limiter au maximum l'espace avant la fleche bas du hero. */
    .em-header-shell__inner,
    .em-header-shell__inner.is-slider-first {
        padding-top: 2px;
        padding-bottom: 30px;
        gap: 12px;
    }

    .em-header-shell .em-hero--mayami .em-hero__inner {
        padding-top: 6px;
    }

    .em-header-shell .em-hero--mayami .em-hero__scroll-row {
        margin-bottom: 8px;
    }

    /* Forcer Stream/Watch sur une seule ligne en mobile. */
    .em-header-shell .em-hero--mayami .em-hero__actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        margin-top: 14px;
        padding-bottom: 10px;
    }

    .em-header-shell .em-hero--mayami .em-hero__btn {
        white-space: nowrap;
    }

    /* V4 réel: certains templates utilisent les boutons génériques */
    .em-header-shell .em-rubrique__row[data-em-has-button="1"] {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 8px;
    }

    .em-header-shell .em-rubrique__row[data-em-has-button="1"] > .em-rubrique__col[data-em-has-button="1"] {
        width: 100% !important;
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .em-header-shell .em-rubrique__row[data-em-has-button="1"] .em-rubrique__button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex: 1 1 0;
        min-width: 0;
        margin-right: 0 !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}
