@keyframes rtMenuFadeIn {
  0% {
    opacity: 0;
  }
  66% {
    opacity: 0;
    animation-timing-function: ease-out;
  }
  100% {
    opacity: 1;
    animation-timing-function: ease-in; 
  }
}

#rtMenu {
    --rtMenu-submenu-background-color: #505050;
    --rtMenu-submenu-border-color:     #333333;
}

#rtMenu {
    position: relative;
    z-index: 100;
    background-image: url(/images/ui/rtMenu.background.svg);
	background-size: 100% 50px;
    background-position: top left;
	background-repeat: no-repeat !important;
    font-family: "Roboto";
    border-radius: 5px;
    height: 40px;
    clear: both;
    margin-left: 10px;
    margin-right: 10px;
}

#rtMenu > nav {
    display: none;
    grid-auto-flow: column;
    grid-auto-columns: var(--rtShade-carousel-slide-width);
    gap: 0;
    padding: 0 20px 0 20px;
}

#rtMenu.init > nav {
    display: grid;
}

#rtMenu * {
    background-repeat: no-repeat;
    box-sizing: border-box;
    -webkit-touch-callout: none; /* iOS Safari */
      -webkit-user-select: none; /* Safari */
       -khtml-user-select: none; /* Konqueror HTML */
         -moz-user-select: none; /* Old versions of Firefox */
          -ms-user-select: none; /* Internet Explorer/Edge */
              user-select: none; /* Non-prefixed version, supported by Chrome, Edge, Opera and Firefox */
}

#rtMenu > nav a {
    color: #f0f0f0;
    text-decoration: none !important;
}

#rtMenu > nav a:hover {
    color: #ffffff;
}

/* top-level links */
#rtMenu > nav > div {
    display: grid;
    align-content: center;
    width: fit-content;
    white-space: nowrap;
    position: relative;
    padding-left: 10px;
    height: 40px;
}

#rtMenu > nav > div > a {
    display: block;
    width: fit-content;
    font-size: 16px;
    font-weight: 700;
}

@keyframes fadein{
    0% { opacity:0; }
    25% { opacity:0; }
    100% { opacity:1; }
}

/* submenu roots */
#rtMenu > nav > div > div {
    display: none;
    position: absolute;
    grid-template-columns: auto auto;
    gap: 0px 20px;
    background-color: var(--rtMenu-submenu-background-color);
    border: 1px solid var(--rtMenu-submenu-border-color);
    padding: 10px;
    border-top: none;
    border-radius: 0 0 5px 5px;
    top: 40px;
    left: -1px;
    opacity: 0;
    transition: opacity .5s ease-out;
    /* box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.15); */
    animation-name: rtMenuFadeIn;;
    animation-duration: 0.666s;
    transition: opacity, display;
    transition-behavior: allow-discrete;
}

/* top-level items with dropdown */
#rtMenu > nav > div:has(div) > a {
    background-image: url(/images/ui/rtMenu.drop.svg);
    background-position: right 10px center;
    background-size: 14px auto;
    padding-right: 30px;
}

/* show submenu */
#rtMenu > nav > div:has(div):hover > div {
    display: grid;
    opacity: 1;
}

/* submenu parent on hover */
#rtMenu > nav > div:has(div):hover {
    border-radius: 5px 5px 0 0;
    background-color: var(--rtMenu-submenu-background-color);
    border-color: var(--rtMenu-submenu-border-color);
}

/* all submenu links */
#rtMenu > nav > div > div a {
    display: block;
    margin: 15px;
    color: #d0d0d0l
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.55);
    font-size: 14px;
}

#rtMenu > nav > div > div a:hover {
    color: #ffffff;
}

/* submenu groups */

#rtMenu > nav > div > div > div {
    float: left;
    margin-right: 20px;
}
/*
#rtMenu > nav > div#rtMenu-knowledge > div {
    display: grid;
}
*/


#rtMenu .mobile-only {
    display: none;
}

#rtMenu.mobile {
    display: grid;
    cursor: pointer;

    .mobile-only { display: block; }
    
    > nav {
        display: none;
        grid-auto-flow: row;
        padding: 0;
        transition: height 0.3s ease, display 0.3s ease;
        transition-behavior: allow-discrete;
        overflow: clip;
        height: 0;
    }
    
    > nav > div {
        height: auto;
        width: auto;
        padding: 0px;
        border-radius: 0 !important;
        background-color: var(--rtMenu-submenu-background-color) !important;
        cursor: default;
    }
    
    > nav > div > a {
        background-image: none !important;
        background-color: transparent !important;
        padding: 10px;
        cursor: pointer;
    }
    
    > nav > div:first-child {
        margin-top: 40px;
    }
    
    > nav > div:last-child {
        border-radius: 0 0 5px 5px !important;
    }
    
    > nav > div > div {
        display: none !important;
    }
        
    > nav > div:first-child > a {
         margin-top: 10px;
    }

    > nav > div:last-child > a {
         margin-bottom: 10px;
    }

    > nav > div > a {
        padding-left: 20px;
        padding-right: 20px;
    }
}

#rtMenu.mobile.expanded {
	height: auto;
    border-radius: 5px 5px 0 0;
    > nav {
        display: grid;
        height: auto;
    }
}

#rtMenu.mobile::before {
    position: absolute;
    content: "MENU";
    font-size: 25px;
    font-weight: bold;
    line-height: 1em;
    color: #f0f0f0;
    display: inline-block;
    height: 25px;
    aspect-ratio: 1/1;
    background-image: url(/images/ui/rtMenu.mobile.svg);
    background-repeat: no-repeat;
    background-size: 20px auto;
    background-position: right center;
    margin: 7.5px 7.5px 0 0;
    padding-right: 35px;
    justify-self: end;
}

