/*--------------------------------------------------------------
# Header LNCI (toutes les pages)
# Charte : blanc, anthracite, orange #fba919 — titres Ubuntu, textes Open Sans.
# Desktop ≥ 992px : barre + mega-menu. Mobile < 992px : panneau latéral.
--------------------------------------------------------------*/

.lnci-header {
    --h-orange: #fba919;
    --h-orange-dark: #e39400;
    --h-ink: #111111;
    --h-anthracite: #16171a;
    --h-muted: #5a5e66;
    --h-line: #ececea;
    --h-soft: #f6f5f2;
    --h-topbar: 40px;
    --h-bar: 84px;
    --h-bar-compact: 68px;
    --h-ease: cubic-bezier(.2, .7, .2, 1);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    font-family: 'Open Sans', Arial, sans-serif;
    transition: transform .35s var(--h-ease);
}

.admin-bar .lnci-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .lnci-header { top: 46px; } }

.lnci-header a { text-decoration: none; }

.lnci-header a:focus-visible,
.lnci-header button:focus-visible {
    outline: 3px solid var(--h-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Barre de contact ---------- */

.lnci-topbar {
    height: var(--h-topbar);
    background: var(--h-anthracite);
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    overflow: hidden;
}

.lnci-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    height: 100%;
}

.lnci-topbar__inner::before,
.lnci-topbar__inner::after,
.lnci-bar__inner::before,
.lnci-bar__inner::after { display: none; } /* clearfix Bootstrap du .container */

.lnci-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit !important;
    white-space: nowrap;
    transition: color .2s ease;
}

.lnci-topbar__item svg {
    width: 15px;
    height: 15px;
    color: var(--h-orange);
}

a.lnci-topbar__item:hover { color: #fff !important; }

.lnci-topbar__item--address {
    margin-right: auto;
    order: -1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Barre principale ---------- */

.lnci-bar {
    position: relative;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid transparent;
    transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.lnci-bar__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: var(--h-bar);
    transition: height .35s var(--h-ease);
}

.lnci-brand { flex: none; }

.lnci-brand .custom-logo-link { display: block; }

.lnci-brand .custom-logo {
    display: block;
    width: auto !important;
    height: 62px;
    transition: height .35s var(--h-ease), transform .3s var(--h-ease);
}

.lnci-brand .custom-logo-link:hover .custom-logo { transform: scale(1.03); }

.lnci-brand__text {
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--h-ink) !important;
}

/* État au défilement : barre de contact masquée, barre compacte en verre dépoli */
.lnci-header.has-topbar.is-scrolled { transform: translateY(calc(-1 * var(--h-topbar))); }

.lnci-header.is-scrolled .lnci-bar {
    background: rgba(255, 255, 255, .86);
    border-bottom-color: var(--h-line);
    box-shadow: 0 10px 30px rgba(17, 17, 17, .08);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
}

.lnci-header.is-scrolled .lnci-bar__inner { height: var(--h-bar-compact); }
.lnci-header.is-scrolled .lnci-brand .custom-logo { height: 48px; }

/* Barre de progression de lecture */
.lnci-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    pointer-events: none;
}

.lnci-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--h-orange), var(--h-orange-dark));
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* ---------- Navigation (desktop) ---------- */

.lnci-panel {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
}

.lnci-nav__list,
.lnci-subnav {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lnci-nav__list {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lnci-nav__item {
    position: relative;
    display: flex;
    align-items: center;
}

.lnci-nav__link {
    position: relative;
    display: block;
    padding: 10px 14px;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--h-ink) !important;
    transition: color .2s ease;
}

.lnci-nav__link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 3px;
    border-radius: 3px;
    background: var(--h-orange);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .35s var(--h-ease);
}

.lnci-nav__item:hover > .lnci-nav__link::after,
.lnci-nav__item.is-open > .lnci-nav__link::after,
.lnci-nav__link:focus-visible::after,
.lnci-nav__item.is-current > .lnci-nav__link::after { transform: scaleX(1); }

.lnci-nav__item.has-children > .lnci-nav__link { padding-right: 4px; }
.lnci-nav__item.has-children > .lnci-nav__link::after { right: 0; }

.lnci-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--h-ink);
    cursor: pointer;
    transition: transform .3s var(--h-ease), background-color .2s ease;
}

.lnci-nav__toggle svg { width: 16px; height: 16px; }

.lnci-nav__item.has-children:hover > .lnci-nav__toggle,
.lnci-nav__item.is-open > .lnci-nav__toggle {
    transform: rotate(180deg);
    background: var(--h-soft);
}

