/* ==========================================================================
   04_NAVIGATION: MAIN
   --------------------------------------------------------------------------
   * README

   * DESKTOP AND MOBILE
   ========================================================================== */

/* README
   ========================================================================== */

/*!
 * Styles on this stylesheet are the Main Navigation default styles.
 * That means they apply to the HTML you can find inside
 * {% block header__nav %}{% endblock %} in the headerContent.tpt file, and
 * therefore, they apply to all site pages.

 * At the moment we have not had to deal with any exception to these Main
 * Navigation default styles, but if it becomes necessary, let's talk about it
 * and use the opportunity to find the best approach to deal with it - as the
 * code it is already complex enough and I'm not happy with it.
 */

/* DESKTOP AND MOBILE
   ========================================================================== */

/* Structure
   -------------------------------------------------------------------------- */
.skip-content,
.skip-content:link,
.skip-content:visited {
    position: fixed;
    top: -40px;
    width: 300px;
    left: 50%;
    margin-left: -150px;
}

.skip-content.visibility--visually-hidden.focusable:active,
.skip-content.visibility--visually-hidden.focusable:focus {
    position: fixed;
    top: 0px;
    left: 50%;
    margin-left: -150px;
    width: 300px;
    max-width: 300px;
    padding: 0.25em;
}

/* Behaviour
   -------------------------------------------------------------------------- */
.tpt_menuLeftSlideTrigger,
.tpt_menuLeftSlideAllTrigger {
    display: none;
}

.nav [class$="__item__link"] {
    display: inline-block;
    white-space: nowrap;
    -webkit-transition: color 0.3s;
    -ms-transition: color 0.3s;
    transition: color 0.3s;
}

.skip-content,
.skip-content:link,
.skip-content:visited {
    transition-property: top;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Appearance
   -------------------------------------------------------------------------- */

.nav__item__link:hover {
    color: #0259A3; /* Theme color defined in #16, with an override for each Library use as IE fallback */
}

.nav__item__link:focus {
    color: var(--color--site--65); /* Theme color defined in #16, with an override for each Library use as IE fallback */
}

.nav__item--with-subnav:hover .subnav__item__link:hover {
    color: #0259A3; /* Theme color defined in #16, with an override for each Library use as IE fallback */
}

.nav__item--with-subnav:hover .subnav__item__link:focus {
    color: var(--color--site--65); /* Theme color defined in #16, with an override for each Library use as IE fallback */
}

.skip-content,
.skip-content:link,
.skip-content:visited {
    border-radius: 0 0 5px 5px;
    -webkit-box-shadow: 0 0 12px 0 rgba(91, 91, 91, .3);
    box-shadow: 0 0 12px 0 rgba(91, 91, 91, .3);
    background-color: #FFFFFF;
    text-align: center;
}

/* NAV
   ========================================================================== */

    /* Structure
       -------------------------------------------------------------------------- */
    .nav {
        float: right;
    }

    .nav__list {
        float: left;
    }

    .nav__list--actions {
        padding-right: 0;
    }

    .nav__list--user {
        padding-left: 6px;
    }

    .nav__item {
        float: left;
    }

    .nav__item + .nav__item {
        margin-left: 6px;
    }

    .nav__item__link {
        padding: 9px 0 9px 6px;
    }

    .nav__item--username .nav__item__link:before {
        float: right;
        margin: 10px;
    }

    .nav__item--username .nav__item__link>img {
        float: left;
        margin-right: 10px;
        width: 24px;
    }

    .subnav__list {
        padding: 0 10px;
    }

    .nav__list--actions .subnav__list {
        width: auto;
        min-width: calc(100% + 4px);
    }

    .nav__list--user .subnav__list {
        width: 100%;
    }

    .subnav__item__link {
        padding: 12px 0;
    }

    /* Behaviour
       -------------------------------------------------------------------------- */
    .nav__heading {
        display: none;
    }

    .nav__item--active .nav__item__link {
        cursor: default;
    }

    .subnav__item--active .subnav__item__link {
        cursor: default;
    }

    .nav__item--with-subnav {
        position: relative;
        padding-right: 15px;
    }

    .nav__item--with-subnav .nav__item__link {
        position: relative;
        z-index: 3;
    }

    .subnav__list {
        position: absolute;
        top: 100%;
        left: -9999px;
        z-index: 2;
    }

    .nav__item--with-subnav:hover .subnav__list {
        left: 0;
    }

    /* Appearance
       -------------------------------------------------------------------------- */
    .nav__list--user {
        border-left-width: 1px;
        border-left-style: solid;
        border-left-color: var(--color--borders); /* Theme color defined in #16, with an override for each Library use as IE fallback */
    }

    /*
     * 1. The height of the logged user image
     */
    .nav__item__link {
        line-height: 24px; /* 1 */
    }

    .nav__item--active .nav__item__link {
        color: var(--color--site); /* Theme color defined in #16, with an override for each Library use as IE fallback */
    }

    .nav__item--with-subnav:hover .nav__item__link {

        box-shadow: 0;
        border-radius:0;
        background: #FFFFFF;
    }

.nav__item--username .nav__item__link:before {
    content: '';
    border-left: 0;
    border-top: 0;
    border-right: 0;
}

    .nav__item--username .nav__item__link>img {
        border-radius: 100%;
    }

    .subnav__list {
        -webkit-box-shadow: 0 0 12px 0 rgba(91, 91, 91, 0.15);
        box-shadow: 0 0 12px 0 rgba(91, 91, 91, 0.15);
        background: #FFFFFF;
    }

    .nav__list--actions .subnav__list {
        border-radius: 0 4px 4px 4px;
    }

    .nav__list--user .subnav__list {
        border-radius: 0 0 4px 4px;
    }

    .subnav__item+.subnav__item {
        border-top-width: 1px;
        border-top-style: solid;
        border-top-color: var(--color--borders); /* Theme color defined in #16, with an override for each Library use as IE fallback */
    }

    .subnav__item__link {
        font-size: 13px;
    }

    .subnav__item--active .subnav__item__link {
        color: var(--color--site); /* Theme color defined in #16, with an override for each Library use as IE fallback */
    }

    @media all and (min-width:769px) {
        .nav__item--with-subnav .nav__item__link:after {
            content: '';
            border-left: 1px solid #000000;
            border-bottom: 1px solid #000000;
            -moz-transform: rotate(-45deg);
            -webkit-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            transform: rotate(-45deg);
            margin: 11px 5px;
            width: 8px;
            height: 8px;
            display: block;
            position: absolute;
            right: -3px;
            top: 11px;
            float: right;
            margin: 2px 0;
        }
    }
