@import url(global.css);

nav {
    background-color: var(--site-primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    transition: all 0.3s ease;
    z-index: 999;
    /* animation: nav-nvp linear forwards;
    animation-timeline: scroll();
    animation-range: 0 30vh; */
    --href-color: #ffffff;

    &.scrolled {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
        background: var(--site-primary-color-900);
    }

    @media(max-width:1025px) {
        --nav-height: 80px;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    }

    & .logo {
        height: 60%;
        opacity: 1;
        transition: all 1s linear;

        @starting-style {
            opacity: 0;
        }

        & img {
            width: auto;
            height: 100%;
        }
    }

    & #site-menu {
        list-style: none;
        display: flex;
        gap: 2rem;

        position: relative;

        &>li {
            position: relative;
            padding: 1rem 0;

            @media(pointer: fine)and (hover: hover) {
                &:hover>ul.submenu {
                    display: block;
                }
            }
        }

        &>li>a {
            color: var(--href-color);
            text-decoration: none;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
            text-transform: uppercase;

            &:hover {
                color: hsl(from var(--href-color) h s l / 0.5);
            }

            &:hover:before {
                width: 100%;
            }

        }

        &>li:has(ul.submenu)>a:after {
            font-family: bootstrap-icons;
            content: "\F282";
            color: hsl(from var(--href-color) h s l / 0.3);
        }

        & ul.submenu {
            display: none;
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            background-color: var(--site-secondary-color);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            /* padding: 0.3rem 1rem; */
            width: max-content;
            border-radius: 0 0 5px 5px;
            overflow: hidden;
            font-weight: bold;

            &::before {
                position: absolute;
                top: 0;
                left: 0;
                content: '';
                display: block;
                width: 100%;
                height: 5px;
                background-color: var(--site-primary-light-color);
                animation: submenuShowBefore 0.3s ease forwards;

                @media (max-width:1025px) {
                    height: 2px;
                }
            }

            @media(min-width: 1025px) {
                /* max-height: 0; */
            }

            & li {

                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
                min-width: 200px;

                &:hover {
                    background-color: var(--site-primary-color-900);
                    color: #fff;
                }
            }

            & li>a {
                padding: 0.8rem;
                display: block;
                height: 100%;
            }

            & li:last-child {
                border-bottom: none;
            }

            &.showSubmenu {
                display: block;
            }
        }

        @media (max-width:1025px),
        (pointer: coarse) {
            top: var(--nav-height);
            right: -100%;
            position: fixed;
            min-height: 100vh;
            min-height: 100dvh;
            width: 100%;
            flex-direction: column;
            background-color: var(--site-secondary-color);
            gap: 0;
            overflow: scroll;
            transition: all 0.3s ease;

            &.site-menu-open {
                right: 0;
            }

            & li {
 padding: 1rem;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
                ;
                width: 100%;
            }

            & li>a {
                color: hsl(from var(--href-color) h s l / 0.5);
               

                &:focus,
                &:hover,
                &:active {
                    color: #ffffff;
                }
            }

            & ul.submenu {
                position: static;
                transform: none;
                background-color: transparent;
                box-shadow: none;
                padding: 0;
                height: auto;
                overflow: visible;
                width: 100%;

                & li {
                    border-color: rgba(255, 255, 255, 0.4);
                    padding: 0 0 0 1rem;

                    & a {
                        padding: 0.8rem 0.8rem 0.8rem 0;
                        color: #fff;
                        
                    }
                }
            }
        }
    }

    @media(max-width: 1025px), (pointer: coarse) {
        & #mclick {
            align-items: center;
            justify-content: center;
            line-height: 1;

            &::before {
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                color: #ffffff;
                font-family: bootstrap-icons;
                content: '\F479';
                width: 45px;
                height: 45px;
                font-size: 2.25rem;
                text-align: center;
            }

            &.site-menu-open::before {
                content: '\F62A';
            }
        }
    }

}

@keyframes nav-nvp {
    100% {
        --nav-height: 70px;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    }

}

@keyframes submenuShowBefore {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}