/* Mega-menu */
.lnci-subnav {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 680px;
    padding: 16px;
    background: #fff;
    border-top: 3px solid var(--h-orange);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 24px 60px rgba(17, 17, 17, .16);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 12px);
    transition: opacity .25s ease, transform .3s var(--h-ease), visibility 0s linear .3s;
}

/* zone tampon pour garder le survol entre le lien et le panneau */
.lnci-subnav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -24px;
    height: 24px;
}

.lnci-nav__item.has-children:hover > .lnci-subnav,
.lnci-nav__item.is-open > .lnci-subnav {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .25s ease, transform .3s var(--h-ease), visibility 0s;
}

.lnci-subnav__link {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--h-ink) !important;
    transition: background-color .2s ease, transform .25s var(--h-ease);
}

.lnci-subnav__link:hover,
.lnci-subnav__link:focus-visible,
.lnci-subnav__item.is-current > .lnci-subnav__link {
    background: var(--h-soft);
    transform: translateX(4px);
}

.lnci-subnav__thumb {
    flex: none;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .06);
}

.lnci-subnav__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--h-ease);
}

.lnci-subnav__link:hover .lnci-subnav__img { transform: scale(1.08); }

.lnci-subnav__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lnci-subnav__title {
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.lnci-subnav__desc {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--h-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- Bouton d'appel à l'action ---------- */

.lnci-header-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    padding: 13px 22px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--h-orange);
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--h-ink) !important;
    box-shadow: 0 8px 20px rgba(251, 169, 25, .35);
    transition: background-color .25s ease, box-shadow .25s ease, transform .25s var(--h-ease);
}

.lnci-header-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    transition: left .6s var(--h-ease);
}

.lnci-header-cta:hover {
    background: var(--h-orange-dark);
    box-shadow: 0 12px 26px rgba(251, 169, 25, .45);
    transform: translateY(-2px);
}

.lnci-header-cta:hover::before { left: 120%; }

.lnci-header-cta svg { transition: transform .25s var(--h-ease); }
.lnci-header-cta:hover svg { transform: translateX(4px); }

.lnci-header-cta--panel,
.lnci-panel__contact { display: none; }

/* ---------- Burger ---------- */

.lnci-burger {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 8px 4px 8px 10px;
    border: 0;
    background: transparent;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--h-ink);
    cursor: pointer;
}

.lnci-burger__box {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--h-orange);
    transition: background-color .25s ease, transform .3s var(--h-ease);
}

.lnci-burger__box span {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--h-ink);
    transition: transform .35s var(--h-ease), opacity .2s ease, top .35s var(--h-ease);
}

.lnci-burger__box span:nth-child(1) { top: 15px; }
.lnci-burger__box span:nth-child(2) { top: 21px; }
.lnci-burger__box span:nth-child(3) { top: 27px; width: 12px; }

.lnci-burger[aria-expanded="true"] .lnci-burger__box { transform: rotate(90deg); }
.lnci-burger[aria-expanded="true"] .lnci-burger__box span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.lnci-burger[aria-expanded="true"] .lnci-burger__box span:nth-child(2) { opacity: 0; }
.lnci-burger[aria-expanded="true"] .lnci-burger__box span:nth-child(3) { top: 21px; width: 18px; transform: rotate(-45deg); }

.lnci-overlay { display: none; }

/* ---------- Écrans intermédiaires ---------- */

@media (max-width: 1199px) and (min-width: 992px) {
    .lnci-bar__inner { gap: 16px; }
    .lnci-nav__link { padding: 10px 9px; font-size: 14px; letter-spacing: .02em; }
    .lnci-nav__link::after { left: 9px; right: 9px; }
    .lnci-header-cta { padding: 11px 16px; font-size: 14px; }
    .lnci-header-cta svg { display: none; }
    .lnci-subnav { left: 0; transform: translate(-30%, 12px); }
    .lnci-nav__item.has-children:hover > .lnci-subnav,
    .lnci-nav__item.is-open > .lnci-subnav { transform: translate(-30%, 0); }
}

/* ---------- Mobile & tablette : panneau latéral ---------- */

