/* =========================================================
   SBMD SHARED NAVIGATION
   Used by navSystem.php
   ========================================================= */

:root {
    --sbmd-nav-bg: #1a1a1a;
    --sbmd-nav-green: #768f80;
    --sbmd-nav-gold: #ffd85c;
    --sbmd-nav-paper: #f2ecdf;
    --sbmd-nav-text: #202822;
    --sbmd-nav-border: #c9bfac;
}


/* Fixed nav anchor offset */

html {
    scroll-padding-top: 95px;
}


/* =========================================================
   NAV SHELL
   ========================================================= */

.nav-shell {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    width: 100%;

    margin: 0;

    z-index: 99999;
}


.nav-links {
    width: 100%;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;

    gap: 8px;

    margin: 0;
    padding: 10px 12px;

    overflow: visible;

    background: var(--sbmd-nav-bg);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .24);
}


.nav-links > a,
.nav-links > .dropdown {
    flex: 0 0 auto;
}


.nav-links > a:first-child {
    display: flex;

    align-items: center;
    justify-content: center;
}


.nav-links img {
    display: block;

    width: 75px;
    height: 65px;

    max-width: none;

    object-fit: contain;
}


.nav-links a {
    text-decoration: none;
}


/* =========================================================
   NAVIGATION BUTTONS
   ========================================================= */

.dropbtn {
    appearance: none;

    margin: 6px 0;
    padding: 10px 16px;

    background: transparent;

    border: 2px solid #ffffff;
    border-radius: 999px;

    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease;
}


.dropbtn:hover,
.dropdown:hover > .dropbtn {
    background: var(--sbmd-nav-green);

    border-color: var(--sbmd-nav-green);

    color: #ffffff;
}


.dropbtn:focus-visible {
    outline: 3px solid var(--sbmd-nav-gold);
    outline-offset: 3px;
}


.nav-direct-link {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    text-decoration: none;
}


/* =========================================================
   DROPDOWNS
   ========================================================= */

.dropdown {
    position: relative;

    display: inline-block;
}


.dropdown-content {
    position: absolute;

    top: 100%;
    left: 0;

    min-width: 190px;
    max-width: min(290px, 90vw);

    display: none;

    overflow: hidden;

    background: var(--sbmd-nav-paper);

    border: 1px solid var(--sbmd-nav-border);
    border-radius: 12px;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, .25);

    z-index: 100000;
}


.dropdown-content a {
    display: block;

    padding: 12px 16px;

    background: var(--sbmd-nav-paper);

    color: var(--sbmd-nav-text);

    font-size: .96rem;
    font-weight: 700;
    line-height: 1.35;

    white-space: normal;

    text-decoration: none;
}


.dropdown-content a:hover,
.dropdown-content a:focus-visible {
    background: var(--sbmd-nav-green);

    color: #ffffff;
}


.dropdown:hover > .dropdown-content {
    display: block;
}


/* =========================================================
   MOBILE CONTROLS
   ========================================================= */

.menu-toggle,
.nav-overlay {
    display: none;
}


body.nav-open {
    overflow: hidden;
}


/* =========================================================
   SCROLL TO TOP
   ========================================================= */

.scroll-top-btn {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 5000;

    width: 52px;
    height: 52px;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 0;

    background: var(--sbmd-nav-gold);

    border: 0;
    border-radius: 50%;

    color: var(--sbmd-nav-text);

    font-size: 21px;

    cursor: pointer;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, .28);
}


.scroll-top-btn.visible {
    display: flex;
}


.scroll-top-btn:hover {
    background: #ffe580;
}


.scroll-top-btn:focus-visible {
    outline: 4px solid #ffffff;
    outline-offset: 3px;
}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 768px) {

    html {
        scroll-padding-top: 60px;
    }


    .menu-toggle {
        position: relative;

        z-index: 6003;

        width: 100%;

        display: block;

        padding: 14px 16px;

        background: var(--sbmd-nav-bg);

        border: 0;

        color: #ffffff;

        font-family: Arial, sans-serif;
        font-size: 1rem;
        font-weight: 800;

        text-align: center;

        cursor: pointer;
    }


    .nav-overlay {
        position: fixed;

        inset: 0;

        z-index: 6000;

        display: block;

        background:
            rgba(0, 0, 0, .58);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity .2s ease,
            visibility .2s ease;
    }


    .nav-overlay.visible {
        opacity: 1;
        visibility: visible;
    }


    .nav-links {
        position: fixed;

        top: 0;
        left: 0;

        z-index: 6001;

        width: min(340px, 86vw);
        max-width: 86vw;

        height: 100vh;
        height: 100dvh;

        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;

        align-items: stretch;
        justify-content: flex-start;

        gap: 0;

        padding:
            68px
            12px
            25px;

        overflow-x: hidden;
        overflow-y: auto;

        background: var(--sbmd-nav-bg);

        box-shadow:
            10px 0 28px rgba(0, 0, 0, .38);

        transform: translateX(-110%);

        transition:
            transform .25s ease;
    }


    .nav-links.visible {
        transform: translateX(0);
    }


    .nav-links > a:first-child {
        width: 100%;

        display: flex;

        justify-content: center;

        margin-bottom: 6px;
    }


    .nav-links img {
        width: 70px !important;
        height: auto !important;

        max-width: 100%;
    }


    .dropdown {
        width: 100%;

        flex: 0 0 auto;
    }


    .dropdown > a {
        width: 100%;

        display: block;
    }


    .dropbtn {
        width: 100%;

        margin: 5px 0;
        padding: 11px 15px;

        text-align: left;

        white-space: normal;

        transform: none;
    }


    .nav-direct-link {
        width: 100%;

        display: flex;

        align-items: center;
        justify-content: flex-start;
    }


    .dropdown-content {
        position: static;

        width: 100%;
        min-width: 0;
        max-width: 100%;

        margin: 3px 0 10px;

        background: var(--sbmd-nav-paper);

        border-radius: 12px;

        box-shadow: none;
    }


    .dropdown-content a {
        width: 100%;

        padding: 12px 15px;

        font-size: .94rem;

        white-space: normal;
    }


    .dropdown:hover > .dropdown-content {
        display: none;
    }


    .scroll-top-btn {
        right: 14px;
        bottom: 14px;

        width: 46px;
        height: 46px;

        font-size: 18px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .nav-links,
    .nav-overlay,
    .dropbtn,
    .dropdown-content a,
    .scroll-top-btn {
        transition: none !important;
    }

}