/* Header navigation: desktop dropdown panels and the mobile menu panel. Shared by both languages. */

/* The header link rule (color, no underline) has specificity 0,1,2: every link rule below is prefixed to win. */

/* Desktop navigation */
.nm-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}

.nm-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

header[id$="-header"] .nm-nav-link,
header[id$="-header"] .nm-nav-trigger {
    color: var(--blue-200);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

header[id$="-header"] .nm-nav-link:hover,
header[id$="-header"] .nm-nav-link:focus-visible,
header[id$="-header"] .nm-nav-link[aria-current="page"],
header[id$="-header"] .nm-nav-item.is-open > .nm-nav-link,
header[id$="-header"] .nm-nav-trigger-label:hover {
    color: var(--neutral-white);
}

.nm-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nm-nav-trigger img {
    display: block;
    transition: transform 0.2s ease;
}

.nm-nav-trigger[aria-expanded="true"] img {
    transform: rotate(180deg);
}

.nm-nav-link:focus-visible,
.nm-nav-trigger:focus-visible,
.nm-nav-panel a:focus-visible {
    outline: 2px solid var(--green-500);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* Dropdown panel: it hangs from the header row (the left and top are set by header-nav.js) */
.nm-nav-panel {
    position: absolute;
    z-index: 1031;
    display: flex;
    padding: 2rem;
    border-radius: 1rem;
    background-color: var(--neutral-white);
    box-shadow: 0 2px 24px 0 rgba(0, 15, 35, 0.24);
}

.nm-nav-panel[hidden] {
    display: none;
}

.nm-nav-silo,
.nm-nav-panel-simple .nm-nav-links {
    width: 15rem;
}

.nm-nav-silo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nm-nav-silo + .nm-nav-silo {
    position: relative;
    margin-left: 3rem;
}

.nm-nav-silo + .nm-nav-silo::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1.53125rem;
    width: 1px;
    background: url("../svg/icons/nav-divider-v.svg") center / 100% 100% no-repeat;
}

header[id$="-header"] .nm-nav-silo-title {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    color: var(--neutral-black);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.nm-nav-silo-title img {
    flex-shrink: 0;
}

.nm-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nm-nav-links li {
    margin: 0;
}

header[id$="-header"] .nm-nav-links a {
    display: block;
    color: var(--blue-500);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

header[id$="-header"] .nm-nav-links a:hover,
header[id$="-header"] .nm-nav-links a[aria-current="page"],
header[id$="-header"] .nm-nav-silo-title:hover {
    text-decoration: underline;
}

/* Spacing of the brand, the language switch and the call button */
header[id$="-header"] .nm-brand {
    margin-right: 0;
}

@media (min-width: 768px) {
    header[id$="-header"] .nm-brand {
        margin-right: 3rem;
    }
}

header[id$="-header"] .nm-lang-desktop {
    margin-right: 1rem;
}

/* The call button never wraps its text */
header[id$="-header"] .d-lg-flex .btn-light {
    padding: 0.75rem 2rem;
    white-space: nowrap;
}

/* Narrow desktops (992px to 1199px): a more compact header row so the logo, the five items, the language and the call button fit in one line */
@media (min-width: 992px) and (max-width: 1199.98px) {
    header[id$="-header"] .nm-brand {
        margin-right: 1.5rem;
    }

    header[id$="-header"] .navbar-brand > img {
        height: 3rem;
    }

    .nm-nav-list {
        gap: 0.5rem 1rem;
    }

    header[id$="-header"] .nm-nav-link,
    header[id$="-header"] .nm-nav-trigger {
        font-size: 0.9375rem;
    }

    header[id$="-header"] .nm-lang-desktop {
        margin-right: 0.5rem;
    }

    header[id$="-header"] .d-lg-flex .btn-light {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }
}

/* The mobile menu is only for small screens */
.nm-mobile-menu {
    flex-direction: column;
    height: 100%;
    background-color: var(--blue-200);
}

@media (max-width: 991.98px) {
    html.nm-menu-open {
        overflow: hidden;
    }

    /* The floating buttons stay above the open panel, which lives inside the header */
    .fixed-cta,
    .fixed-buttons {
        z-index: 1025;
    }

    .nm-mobile-menu {
        display: flex;
    }

    /* Closed bar: burger, logo and language switch */
    header[id$="-header"] .nm-mobile-lang {
        width: 3.15rem;
    }

    header[id$="-header"] .nm-lang-mobile {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    .nm-lang-mobile img {
        display: block;
    }

    /* Bar of the open panel */
    .nm-mobile-bar {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: space-between;
        height: 5rem;
        padding: 0 1.5rem;
        background-color: var(--blue-500);
    }

    .nm-mobile-bar .navbar-brand > img {
        height: 3rem;
    }

    .nm-mobile-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 2rem;
        overflow-y: auto;
        padding: 1.5rem 1.5rem 12rem; /* room for the floating buttons */
        background-color: var(--blue-200);
    }

    .nm-mobile-list {
        margin: 0;
        padding: 0;
    }

    .nm-mobile-item {
        margin: 0 0 1rem;
        padding-bottom: 1rem;
        background: url("../svg/icons/nav-divider-h.svg") bottom / 100% 1px no-repeat;
    }

    .nm-mobile-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    header[id$="-header"] .nm-mobile-link,
    header[id$="-header"] .nm-mobile-trigger {
        color: var(--neutral-black);
        font-size: 1.125rem;
        font-weight: 700;
        line-height: 1.5;
    }

    .nm-mobile-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .nm-mobile-trigger-label {
        width: 100%;
        text-align: left;
    }

    /* The icon of the design points up (open): it is turned down while the list is closed */
    .nm-mobile-trigger img {
        display: block;
        transform: rotate(180deg);
        transition: transform 0.2s ease;
    }

    .nm-mobile-trigger[aria-expanded="true"] img {
        transform: none;
    }

    .nm-mobile-link:focus-visible,
    .nm-mobile-trigger:focus-visible,
    .nm-mobile-panel a:focus-visible {
        outline: 2px solid var(--blue-500);
        outline-offset: 4px;
        border-radius: 0.25rem;
    }

    .nm-mobile-panel {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-top: 2rem;
    }

    .nm-mobile-panel[hidden] {
        display: none;
    }

    .nm-mobile-silo {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    header[id$="-header"] .nm-mobile-silo-title {
        display: inline-flex;
        align-items: center;
        align-self: flex-start;
        gap: 0.5rem;
        margin: 0;
        color: var(--neutral-black);
        font-size: 0.875rem;
        font-weight: 800;
        line-height: 1.25rem;
    }

    .nm-mobile-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
        margin: 0;
        padding: 0;
    }

    header[id$="-header"] .nm-mobile-links a {
        color: var(--blue-500);
        font-size: 1rem;
        font-weight: 800;
        line-height: 1.5;
    }
}

/* Logged-in people: keep the header and the fixed mobile panel clear of the admin bar */
@media (min-width: 601px) and (max-width: 782.98px) {
    body.admin-bar header[id$="-header"].sticky-top {
        top: 46px;
    }
}

@media (min-width: 783px) {
    body.admin-bar header[id$="-header"].sticky-top {
        top: 32px;
    }
}

/* The mobile panel fills the viewport and the admin bar covers its top edge: the content starts below the bar */
@media (max-width: 991.98px) {
    body.admin-bar [id$="-nav-collapse"] {
        padding-top: 46px;
    }
}

@media (min-width: 783px) and (max-width: 991.98px) {
    body.admin-bar [id$="-nav-collapse"] {
        padding-top: 32px;
    }
}

/* Sticky contact buttons on small screens: the Messenger bubble and the two buttons of the design */
@media (max-width: 767.98px) {
    .fixed-cta {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        bottom: 1rem;
    }

    .fixed-buttons {
        bottom: 7.5rem;
    }

    .nm-sticky-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        height: 2.5rem;
        padding: 0.625rem 2rem;
        border: 0;
        border-radius: 2.5rem;
        color: var(--neutral-white);
        font-size: 0.875rem;
        font-weight: 800;
        line-height: 1.25rem;
        filter: drop-shadow(0 2px 12px rgba(0, 15, 35, 0.24));
    }

    .nm-sticky-button:hover,
    .nm-sticky-button:focus {
        color: var(--neutral-white);
    }

    .nm-sticky-contact {
        background-color: var(--blue-500);
    }

    .nm-sticky-call {
        background-color: var(--orange);
    }
}
