/* ============================================================
   YLLY Header — Styles
   Figma: NovCast > Header (node 957-5326)
   Architecture : barre dark navy fixe → nav pill blanche au centre
   ============================================================ */

/* ── Variables ── */
:root {
    --yl-header-h: 72px;
}

/* ── Wrapper ── */
.yl-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--yl-header-h);
    background-color: var(--yl-header-bg, #0d1526);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.35s ease,
                top 0.35s ease, left 0.35s ease, right 0.35s ease;
}

/* Caché (scroll down) */
.yl-header.is-hidden {
    transform: translateY(-100%);
}

/* ── Inner ── */
.yl-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 56px);
}

/* ── Logo ── */
.yl-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    gap: 10px;
}

.yl-header__logo-img {
    height: 44px;
    width: auto;
    display: block;
}

/* Logo SVG inline (si pas d'image ACF) — Figma 957:9105 */
.yl-header__logo-svg {
    height: 44px;
    width: auto;
    display: block;
    color: #ffffff; /* couleur du wordmark via currentColor */
}

/* Supprime les styles WP custom logo */
.yl-header__logo .custom-logo-link img {
    height: 44px;
    width: auto;
}

/* ── Nav pill (centre, fond blanc) ── */
.yl-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.yl-header__nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 130px;
    height: 51px;
    padding: 0 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.yl-nav__list {
    display: flex;
    align-items: center;
    gap: 11px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.yl-nav__item {
    position: static;
}

/* Lien simple */
.yl-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #0f172b;
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 9999px;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.yl-nav__link:hover,
.yl-nav__item.is-current .yl-nav__link {
    color: #0f172b;
    background-color: rgba(15, 23, 43, 0.07);
}

/* Badge "30" sur Projets — superscript absolu */
.yl-nav__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(15, 23, 43, 0.45);
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

/* Bouton trigger dropdown */
.yl-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #0f172b;
    background: none;
    border: none;
    padding: 7px 16px;
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.yl-nav__trigger:hover,
.yl-nav__item.is-open .yl-nav__trigger {
    color: #0f172b;
    background-color: rgba(15, 23, 43, 0.07);
}

/* Chevron 14×14 (Figma CaretDown) */
.yl-nav__chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    /* Herite de la couleur du declencheur, pour suivre l'etat clair/sombre
       du header. Le 0.72 attenue la fleche sans la desolidariser du texte. */
    color: currentColor;
    opacity: 0.72;
}

.yl-nav__item.is-open .yl-nav__chevron {
    transform: rotate(180deg);
}

/* ── Dropdown panel — Figma 1126:19279 (964×332, 2 colonnes) ── */
.yl-nav__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 964px;
    max-width: calc(100vw - 40px);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 43, 0.10), 0 4px 12px rgba(15, 23, 43, 0.06);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    margin-top: 8px;
}

.yl-nav__item.is-open > .yl-nav__dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.yl-nav__dropdown-inner {
    padding: 32px 40px;
}

.yl-nav__dropdown-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 53px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.yl-nav__dropdown-item {
    display: block;
}

.yl-nav__dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 25px 12px;
    border-radius: 8px;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    transition: background-color 0.2s ease;
}

.yl-nav__dropdown-link:hover {
    background-color: #f8f7fb;
}

.yl-nav__dropdown-link:hover .yl-nav__dropdown-arrow {
    transform: translateX(4px);
}

.yl-nav__dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.yl-nav__dropdown-title {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #0f172b;
    letter-spacing: -0.005em;
    line-height: 1.5;
}

.yl-nav__dropdown-desc {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #0f172b;
    line-height: 1.6;
}

.yl-nav__dropdown-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', 'Instrument Sans', sans-serif;
    font-size: 16px;
    line-height: 1;
    font-weight: 400;
    color: #ff470a;
    transition: transform 0.2s ease;
}

/* Trois rubriques avec dropdown 4 items → 2x2 (mêmes cartes, layout adapté) */
.yl-nav__item.has-4-items .yl-nav__dropdown-list {
    grid-template-rows: 1fr 1fr;
}

