/*
|--------------------------------------------------------------------------
| MKGO - Public Navbar
|--------------------------------------------------------------------------
|
| File:
| /assets/css/components/navbar.css
|
| Public navigation, desktop authentication actions and mobile menu.
|
*/


/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.site-header {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    border-bottom:
        1px solid
        rgba(226, 232, 240, 0.82);

    background:
        rgba(255, 255, 255, 0.96);

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/*
|--------------------------------------------------------------------------
| Scrolled State
|--------------------------------------------------------------------------
*/

.site-header.is-scrolled {
    background:
        rgba(255, 255, 255, 0.985);

    border-bottom-color:
        rgba(203, 213, 225, 0.85);

    box-shadow:
        0 8px 30px
        rgba(15, 23, 42, 0.055);
}


/*
|--------------------------------------------------------------------------
| Header Inner
|--------------------------------------------------------------------------
*/

.site-header-inner {
    display: flex;
    align-items: center;

    min-height: 76px;

    gap: 28px;
}


/*
|--------------------------------------------------------------------------
| Brand
|--------------------------------------------------------------------------
*/

.site-header-brand {
    position: relative;

    z-index: 1002;

    flex: 0 0 auto;

    text-decoration: none;
}


.site-header-brand:focus-visible {
    outline:
        2px solid
        #0f172a;

    outline-offset: 5px;

    border-radius: 8px;
}


/*
|--------------------------------------------------------------------------
| Navigation
|--------------------------------------------------------------------------
*/

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1 1 auto;

    min-width: 0;
}


/*
|--------------------------------------------------------------------------
| Navigation Links
|--------------------------------------------------------------------------
*/

.site-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 4px;
}


/*
|--------------------------------------------------------------------------
| Navigation Link
|--------------------------------------------------------------------------
*/

.site-nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding:
        8px
        11px;

    border-radius: 8px;

    color: #64748b;

    text-decoration: none;

    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1;

    white-space: nowrap;

    transition:
        color 0.18s ease,
        background 0.18s ease;
}


.site-nav-link:hover {
    background: #f8fafc;

    color: #0f172a;
}


/*
|--------------------------------------------------------------------------
| Active Link
|--------------------------------------------------------------------------
*/

.site-nav-link.is-active,
.site-nav-link[aria-current="page"] {
    color: #0f172a;

    font-weight: 750;
}


.site-nav-link.is-active::after,
.site-nav-link[aria-current="page"]::after {
    content: "";

    position: absolute;

    right: 11px;
    bottom: 3px;
    left: 11px;

    height: 2px;

    border-radius: 999px;

    background: #0f172a;
}


/*
|--------------------------------------------------------------------------
| Focus
|--------------------------------------------------------------------------
*/

.site-nav-link:focus-visible,
.site-login-link:focus-visible {
    outline:
        2px solid
        #0f172a;

    outline-offset: 2px;
}


/*
|--------------------------------------------------------------------------
| Desktop Authentication Actions
|--------------------------------------------------------------------------
*/

.site-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex: 0 0 auto;

    gap: 14px;
}


/*
|--------------------------------------------------------------------------
| Login Link
|--------------------------------------------------------------------------
*/

.site-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    color: #475569;

    text-decoration: none;

    font-size: 0.78rem;
    font-weight: 700;

    transition:
        color 0.18s ease;
}


.site-login-link:hover {
    color: #0f172a;
}


/*
|--------------------------------------------------------------------------
| Mobile Actions
|--------------------------------------------------------------------------
*/

.site-nav-mobile-actions {
    display: none;
}


/*
|--------------------------------------------------------------------------
| Menu Toggle
|--------------------------------------------------------------------------
*/

.site-menu-toggle {
    position: relative;

    z-index: 1002;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    flex: 0 0 auto;

    gap: 5px;

    width: 44px;
    height: 44px;

    margin-left: auto;
    padding: 0;

    border:
        1px solid
        #e2e8f0;

    border-radius: 10px;

    background: #ffffff;
    color: #0f172a;

    cursor: pointer;
}


.site-menu-toggle:hover {
    background: #f8fafc;
}


.site-menu-toggle:focus-visible {
    outline:
        2px solid
        #0f172a;

    outline-offset: 3px;
}


/*
|--------------------------------------------------------------------------
| Hamburger Lines
|--------------------------------------------------------------------------
*/

.site-menu-toggle-line {
    display: block;

    width: 18px;
    height: 2px;

    border-radius: 999px;

    background: currentColor;

    transform-origin: center;

    transition:
        transform 0.2s ease,
        opacity 0.15s ease;
}


/*
|--------------------------------------------------------------------------
| Open Toggle
|--------------------------------------------------------------------------
*/

.site-menu-toggle[aria-expanded="true"]
.site-menu-toggle-line:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}


.site-menu-toggle[aria-expanded="true"]
.site-menu-toggle-line:nth-child(2) {
    opacity: 0;
}


