/* Desktop navigation styles */

nav {
    width: 100%;
    background-color: var(--secondary-color);
    color: var(--light-color);
    margin-bottom: 60px;
    z-index: 1000;
}

nav .top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
}

nav .top-nav .logo {
    height: 45px;
}

nav .top-nav .user {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--horizontal-spacing);
}

nav .top-nav .user a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* Keep the greeting ("Üdv, teszt_admin") on one line: once the language
       switcher widens the row, the text node was breaking onto two lines. */
    white-space: nowrap;
}

/* The language switcher sits inline with the greeting and icons, vertically
   centered, and never forces the row to wrap. */
nav .top-nav .user .langswitch {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

nav .bottom-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 0 60px 20px;
}


/* Mobile navigation styles */

#menuToggle {
    display: none;
    /* You can also use relative/absolute here if you want to stay on the top */
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
}

#menuToggle input {
    display: block;
    width: 40px;
    height: 32px;
    position: absolute;
    top: -7px;
    left: -5px;
    cursor: pointer;
    opacity: 0;
    /* hide this */
    z-index: 2;
    /* and place it over the hamburger */
    -webkit-touch-callout: none;
}

.user-login-info {
    display: none;
    position: fixed;
    top: calc((75px/2) - (24.5px / 2));
    right: 25px;
    color: var(--light-color);
    text-decoration: none;
    font-size: 18px;
    z-index: 2;
}


/*
 * Just a quick hamburger
 */

#menuToggle span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    position: relative;
    background: var(--background-color);
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0px;
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), opacity 0.55s ease;
}

#menuToggle span:first-child {
    transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2) {
    transform-origin: 0% 100%;
}


/* 
 * Transform all the slices of hamburger
 * into a crossmark.
 */

#menuToggle input:checked~span {
    opacity: 1;
    transform: rotate(45deg) translate(-2px, -1px);
    background: var(--background-color);
}


/*
 * But let's hide the middle one.
 */

#menuToggle input:checked~span:nth-last-child(3) {
    opacity: 0;
    transform: rotate(0deg) scale(0.2, 0.2);
}


/*
 * Ohyeah and the last one should go the other direction
 */

#menuToggle input:checked~span:nth-last-child(2) {
    transform: rotate(-45deg) translate(0, -1px);
}


/*
 * Make this absolute positioned
 * at the top left of the screen
 */

#menu {
    position: absolute;
    max-width: 400px;
    width: 100vw;
    /* max-height: 100vh; */
    height: calc(100vh);
    margin: -52px 0 0 -50px;
    padding: 50px;
    padding-top: 125px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--secondary-color);
    list-style-type: none;
    -webkit-font-smoothing: antialiased;
    /* to stop flickering of text in safari */
    transform-origin: 0% 0%;
    transform: translate(-100%, 0);
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
}

#menu .logo {
    position: absolute;
    bottom: 20px;
    width: 80%;
}

#menu li {
    padding: 10px 0;
    font-size: 22px;
}

#menu li label {
    cursor: pointer;
}


/*
 * And let's slide it in from the left
 */

#menuToggle input:checked~ul {
    transform: none;
}


/* Change navigation media query */

@media (max-width: 768px) {
    nav#desktop {
        display: none;
    }
    nav#mobile {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        height: 75px;
    }
    #menuToggle {
        display: block;
    }
    #mobile>.user-login-info {
        display: flex;
        align-items: center;
    }
    #mobile>.user-login-info.logged-in {
        display: flex;
        align-items: center;
        gap: var(--horizontal-spacing);
    }
    #mobile>.user-login-info.logged-in a {
        display: flex;
        align-items: center;
        gap: 5px;
    }
}