/* ===== custom language switcher (unified inline component) ===== */
header.banner .lang-switcher {
    display: flex;
    align-items: center;
    /* spacing via item margins below (gap can't express per-edge distances) */
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: "aktiv-grotesk", sans-serif;
    font-size: 1.2rem;
    font-weight: normal;
    text-transform: uppercase;
    line-height: 1.4;
    color: #333333;
}

header.banner .lang-switcher__item {
    float: none;
    margin: 0;
}

/* code-to-code spacing */
header.banner .lang-switcher__item + .lang-switcher__item {
    margin-left: .6rem;
}

/* desktop: globe sits a bit closer to FI than codes do to each other */
header.banner .lang-switcher__item--globe + .lang-switcher__item {
    margin-left: .4rem;
}

header.banner .lang-switcher__item > .lang-switcher__code {
    display: inline-block;
    margin-left: 0;
    color: #333333 !important;
    text-decoration: none !important;
    line-height: inherit;
    white-space: nowrap;
    /* reserve the outline-box geometry on every code so item
       positions stay identical when the active language changes */
    border: 1px solid transparent;
    border-radius: 2px;
    padding: .1rem .4rem;
    /* pull the boxed text back up onto the sibling nav links'
       baseline (undoes the +border/+padding-top descent) */
    margin-top: calc(-.1rem - 1px);
}

header.banner .lang-switcher__code.is-current {
    border-color: rgba(51, 51, 51, .3);
}

header.banner .lang-switcher__item.is-disabled .lang-switcher__code {
    opacity: .4;
    cursor: default;
}

header.banner .lang-switcher__item--globe {
    font-size: 1.6rem;
}

header.banner .lang-switcher__item--globe .fa-globe {
    /* 1.6rem glyph inside a ~1.68rem box = the nav links' line box */
    line-height: 1.05;
    /* FA glyphs sit optically a touch low; lift into visual alignment
       with the code text and the search icon */
    display: inline-block;
    transform: translateY(-.08rem);
}

header.banner .lang-switcher__item--globe > .lang-switcher__globe {
    margin-left: 0;
    color: #333333 !important;
    text-decoration: none !important;
}

header.banner a.lang-switcher__code:hover,
header.banner a.lang-switcher__code:focus {
    text-decoration: underline !important;
}

/* tiny downward nudge so the search icon sits level with the globe */
header.banner nav.nav-secondary .li--search .fa-search {
    display: inline-block;
    transform: translateY(.18rem);
}

/* --- desktop placement: rightmost item in nav-secondary --- */
header.banner nav.nav-secondary .li--lang-switcher .lang-switcher {
    /* deliberately wider than globe -> FI */
    margin-left: 1.2rem;
}

@media (max-width: 991px) {
    /* nav-secondary lives inside the off-canvas drawer on mobile; hide the desktop instance */
    header.banner nav.nav-secondary .li--lang-switcher {
        display: none;
    }
}

/* --- mobile placement: inside banner--mobile-navigation, left of the hamburger --- */
header.banner .banner--mobile-navigation .li--lang-switcher-mobile {
    /* generous separation from the hamburger to avoid misclicks */
    margin-right: 2.5rem;
}

/* mobile: a little more room between the codes */
header.banner .banner--mobile-navigation .lang-switcher__item + .lang-switcher__item {
    margin-left: .8rem;
}

/* mobile: extra room between globe and FI (after the rule above
   so equal specificity resolves in its favour) */
header.banner .banner--mobile-navigation .lang-switcher__item--globe + .lang-switcher__item {
    margin-left: 1.2rem;
}

header.banner .banner--mobile-navigation .lang-switcher__code {
    line-height: 3rem;
    /* wider boxes = bigger tap areas */
    padding-left: 1rem;
    padding-right: 1rem;
}

/* fa-bars and fa-close differ in width; pin the icon box so the
   glyph swap doesn't shift the language switcher horizontally */
header.banner .banner--mobile-navigation .site--mobile-trigger i {
    display: inline-block;
    width: 3rem;
    text-align: center;
}