/* ── Droite : search + CTA ── */
.yl-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* CTA Contact — pill 55px × min 150px, radius 44px (Figma) */
.yl-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 55px;
    background-color: #d63500;
    color: #ffffff;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: -0.048px;
    padding: 8px 22px;
    border-radius: 44px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.yl-header__cta:hover {
    background-color: #b82d00;
    color: #ffffff;
    transform: translateY(-1px);
}

/* ── Burger ── */
.yl-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.yl-header__burger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.yl-header__burger-bar {
    display: block;
    height: 1.5px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 100%;
}

.yl-header.menu-open .yl-header__burger-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.yl-header.menu-open .yl-header__burger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.yl-header.menu-open .yl-header__burger-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Mobile menu ── */
.yl-header__mobile-menu {
    position: fixed;
    top: var(--yl-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0d1526;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.yl-header.menu-open .yl-header__mobile-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.yl-header__mobile-inner {
    padding: 24px clamp(20px, 5vw, 40px) 48px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yl-mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.yl-mobile-nav__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.yl-mobile-nav__list > li > a,
.yl-mobile-nav__list > li > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    letter-spacing: -0.02em;
}

.yl-mobile-nav__list .sub-menu {
    list-style: none;
    margin: 0 0 8px;
    padding: 0 0 0 16px;
}

.yl-mobile-nav__list .sub-menu li a {
    display: block;
    padding: 10px 0;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.yl-header__cta--mobile {
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 14px 24px;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    :root {
        --yl-header-h: 64px;
    }

    .yl-header__nav {
        display: none;
    }

    .yl-header__cta:not(.yl-header__cta--mobile) {
        display: none;
    }

    .yl-header__burger {
        display: flex;
    }
}

@media (max-width: 600px) {
    :root {
        --yl-header-h: 60px;
    }

    .yl-header__inner {
        padding-inline: 20px;
    }
}

/* ── Espace pour header fixe ── */
.wp-site-blocks {
    padding-top: var(--yl-header-h) !important;
}

/* ============================================================
   Etat transparent — page d'accueil, avant le scroll
   Figma : variante « Close Glass » du composant Nav (891:1118)
   La variante « Close Subpage » correspond a l'etat solide, qui
   est celui applique par defaut sur les pages internes.
   ============================================================ */
.yl-header--transparent:not(.is-solid) {
    --yl-header-bg: transparent;
}

/* Pilule en verre translucide au lieu du blanc opaque */
.yl-header--transparent:not(.is-solid) .yl-header__nav-pill {
    background: rgba(135, 135, 135, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

/* Libelles en blanc sur la pilule en verre.
   Les items a sous-menu sont des <button class="yl-nav__trigger"> ;
   .yl-nav__dropdown-link en est volontairement exclu : ces liens
   s'affichent dans le panneau blanc et doivent rester fonces. */
.yl-header--transparent:not(.is-solid) .yl-nav__link,
.yl-header--transparent:not(.is-solid) .yl-nav__trigger {
    color: var(--color-surface-white);
}

/* Le fond du header etant transparent, on retablit la transition
   de couleur des libelles pour eviter un saut au moment du scroll. */
.yl-header .yl-nav__link,
.yl-header .yl-nav__trigger {
    transition: color 0.35s ease;
}

.yl-header__nav-pill {
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

/* ============================================================
   Etat clair — toutes les pages internes, avant le scroll
   Figma : variante « Close Subpage » du composant Nav (891:1118)
   ------------------------------------------------------------
   Sur ces gabarits le contenu commence SOUS le header (compensation
   .wp-site-blocks). Une barre bleu nuit y forme une bande etrangere
   au-dessus du premier bloc : on lui donne le gris de surface, qui
   est justement le fond de la plupart des heros internes (hero
   projets, hero blog, image-texte). La pilule reste blanche et les
   libelles fonces, comme dans la maquette.
   Le passage au bleu nuit se fait a la fin du premier bloc (is-solid),
   comme sur l'accueil.
   ============================================================ */
.yl-header--light:not(.is-solid):not(.menu-open) {
    --yl-header-bg: var(--color-surface-default, #f2f1f6);
}

/* Logo : le wordmark suit currentColor, l'asterisque reste orange */
.yl-header--light:not(.is-solid):not(.menu-open) .yl-header__logo-svg {
    color: var(--color-text-default, #0f172b);
}

/* Burger mobile */
.yl-header--light:not(.is-solid):not(.menu-open) .yl-header__burger-bar {
    background-color: var(--color-text-default, #0f172b);
}

.yl-header--light:not(.is-solid):not(.menu-open) .yl-header__burger:hover {
    background-color: rgba(15, 23, 43, 0.07);
}

/* La pilule blanche a besoin d'une ombre plus marquee sur le gris que sur
   le bleu nuit, sinon elle flotte sans se detacher. */
.yl-header--light:not(.is-solid):not(.menu-open) .yl-header__nav-pill {
    box-shadow: 0 1px 2px rgba(15, 23, 43, 0.06),
                0 6px 16px rgba(15, 23, 43, 0.07);
}

/* Transitions : le basculement vers le bleu nuit doit suivre le meme
   tempo que le fond de la barre, sans a-coup sur le logo ni les icones. */
.yl-header__logo-svg,
.yl-header__burger-bar {
    transition: color 0.35s ease, background-color 0.35s ease;
}

/* Respect de la preference de mouvement reduit */
@media (prefers-reduced-motion: reduce) {
    .yl-header,
    .yl-header__nav-pill,
    .yl-header__logo-svg,
    .yl-header__burger-bar,
    .yl-header .yl-nav__link {
        transition: none;
    }
}

/* ============================================================
   Accueil — le hero passe SOUS le header transparent
   ------------------------------------------------------------
   Ailleurs, .wp-site-blocks compense la hauteur du header fixe.
   Sur l'accueil la maquette superpose la nav au hero (730px de
   haut, contenu aligne en bas) : on retire donc la compensation.
   ============================================================ */
body.home .wp-site-blocks {
    /* 13px : le hero garde une marge haute égale à ses gouttières latérales
       (retour design 11/09/2026). L'espace est porté par le conteneur, la
       marge du premier enfant s'effondrerait sinon. */
    padding-top: 13px !important;
}

/* ------------------------------------------------------------
   Accueil : le menu suit la même règle d'espacement que le hero
   (retour design 11/09/2026). Il descend de 13px pour démarrer au
   même niveau, et reprend le retrait interne du contenu du hero
   (80 / 40 / 20px selon la largeur) pour que le logo s'aligne sur
   le titre. Les conteneurs, tous deux plafonnés à 1440px centrés,
   coïncident déjà : seul ce retrait les séparait.
   ------------------------------------------------------------ */
/* Au repos, la barre épouse la boîte du hero : mêmes gouttières de 13px, donc
   son conteneur interne (plafonné à 1440px centré, retrait de 80px) tombe
   exactement sur la colonne de texte du hero, à toutes les largeurs.
   Une fois le hero dépassé (is-solid), elle reprend la pleine largeur au ras
   du haut, comme sur le reste du site : gardée flottante, elle laissait voir
   une bande de contenu au-dessus d'elle. */
body.home .yl-header:not(.is-solid):not(.menu-open) {
    top: 13px;
    left: 13px;
    right: 13px;
    width: auto;
}
body.home .yl-header:not(.is-solid):not(.menu-open) .yl-header__inner {
    padding-inline: 80px;
}
@media (max-width: 992px) {
    body.home .yl-header:not(.is-solid):not(.menu-open) .yl-header__inner { padding-inline: 40px; }
}
@media (max-width: 480px) {
    body.home .yl-header:not(.is-solid):not(.menu-open) .yl-header__inner { padding-inline: 20px; }
}
