/***********************************************************************
/ global menu
/ Copyright (C) Logic Lovers Inc.
/ Released under the MIT License, https://opensource.org/licenses/MIT
/***********************************************************************/

/* base settings */
div#globalmenu {
    position: relative;
    font-family: sans-serif;
    font-size: 90%;
    z-index: 1000; /* in front of others completely */
}

/***********************************************************************
/ definitions
/***********************************************************************/
div#globalmenu {
    --globalmenu-bgcolor: white; /* #d7ddd7; */
    --globalmenu-textcolor: #333333;
    --globalmenu-slidebuttoncolor: #777777;
    --globalmenu-hovercolor: #2c7805;
    --globalmenu-hoverbg: rgba(126, 188, 96, 0.1);
    --globalmenu-undelinecolor: var(--globalmenu-hovercolor);
    --globalmenu-overlaybgcolor: var(--globalmenu-bgcolor);
    --globalmenu-overlaymainbg: rgba(0, 0, 0, 0.3);
    --globalmenu-bordercolor: #aaaaaa;
}

/***********************************************************************
/ menu items
/***********************************************************************/
/* ul,li */
div#globalmenu .menuitems {
    display: flex;
    justify-content: right; /* center; */
    background-color: var(--globalmenu-bgcolor);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0px;
    padding: 0px;
    padding-right: 0.5em;
}
div#globalmenu .menuitems ul {
    display: flex;
    list-style: none;
    margin: 0px;
    padding: 0px;
    background-color: inherit;
}
div#globalmenu .menuitems li {
    margin: 0px;
    padding: 0px;
    background-color: inherit;
}
div#globalmenu .menuitems li a {
    margin: 0px;
    padding: 5px 6px;
}
div#globalmenu .menuitem {
    display: block;
    padding: 0.5em 1.0em; /* 1em 1.5em; */
    color: var(--globalmenu-textcolor);
    background-color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden; /* for hover vfx */
}
/* hover vfx : holizontal line */
div#globalmenu .menuitem::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--globalmenu-undelinecolor);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
div#globalmenu .menuitem:hover {
    color: var(--globalmenu-hovercolor);
}
div#globalmenu .menuitem:hover::before {
   width: 100%;
}
/* hover vfx : background color */
div#globalmenu .menuitem::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--globalmenu-hoverbg);
    transition: all 0.4s ease;
    /*z-index: -1;*/
}
div#globalmenu .menuitem:hover::after {
    left: 0;
}

/***********************************************************************
/ slide menu (menutoggle)
/***********************************************************************/
/* toggle menu (default display none) */
div#globalmenu .menutoggle {
    display: none;
    position: absolute;
    top: 6px;
    right: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 1002;
}

/* slide trigger (3 lines button) */
div#globalmenu .slidebutton {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
div#globalmenu .slidebutton span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--globalmenu-slidebuttoncolor);
    border-radius: 3px;
    transition: all 0.3s ease;
}
/* slide trigger (cross button) */
div#globalmenu .menutoggle.active .slidebutton span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
div#globalmenu .menutoggle.active .slidebutton span:nth-child(2) {
    opacity: 0;
}
div#globalmenu .menutoggle.active .slidebutton span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* body overlay for smart device */
div#globalmenu .menuoverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--globalmenu-overlaymainbg);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
div#globalmenu .menuoverlay.active {
    opacity: 1;
}

/***********************************************************************
/ for smart device
/***********************************************************************/
/* slide menu */
@media (max-width: 768px) {

    /* slide from right */
    div#globalmenu .menutoggle {
        display: block;
    }

    /* vertical menu items */
    div#globalmenu .menuitems {
        position: fixed;
        top: 0;
        right: -13em; /* -280px out of screen */
        width: 12em; /* 250px; */
        max-height: 100%;
        background-color: var(--globalmenu-overlaybgcolor);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-out;
        z-index: 1001;
        padding-top: 2px;  /* 60px */
    }
    div#globalmenu .menuitems.active {
        right: 0; /* into the screen */
    }
    div#globalmenu .menuitems ul {
        flex-direction: column;
        width: 100%;
    }
    div#globalmenu .menuitems li {
        width: 100%;
    }
  
    /* border */
    div#globalmenu .menuitem {
        padding: 0.7em 1em;  /* 1em */
        border-bottom: 1px solid var(--globalmenu-bordercolor);
    }
  
    /* hover vfx in slide menu : vertical line */
    div#globalmenu .menuitem::before {
        left: 0;
        bottom: 0;
        transform: none;
    }
    div#globalmenu .menuitem:hover::before {
        width: 5px;
        height: 100%;
    }
  
    /* body overlay */
    div#globalmenu .menuoverlay {
        display: block;
        pointer-events: none;
    }
    div#globalmenu .menuoverlay.active {
        pointer-events: auto;
    }
  
    /* body overlay prevent touch main article */
    body.globalslidemenuopen {
        overflow: hidden;
    }

    /* tap vfx */
    div#globalmenu .menuitem:active {
        background-color: var(--globalmenu-hoverbg);
    }
}


