@import "vars";

nav a {
    opacity: .8;
    cursor: pointer;

    &:hover, &:focus {
        opacity: 1;
    }
}


/* Menu */

#logo {
    position: relative; display: block;
    width: 100%;
    margin-bottom: 10px;
    opacity: 1;
    background: var(--logo-bg);
    transition: .15s ease;

    @media screen and (max-width: @tiny) {
        width: auto; height: 100%; margin-bottom: 0;
    }

    &:hover, &:focus {
        background: var(--logo-active);

        img {
            filter: drop-shadow(var(--logo-shadow));
        }
    }

    img {
        display: block; height: 65px;
        margin: 0 auto; padding: 0;
        filter: drop-shadow(0 0 2px rgba(0, 0, 0, .0));
        transition: filter .15s ease;

        @media screen and (max-width: @small) {
            width: 60px; height: inherit;
            margin-bottom: -4.5px;
        }
        @media screen and (max-width: @micro) {
            width: 50px;
        }
    }
}

#light-menu {
    position: fixed; z-index: 10;
    list-style: none;
    width: 110px;
    height: 100%; overflow-y: auto;
    margin: 0; padding: 0;
    text-indent: 0; font-size: 13px;
    background: var(--background); box-shadow: var(--shadow);

    @media screen and (max-width: @tiny) {
        position: unset;
        display: flex; flex-direction: row; align-items: center;
        width: 100%; height: 60px;
        overflow-x: auto; overflow-y: hidden;
    }
    @media screen and (max-width: @micro) {
        height: 50px;
    }


    li {
        width: 100%;
        color: var(--text);

        @media screen and (max-width: @tiny) {
            display: flex; flex-direction: column;
            align-items: center; flex-grow: 1;
            padding: 0 2px; font-size: 12px;
        }

        & > a {
            display: flex; flex-direction: column; flex-grow: 0;
            align-items: center; justify-content: center;
            width: 100%; height: 100%;
            margin: 20px 0;
            color: var(--text);
            transition: opacity .15s ease; /* because Chrome sucks */

            /* Avatar */
            & > img {
                display: block; width: 60px; flex-shrink: 0; flex-grow: 0;
                margin: 0 7px 5px 7px;
                border-radius: 10%;

                @media screen and (max-width: @tiny) {
                    width: 45px;
                    margin: 0;

                    & ~ div {
                        display: none;
                    }
                }
                @media screen and (max-width: @micro) {
                    width: 40px;
                }
            }

            & > svg {
                display: block; width: 25px; flex-shrink: 0; flex-grow: 0;
                margin: 0 7px;

                & > path {
                    fill: var(--icons);
                }
            }

            & > div {
                @media screen and (max-width: @micro) {
                    display: none;
                }
            }
        }
    }
}


/* Overlay */
#menu {
    position: fixed; z-index: 5;
    left: -190px; width: 300px; /* default: left-to-right animation */
    height: 100%; overflow-x: hidden; overflow-y: auto;
    font-size: 13px;
    background: var(--background); color: var(--text);
    box-shadow: var(--shadow);
    transition: .15s ease;

    @media screen and (max-width: @tiny) {
        width: 100%; height: 0; overflow-x: hidden;
        font-family: NotoSans;
        transition: .1s ease;
        position: unset;
        left: unset;
    }

    &.opened {
        left: 110px;

        @media screen and (max-width: @tiny) {
            height: 100%;
            overflow-y: auto;
            left: unset;
        }
    }

/* Set class="scroll-animation" to menu to apply scroll animation */
    &.scroll-animation {
        left: 110px; width: 0;
        &.opened {
            width: 300px;
        }
    }

    & > div {
        width: 300px;
        padding: 16px;
        display: none;

        @media screen and (max-width: @tiny) {
            width: 100%;
            padding-bottom: 2px;
        }

        &.opened {
            display: block;
        }
    }

    h2 {
        margin: 0 0 20px 0;
        font-family: Cantarell; font-weight: bold; font-size: 18px;
        color: var(--text);
        display: flex; align-items: center;

        @media screen and (max-width: @micro) {
            font-size: 15px;
        }

        a {
            margin: 0;
            font-size: inherit; opacity: inherit;

            &:hover, &:focus {
                text-decoration: underline;
            }
        }

        & > svg {
            width: 32px; vertical-align: middle; margin-right: 8px;

            @media screen and (max-width: @micro) {
                width: 24px;
            }
        }

        img {
            height: 48px; vertical-align: middle; margin-right: 10px;
        }
    }

    h3 {
        margin: 16px 0;
        font-family: Cantarell; font-weight: bold; font-size: 15px;
        color: var(--text);
    }

    hr {
        margin: 15px 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    ul {
        margin: 0; padding: 0; list-style: none;
    }

    a, li {
        display: block; margin: 10px 0;
        color: var(--text);
        transition: opacity .15s ease;
    }

    li > a {
        display: inline;
        margin: 0; font-style: normal;
        font-size: 13px;
    }

    a > img {
        vertical-align: middle;
        margin-right: 15px;
    }

    a > svg {
        width: 20px; height: 20px; vertical-align: middle;
        margin-right: 10px;
    }

    /* Login form */
    form {
        padding: 0 8%;

        @media screen and (max-width: @tiny) {
            padding: 0;
        }

        input[type="text"],
        input[type="password"] {
            margin: 8px 0; padding: 5px 2%;
            font-size: 14px;
            border: var(--input-border);
            background: var(--input-bg);
            color: var(--input-text);
            opacity: .8;

            &:focus {
                opacity: 1;
            }
        }

        input[type="submit"] {
            width: 100%;
            margin: 8px 0 5px 0;
        }

        label {
            font-size: 13px; opacity: .8;
        }
    }
}
