/*
 * Header navigation overrides.
 * Loaded after style.css / v2.css, before ltr-overrides.css.
 *
 * The main nav carries content only (Files / Repositories / Links). Utility
 * actions (account, language, contact, help) live in a right-side widget on
 * desktop and inside the mmenu drawer on mobile — never both at once.
 */

/* The lightweight homepage bundle omits the full icon catalog. Keep the four
   header glyphs here so utility actions never render as empty circles. */
@font-face {
    font-family: "simple-line-icons";
    src: url("../fonts/simple-line-iconsc05f.woff") format("woff");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

.sl {
    font-family: "simple-line-icons" !important;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sl-icon-envelope-open::before { content: "\e01e"; }
.sl-icon-globe::before { content: "\e037"; }
.sl-icon-login::before { content: "\e066"; }
.sl-icon-info::before { content: "\e08b"; }

/* Navigation uses a broader IconsMind set than the homepage cards. Scope the
   existing full font to the menu so cards keep their tiny subset font. */
@font-face {
    font-family: "iconsmind-navigation";
    src: url("../fonts/iconsmindca27.woff") format("woff");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

#navigation .im,
.mm-menu .im {
    font-family: "iconsmind-navigation" !important;
}

.im-icon-Books::before { content: "\e6d7"; }
.im-icon-Blackboard::before { content: "\e6c7"; }
.im-icon-Magnifi-Glass2::before { content: "\ea6f"; }
.im-icon-Music-Player::before { content: "\eae8"; }
.im-icon-Video-4::before { content: "\edc9"; }
.im-icon-Open-Book::before { content: "\eb24"; }
.im-icon-Chinese-Temple::before { content: "\e754"; }
.im-icon-Conference::before { content: "\e7b0"; }
.im-icon-Laptop::before { content: "\ea17"; }
.im-icon-Tablet-Phone::before { content: "\ed0d"; }
.im-icon-TV::before { content: "\ed90"; }
.im-icon-Old-Radio::before { content: "\eb17"; }
.im-icon-Mail-Send::before { content: "\ea87"; }

/* ---------- utility zone: desktop only ---------- */

@media (min-width: 1025px) {
    /* The mmenu drawer is a clone of #navigation with the id stripped, so
       scoping to #navigation hides these in the desktop bar only. */
    #navigation .nav-utility {
        display: none;
    }
}

@media (max-width: 1024px) {
    .header-utility {
        display: none !important;
    }
}

.header-utility {
    float: left;
    width: auto;
    display: inline-block;
}

.header-utility .header-widget {
    display: flex;
    align-items: center;
    height: auto;
    top: 0;
    margin-top: 8px;
}

.header-utility .header-widget .button.border {
    min-width: 0;
    padding: 7px 18px;
    margin: 0 0 0 6px;
}

.utility-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 2px;
    border-radius: 50%;
    color: #666;
    font-size: 17px;
    transition: background-color 0.2s, color 0.2s;
}

.utility-link:hover,
.utility-link:focus {
    background-color: rgba(0, 0, 0, 0.06);
    color: #222;
    text-decoration: none;
}

.utility-link i {
    top: 0 !important;
    padding: 0 !important;
}

/* ---------- utility dropdown (language, account) ---------- */

.utility-dropdown {
    position: relative;
}

.utility-dropdown > ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    min-width: 160px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.2s;
    z-index: 100000;
}

.utility-dropdown:hover > ul,
.utility-dropdown:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.utility-dropdown > ul li a {
    display: block;
    padding: 7px 18px;
    color: #444;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}

.utility-dropdown > ul li a:hover {
    background-color: #f6f6f6;
    text-decoration: none;
}

.utility-dropdown > ul li a.is-current {
    font-weight: 600;
}

/* ---------- mega menu ---------- */

/* The theme ships a 42% horizontal offset tuned for an LTR demo; in RTL that
   pushes the panel past the right edge of the viewport. Anchor it to the
   parent item instead. */
#navigation ul li .mega-menu {
    transform: translate3d(0, 24px, 0);
}

#navigation ul li:hover .mega-menu {
    transform: translate3d(0, 12px, 0);
}

/* ---------- logo tagline ---------- */

#logo .site-tagline {
    display: block;
    max-width: 320px;
    font-size: 13px;
    line-height: 18px;
    opacity: 0.75;
}

/* The tagline is a full sentence; below ~1367px it eats the width the nav
   needs and forces the bar onto a second row. */
@media (max-width: 1366px) {
    #logo .site-tagline {
        display: none;
    }
}