.site-menu-toggle[aria-expanded="true"]
.site-menu-toggle-line:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/*
|--------------------------------------------------------------------------
| Account Button
|--------------------------------------------------------------------------
*/

.site-header-account-button,
.site-nav-account-button {
    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| Medium Desktop
|--------------------------------------------------------------------------
*/

@media (max-width: 1120px) {

    .site-header-inner {
        gap: 18px;
    }


    .site-nav-links {
        gap: 1px;
    }


    .site-nav-link {
        padding-right: 8px;
        padding-left: 8px;

        font-size: 0.74rem;
    }


    .site-nav-link.is-active::after,
    .site-nav-link[aria-current="page"]::after {
        right: 8px;
        left: 8px;
    }


    .site-header-actions {
        gap: 10px;
    }

}


/*
|--------------------------------------------------------------------------
| Mobile Navigation
|--------------------------------------------------------------------------
*/

@media (max-width: 920px) {

    /*
    |--------------------------------------------------------------------------
    | Header
    |--------------------------------------------------------------------------
    */

    .site-header-inner {
        min-height: 68px;
    }


    /*
    |--------------------------------------------------------------------------
    | Toggle
    |--------------------------------------------------------------------------
    */

    .site-menu-toggle {
        display: flex;
    }


    /*
    |--------------------------------------------------------------------------
    | Desktop Actions
    |--------------------------------------------------------------------------
    */

    .site-header-actions {
        display: none;
    }


    /*
    |--------------------------------------------------------------------------
    | Navigation Panel
    |--------------------------------------------------------------------------
    */

    .site-nav {
        position: fixed;

        top: 68px;
        right: 0;
        bottom: 0;
        left: 0;

        z-index: 999;

        display: block;

        overflow-x: hidden;
        overflow-y: auto;

        padding:
            18px
            max(
                20px,
                calc(
                    (100vw - 1200px) / 2
                )
            )
            34px;

        background: #ffffff;

        visibility: hidden;

        opacity: 0;

        pointer-events: none;

        transform:
            translateY(-8px);

        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
    }


    /*
    |--------------------------------------------------------------------------
    | Open Navigation
    |--------------------------------------------------------------------------
    */

    .site-header.is-menu-open
    .site-nav {
        visibility: visible;

        opacity: 1;

        pointer-events: auto;

        transform:
            translateY(0);
    }


    /*
    |--------------------------------------------------------------------------
    | Navigation Links
    |--------------------------------------------------------------------------
    */

    .site-nav-links {
        display: flex;
        align-items: stretch;
        flex-direction: column;

        gap: 2px;

        width: 100%;
    }


    .site-nav-link {
        justify-content: flex-start;

        width: 100%;
        min-height: 50px;

        padding:
            12px
            10px;

        border-radius: 8px;

        font-size: 0.9rem;
    }


    .site-nav-link.is-active,
    .site-nav-link[aria-current="page"] {
        background: #f8fafc;
    }


    .site-nav-link.is-active::after,
    .site-nav-link[aria-current="page"]::after {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 0;

        width: 3px;
        height: 20px;

        transform:
            translateY(-50%);
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Authentication
    |--------------------------------------------------------------------------
    */

    .site-nav-mobile-actions {
        display: flex;
        align-items: stretch;
        flex-direction: column;

        gap: 10px;

        margin-top: 18px;
        padding-top: 20px;

        border-top:
            1px solid
            #e2e8f0;
    }


    .site-nav-mobile-actions
    .site-login-link {
        width: 100%;
        min-height: 46px;

        border:
            1px solid
            #e2e8f0;

        border-radius: 8px;
    }


    .site-nav-mobile-actions
    .site-primary-button {
        width: 100%;
    }


    /*
    |--------------------------------------------------------------------------
    | Body Menu State
    |--------------------------------------------------------------------------
    */

    body.menu-open {
        overflow: hidden;
    }

}


/*
|--------------------------------------------------------------------------
| No JavaScript Mobile Fallback
|--------------------------------------------------------------------------
|
| If JavaScript is unavailable, don't hide the site's navigation.
|
*/

@media (max-width: 920px) {

    html.no-js
    .site-menu-toggle {
        display: none;
    }


    html.no-js
    .site-header-inner {
        align-items: flex-start;
        flex-wrap: wrap;

        padding-top: 12px;
        padding-bottom: 12px;
    }


    html.no-js
    .site-nav {
        position: static;

        flex: 0 0 100%;

        visibility: visible;

        opacity: 1;

        overflow: visible;

        padding: 12px 0 0;

        background: transparent;

        pointer-events: auto;

        transform: none;
    }

}


/*
|--------------------------------------------------------------------------
| Small Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 480px) {

    .site-nav {
        padding:
            14px
            16px
            28px;
    }


    .site-menu-toggle {
        width: 42px;
        height: 42px;
    }

}


/*
|--------------------------------------------------------------------------
| Reduced Motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {

    .site-header,
    .site-nav,
    .site-nav-link,
    .site-login-link,
    .site-menu-toggle-line {
        transition: none;
    }


    .site-nav {
        transform: none;
    }

}