/*
|--------------------------------------------------------------------------
| Site navigation styles
|--------------------------------------------------------------------------
|
| Everything that styles the top navigation: the desktop bars, the mobile
| menu and the user dropdown. Loaded by the layouts AFTER app.css, so these
| rules take priority over any copies still left in app.css.
|
| The first part is the existing nav CSS, moved out of the compiled app.css
| unchanged. The last part ("Additions") styles the new config-driven nav.
|
*/

/* Wrapper and breakpoints */

.nav-wrapper {
    max-width: 100vw;
    width: 100%;
    z-index: 5;
}

.nav-wrapper #mobile-nav {
    display: none;
}

@media (max-width:991px) {
    #desktop-nav {
        display: none;
    }

    #mobile-nav {
        display: block !important;
    }
}

@media (max-width:767px) {
    .site-name-text {
        display: none;
    }
}

/* ======================================================================
   Mobile: top bar (logo, Explore button, user)
   ====================================================================== */

#mobile-main-nav {
    align-items: center;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    max-height: 60px;
    max-width: 100vw;
}

#mobile-main-nav #nav-user,
#mobile-main-nav .site-name {
    padding-bottom: 1rem;
    padding-top: 1rem;
}

#mobile-main-nav .menu-trigger {
    margin-left: auto;
}

/* ======================================================================
   Mobile: the Explore menu
   ====================================================================== */

#mobile-nav-list {
    align-items: center;
    background-color: #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 0;
    overflow: hidden;
    padding: 0 1rem;
    transition: max-height .3s;
}

#mobile-nav-list.show {
    max-height: 100vh !important;
}

#mobile-nav-list #close-mobile-links {
    border: 1px solid;
    border-radius: 4px;
    margin-top: 1rem;
    padding: .25rem 2rem;
}

#mobile-nav-list .nav-item {
    border-bottom: 1px solid #ddd;
    color: #000;
    font-size: 1rem;
    padding: .5rem 1rem;
    width: 100%;
}

#mobile-nav-list .collapsible-toggle {
    display: block;
}

#mobile-nav-list .collapsible-menu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height .05s;
}

#mobile-nav-list .collapsible-menu.show {
    max-height: 100vh !important;
}

#mobile-nav-list .collapsible-menu .collapsible-item {
    padding: .5rem 1rem;
}

/* ======================================================================
   Shared: logo and site name
   ====================================================================== */

.site-name {
    font-size: 1.2rem;
    margin-left: 2rem;
}

.site-logo {
    height: 50px;
    margin-right: .5rem;
    width: 50px;
}

/* ======================================================================
   Desktop: main bar
   ====================================================================== */

#main-nav {
    align-items: center;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    max-height: 60px;
}

#main-nav #nav-user,
#main-nav .site-name {
    padding-bottom: 1rem;
    padding-top: 1rem;
}

#main-nav nav {
    border-right: 1px solid #eee;
    height: 100%;
}

#main-nav a.nav-item {
    padding: 1rem;
}

#main-nav .nav-item {
    align-items: center;
    display: flex;
    height: 60px;
}

#main-nav .nav-item span.dropdown-toggle {
    padding: 1rem;
}

#main-nav #nav-user.show,
#main-nav #nav-user:hover,
#main-nav .nav-item.show,
#main-nav .nav-item:hover {
    background: rgba(72,145,150,.2);
}

#main-nav nav {
    margin-left: auto;
}

#main-nav nav,
#nav-user {
    align-items: center;
    display: flex;
}

/* ======================================================================
   User menu (desktop and mobile)
   ====================================================================== */

#nav-user {
    max-height: 60px;
    position: relative;
}

#nav-user .dropdown-menu {
    width: 15rem;
}

#nav-user .notifications-badge {
    background-color: #ddd;
    border-radius: 12px;
    font-size: 10px;
    padding: .15rem .75rem;
}

#nav-user>a {
    padding-left: 1rem;
    padding-right: 1rem;
}

#nav-user .user-img {
    border-radius: 50%;
    height: 32px;
    margin-right: 8px;
    width: 32px;
}

#nav-user .user-name {
    font-size: 1rem;
}

#nav-user .notifications-indicator {
    background-color: #dc143c;
    border-radius: 8px;
    height: 16px;
    left: 10px;
    position: absolute;
    top: 10px;
    width: 16px;
}

/* ======================================================================
   Desktop: secondary bar
   ====================================================================== */

#secondary-nav {
    align-items: center;
    background-color: #f1f5f9;
    display: flex;
    height: 45px;
    justify-content: center;
    position: relative;
}

#secondary-nav .nav-item {
    align-items: center;
    border-right: 1px solid #ddd;
    color: #000 !important;
    display: flex;
    height: 100%;
}

#secondary-nav .nav-item:first-child {
    border-left: 1px solid #ddd;
}

#secondary-nav .nav-item.show,
#secondary-nav .nav-item:hover {
    background-color: rgba(72,145,150,.2);
}

#secondary-nav .nav-item.dropdown>span,
#secondary-nav a.nav-item {
    align-items: center;
    display: flex;
    height: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ======================================================================
   Clock
   ====================================================================== */

.nav-clock {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    margin-right: 1rem;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
}

/* ======================================================================
   Additions for the config-driven nav (config/lorekeeper/site_nav.php)
   ====================================================================== */

/* Highlight the section you are currently in (desktop) */
#main-nav .nav-item.active,
#secondary-nav .nav-item.active {
    box-shadow: inset 0 -3px 0 rgba(72, 145, 150, 0.9);
}

#main-nav .dropdown-menu .dropdown-item.active,
#secondary-nav .dropdown-menu .dropdown-item.active {
    background: rgba(72, 145, 150, 0.2);
    color: #000;
    font-weight: 700;
}

/* Group headings inside a dropdown */
#main-nav .dropdown-header,
#secondary-nav .dropdown-header {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Mobile: highlight, headings and dividers inside the Explore menu */
#mobile-nav-list .nav-item.active > .collapsible-toggle,
#mobile-nav-list a.nav-item.active {
    font-weight: 700;
}

#mobile-nav-list .collapsible-item.active {
    background: rgba(72, 145, 150, 0.2);
    font-weight: 700;
}

#mobile-nav-list .collapsible-header {
    color: #6c757d;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem 0.1rem;
    text-transform: uppercase;
}

#mobile-nav-list .collapsible-divider {
    border-top: 1px solid #ddd;
    margin: 0.25rem 1rem;
}

/* Mobile: tapping the little caret now opens the menu too (before, only tapping the text did) */
#mobile-nav-list .collapsible-toggle i {
    pointer-events: none;
}