@media (max-width: 991px) {
    .lnci-header { --h-bar: 72px; --h-bar-compact: 64px; }
    .lnci-topbar { display: none; }
    .lnci-header.has-topbar.is-scrolled { transform: none; }
    /* backdrop-filter créerait un bloc conteneur : le panneau fixe doit rester relatif à l'écran */
    .lnci-header.is-scrolled .lnci-bar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .lnci-brand .custom-logo { height: 50px; }
    .lnci-header.is-scrolled .lnci-brand .custom-logo { height: 44px; }
    .lnci-header-cta--bar { display: none; }
    .lnci-burger { display: inline-flex; }

    .lnci-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: min(420px, 88vw);
        padding: 96px 28px 32px;
        overflow-y: auto;
        background: #fff;
        box-shadow: -20px 0 60px rgba(17, 17, 17, .18);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .45s var(--h-ease), visibility 0s linear .45s;
        -webkit-overflow-scrolling: touch;
    }

    .lnci-panel::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--h-orange);
    }

    .lnci-nav-open .lnci-panel {
        transform: none;
        visibility: visible;
        transition: transform .45s var(--h-ease), visibility 0s;
    }

    .lnci-burger { position: relative; z-index: 3; }

    .lnci-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .lnci-nav__item {
        flex-wrap: wrap;
        border-bottom: 1px solid var(--h-line);
        opacity: 0;
        transform: translateX(24px);
        transition: opacity .35s ease, transform .45s var(--h-ease);
    }

    .lnci-nav-open .lnci-nav__item { opacity: 1; transform: none; }
    .lnci-nav-open .lnci-nav__item:nth-child(1) { transition-delay: .08s; }
    .lnci-nav-open .lnci-nav__item:nth-child(2) { transition-delay: .13s; }
    .lnci-nav-open .lnci-nav__item:nth-child(3) { transition-delay: .18s; }
    .lnci-nav-open .lnci-nav__item:nth-child(4) { transition-delay: .23s; }
    .lnci-nav-open .lnci-nav__item:nth-child(5) { transition-delay: .28s; }
    .lnci-nav-open .lnci-nav__item:nth-child(6) { transition-delay: .33s; }

    .lnci-nav__link {
        flex: 1;
        padding: 18px 0;
        font-size: 18px;
        letter-spacing: .02em;
    }

    .lnci-nav__link::after { display: none; }
    .lnci-nav__item.is-current > .lnci-nav__link { color: var(--h-orange-dark) !important; }

    .lnci-nav__toggle {
        width: 40px;
        height: 40px;
        margin: 0;
        background: var(--h-soft);
    }

    .lnci-nav__item.has-children:hover > .lnci-nav__toggle { transform: none; }
    .lnci-nav__item.has-children.is-open > .lnci-nav__toggle { transform: rotate(180deg); background: var(--h-orange); }

    /* sous-menu en accordéon */
    .lnci-subnav {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 0fr;
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        overflow: hidden;
        transition: grid-template-rows .35s var(--h-ease);
    }

    .lnci-subnav::before { display: none; }

    .lnci-nav__item.has-children:hover > .lnci-subnav { transform: none; }

    .lnci-nav__item:not(.is-open) > .lnci-subnav { display: none; }

    .lnci-nav__item.is-open > .lnci-subnav {
        padding-bottom: 12px;
        transform: none;
        animation: lnci-sub-in .35s var(--h-ease);
    }

    .lnci-subnav__link { padding: 8px 6px; }
    .lnci-subnav__link:hover { transform: none; }
    .lnci-subnav__thumb { width: 46px; height: 46px; }
    .lnci-subnav__desc { display: none; }

    .lnci-panel__contact {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: 28px;
        font-size: 14px;
        color: var(--h-muted);
    }

    .lnci-panel__contact > a,
    .lnci-panel__contact > span {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        color: var(--h-muted) !important;
    }

    .lnci-panel__contact svg {
        flex: none;
        margin-top: 1px;
        color: var(--h-orange-dark);
    }

    .lnci-header-cta--panel {
        display: inline-flex;
        justify-content: center;
        margin-top: 28px;
        padding: 16px 22px;
    }

    .lnci-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        display: block;
        background: rgba(17, 17, 17, .45);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        opacity: 0;
        transition: opacity .35s ease;
    }

    .lnci-overlay[hidden] { display: none; }
    .lnci-nav-open .lnci-overlay { opacity: 1; }

    .lnci-nav-open { overflow: hidden; }
}

@media (max-width: 480px) {
    .lnci-burger__label { display: none; }
}

@keyframes lnci-sub-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .lnci-header *,
    .lnci-header *::before,
    .lnci-header *::after,
    .lnci-header,
    .lnci-overlay {
        transition: none !important;
        animation: none !important;
    }
}
