
#main-menu {
    /* The menu shall not shrink to avoid line breaks */
    flex-shrink: 0;
width: max-content;
}

#main-menu > nav {
    position: relative;
    top: 50%;
}

nav.menu-items ul {
    padding: 0;
    margin: 0;
}

nav.menu-items {
    display: flex;
    justify-content: center;
    align-items: center;
}

nav.menu-items ul {
    display: flex;
    flex-direction: row;
}

nav.menu-items li {
    position: relative;
    list-style-type: none;

    padding: 0.1em 0  0.1em 1em;
}

/* This disabled section shall add a sub-menu mark
   to the menu entry
 */
@media DISABLED {
    /* placeholder for sub-menu indicator */
    nav.menu-items li.has-children {
        padding-right: 1em;
    }

    /* sub-menu indicator */
    nav.menu-items li.has-children > a::after {
        position: absolute;
        top: 0;
        right: 0.5em; /* corresponds to  padding-right of li.has-children above */
        content: ".";
    }
}

nav.menu-items li a {
    text-decoration: none;
    color:  #f9b333;
    font-weight: bold;
}

/* This doesn't look smooth, yet. :-(  */
/* nav.menu-items li:hover {
    background-color: var(--kk-color-grau);
} */


/* Submenues */ 

nav.menu-items li:hover ul {
    visibility: visible;
}

nav.menu-items li ul {
    visibility: hidden;
    position: absolute;
    background-color: var(--kk-color-header-background);

    display: flex;
    flex-direction: column;

    padding: 0.2em 1em 0.2em 1em;
    margin-left: -1em;
}

nav.menu-items li ul li {
    display: inline-block;
    padding: 0.2em 0;
}


/*
 * Burger initialization
 */

#main-menu input#mm-chkbox {
    display: none;
}

#main-menu .mm-hamburger {
    display: none;
    width: 75px;
    /* height: 50px; */
    height: var(--header-height-small);
    position: relative;
    border-radius: 4px;
}

#main-menu .burgerline {
    position: absolute;
    height: 4px;
    background: #f9b333;
    border-radius: 2px;
    width: 55px;
    display: block;
    left: 10px;
    transition: all 0.5s;
    transform-origin: center;
}

#main-menu .burgerline:nth-child(1) {
    top: 16px;
}
#main-menu .burgerline:nth-child(2) {
    top: 28px;
}
#main-menu .burgerline:nth-child(3) {
    top: 40px;
}

/* Burger Animation */
#main-menu #mm-chkbox:checked ~ .burger-right .mm-hamburger .burgerline:nth-child(1) {
    transform: rotate(-315deg) translateX( 9px) translateY(9px);
}
#main-menu #mm-chkbox:checked ~ .burger-right .mm-hamburger .burgerline:nth-child(2) {
    opacity: 0;
}
#main-menu #mm-chkbox:checked ~ .burger-right .mm-hamburger .burgerline:nth-child(3) {
    transform: rotate( 315deg) translateX( 9px) translateY(-9px);
}



/* 
 * Mobile look with hamburger menu and 
 * full menu overlay
 */

@media screen and (max-width: 640px), screen and (hover: none) {
    /* show hamburger */
    #main-menu .mm-hamburger {
        display: block;
    }

    /* show/hide menu */
    #main-menu #mm-chkbox:checked ~ .menu-items {
        visibility: visible;
        top: var(--header-height-small);
    }
    

    #main-menu > nav {
        position:absolute;  /* static is default */
        top:-1000px;
    }

    /* geometries */
    nav.menu-items {
        visibility: hidden;
        /* position: absolute; */
        right: 1em;
        /* top: -1000px; */
        background-color: var(--kk-color-header-background);
        z-index: 100;
        padding-left: 1.5em;
        padding-right: 1.5em;
        transition: all 0.5s ;
    }

    nav.menu-items ul {
        display: flex;
        flex-direction: column;
        padding-bottom: 1.5em;
    }

    nav.menu-items > ul {

        max-height: calc(100vh - 100px); 
        overflow: scroll;
    }

    nav.menu-items li ul {
        visibility: unset;
        position: unset;
        background-color: unset;
        padding-top: 0;
        padding-bottom: 0;
    }

    nav.menu-items li {
        padding-top: 1.5em;
        padding-bottom: 0;
    }

    nav.menu-items li ul li {
        padding-top: 1.5em;
        padding-bottom: 0;
        padding-left: 1em;
    }
}

@media screen and (hover: none) and (orientation: landscape) {

    nav.menu-items ul {
        display: flex;
        flex-direction: row;
        padding-bottom: 1.5em;
    }
}
