:root {
    --ink: #20242b;
    --muted: #ffffff;
    --blue-dark: #005b8f;
    --active-blue: #ffffff;
    --line: #00527c;
    --active: #014263;
    --white: #ffffff;
    --navBar-bg:#01314A;
    --link-hover:#b9bdc4;
}

.anchor-nav {
    height: 4.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 1rem;
    background: var(--navBar-bg);
    box-sizing: border-box;
    margin-top: -28px;

    * {
        box-sizing: border-box;
    }

    &.is-pinned {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        margin-top: 0;
    }

    &.transform {

        .anchor-nav-list {
            scroll-behavior: smooth;
            width: calc(100% - 4rem);
            overflow: auto;
            margin: 0 auto;

            .anchor-nav-link {
                &:first-child {
                    border-left: none;
                }
                &:last-child {
                    border-right: none;
                }
            }
        }

        &::before,
        &::after {
            position: absolute;
            top: 50%;
            z-index: 3;
            width: 12px;
            height: 12px;
            border-top: 2px solid var(--site-primary-bg-color, var(--active-blue));
            border-right: 2px solid var(--site-primary-bg-color, var(--active-blue));
            cursor: pointer;
            content: "";
            display: block;
            transition: border-color .2s ease;
        }

        &::before {
            left: .75rem;
            transform: translateY(-50%) rotate(-135deg);
        }

        &::after {
            right: .75rem;
            transform: translateY(-50%) rotate(45deg);
        }

        &.is-hover-left::before, &.is-hover-right::after {
            border-color: var(--site-secondary-bg-color, var(--link-hover));
        }

        &.at-scroll-start::before {
            display: none;
        }

        &.at-scroll-end::after {
            display: none;
        }
    }

    /** left and right side shadow for edge of words **/
    &.transform {
        .anchor-nav-list {
            -webkit-mask-image: linear-gradient(to right,
                    transparent 0,
                    #000 2rem,
                    #000 calc(100% - 2rem),
                    transparent 100%);
            mask-image: linear-gradient(to right,
                    transparent 0,
                    #000 2rem,
                    #000 calc(100% - 2rem),
                    transparent 100%);
        }

        &.at-scroll-start .anchor-nav-list {
            -webkit-mask-image: linear-gradient(to right,
                    #000 0,
                    #000 calc(100% - 2rem),
                    transparent 100%);
            mask-image: linear-gradient(to right,
                    #000 0,
                    #000 calc(100% - 2rem),
                    transparent 100%);
        }

        &.at-scroll-end .anchor-nav-list {
            -webkit-mask-image: linear-gradient(to right,
                    transparent 0,
                    #000 2rem,
                    #000 100%);
            mask-image: linear-gradient(to right,
                    transparent 0,
                    #000 2rem,
                    #000 100%);
        }
    }

    .anchor-nav-list {
        position: relative;
        display: flex;
        flex: none;
        align-items: center;
        margin: 0;
        padding: 0;
        scrollbar-width: none;
        height: 4.5rem;
        white-space: nowrap;

        &::-webkit-scrollbar {
            display: none;
        }

        &::before {
            position: absolute;
            z-index: 1;
            bottom: 1.5rem;
            left: 0;
            width: var(--indicator-width, 0px);
            height: 1px;
            background: var(--site-secondary-bg-color, var(--active-blue));
            content: "";
            transform: translateX(var(--indicator-offset, 0px));

        }

        .anchor-nav-link {
            position: relative;
            display: flex;
            flex: none;
            align-items: center;
            justify-content: center;
            min-width: 150px;
            padding: 0 2rem;
            color: var(--site-primary-bg-color, var(--muted));
            font-size: 1.125rem;
            line-height: 100%;
            height: 100%;
            text-align: center;
            text-decoration: none;
            white-space: nowrap;
            transition: color .2s ease;
            border-left: 1px solid var(--line);

            &:last-child {
                border-right: 1px solid var(--line);
            }

            &:hover {
                text-decoration: underline;
                color: var(--site-secondary-bg-color, var(--link-hover));
                text-underline-offset: .375rem;
            }

            &.is-active {
                background-color: var(--active);
            }

            &.is-active {
                &:hover{
                    text-decoration: none!important;
                    color: var(--site-secondary-bg-color, var(--active-blue));
                }
            }
        }
    }

    @media screen and (max-width:30rem) {
        height: 4rem;

        .anchor-nav-list {
            height: 4rem;

            .anchor-nav-link {
                min-width: unset;
                padding: 0 .75rem;

                &:hover {
                    text-decoration: none!important;
                    color: var(--site-primary-bg-color, var(--muted))!important;
                }
            }
        }
    }
}


body.theme-ffb-midnight-sapphire {
    .anchor-nav {
        background: color-mix(in srgb, var(--white) 98%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: 0 10px 14px -12px color-mix(in srgb, var(--ink) 22%, transparent);

        .anchor-nav-list {
            &::before {
                bottom: .25rem;
                width: calc(var(--indicator-width, 0px) + 1rem);
                transform: translateX(calc(var(--indicator-offset, 0px) - .5rem));
                height: .1875rem;
                border-radius: .125rem;
                transition: transform .3s ease, width .3s ease;
            }

            .anchor-nav-link {
                border: none;
                position: relative;

                &:not(:last-child)::after {
                    position: absolute;
                    right: 0;
                    width: 1px;
                    height: 28px;
                    background: var(--site-primary-light-bg-color);
                    content: "";
                }
                
                &.is-active {
                    color: var(--site-secondary-bg-color);
                    background-color: transparent;
                }
            }
        }
    }
}