/* ===============================================
    Site header (top bar + main bar)
    Loaded after responsive.css so it can restyle the theme's nav.
    Colours come from the logo: sun orange accent, deep teal for contrast.
------------------------*/

#masthead.mp-header {
    --mp-ink: var(--brand-ink);
    --mp-navy: var(--brand-navy);
    --mp-green: var(--brand-green);
    --mp-accent: var(--brand-orange);
    --mp-line: var(--brand-line);
    --mp-top-h: 40px;
    --mp-bar-h: 92px;
    --mp-logo-h: 62px;

    position: relative;
    z-index: 1030;
}


/* Top bar
------------------------*/

#masthead .mp-topbar {
    height: var(--mp-top-h);
    background: var(--mp-navy);
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    line-height: 1;
}

#masthead .mp-topbar__inner {
    display: flex;
    align-items: center;
    height: var(--mp-top-h);
}

#masthead .mp-topbar__info,
#masthead .mp-topbar__social {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

#masthead .mp-topbar__info {
    flex: 1 1 auto;
    gap: 28px;
    min-width: 0;
}

#masthead .mp-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#masthead .mp-topbar__item i {
    color: var(--mp-accent);
    font-size: 14px;
}

#masthead .mp-topbar__item--hours {
    margin-left: auto;
}

#masthead .mp-topbar a {
    color: inherit;
}

#masthead .mp-topbar a:hover,
#masthead .mp-topbar a:focus-visible {
    color: #fff;
}

#masthead .mp-topbar__social {
    gap: 8px;
    margin-left: 24px;
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, .16);
}

#masthead .mp-topbar__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    font-size: 13px;
}

#masthead .mp-topbar__social a:hover,
#masthead .mp-topbar__social a:focus-visible {
    background: var(--mp-accent);
    color: var(--mp-ink);
}


/* Main bar
------------------------*/

/* Holds the bar's space so the page doesn't jump when the bar goes fixed. */
#masthead .site-header-menu {
    height: var(--mp-bar-h);
}

#masthead .site-header-menu-inner {
    position: relative;
    height: var(--mp-bar-h);
    background: #fff;
    border-bottom: 1px solid var(--mp-line);
    transition: box-shadow .3s ease;
}

/* main.js adds .fixed-header once the top bar has scrolled away. */
#masthead #site-header-menu .ttm-stickable-header.fixed-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 10px 28px -14px rgba(var(--brand-navy-rgb), .4);
}

#masthead .site-header-menu-inner > .container {
    height: 100%;
}

#masthead .site-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

#masthead .site-branding {
    flex: 0 0 auto;
}

#masthead .site-branding .home-link {
    display: block;
    line-height: 0;
}

#masthead #logo-img {
    display: block;
    width: auto;
    height: var(--mp-logo-h);
}


/* Navigation (desktop)
------------------------*/

#masthead nav.main-menu {
    display: flex;
    align-items: center;
    background: transparent;
}

#masthead nav.main-menu ul.menu {
    display: flex;
    align-items: center;
    gap: 2px;
}

#masthead nav.main-menu ul.menu > li {
    display: block;
}

#masthead nav.main-menu ul.menu > li > a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--mp-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    text-transform: none;
    white-space: nowrap;
}

/* Sliding underline (reuses the theme's :before element) */
#masthead nav.main-menu ul.menu > li > a:before {
    left: 16px;
    right: 16px;
    bottom: 6px;
    width: auto;
    height: 2px;
    border-radius: 2px;
    background: var(--mp-accent);
}

#masthead nav.main-menu ul.menu > li:hover > a,
#masthead nav.main-menu ul.menu > li > a:focus-visible,
#masthead nav.main-menu ul.menu > li.current > a {
    color: var(--mp-green);
}

#masthead nav.main-menu ul.menu > li.current > a:before {
    transform: scale3d(1, 1, 1);
}

#masthead nav.main-menu a:focus-visible,
#masthead .menubar:focus-visible {
    outline: 2px solid var(--mp-green);
    outline-offset: 2px;
}

/* Contact Us as a call-to-action pill */
#masthead nav.main-menu ul.menu > li.menu-cta {
    margin-left: 14px;
}

#masthead nav.main-menu ul.menu > li.menu-cta > a {
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--mp-accent);
    color: var(--mp-ink);
    font-weight: 600;
    box-shadow: 0 8px 18px -8px rgba(var(--brand-orange-rgb), .85);
    transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

#masthead nav.main-menu ul.menu > li.menu-cta > a:before {
    display: none;
}

#masthead nav.main-menu ul.menu > li.menu-cta:hover > a,
#masthead nav.main-menu ul.menu > li.menu-cta > a:focus-visible,
#masthead nav.main-menu ul.menu > li.menu-cta.current > a {
    background: var(--mp-navy);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(var(--brand-navy-rgb), .7);
    transform: translateY(-1px);
}

#masthead .menubar {
    display: none;
}

/* The theme gives the fixed bar's links 35px of vertical padding with a long
   selector (responsive.css); match its shape, add the id, and put things back. */
@media (min-width: 1200px) {

    #masthead #site-header-menu .ttm-stickable-header.fixed-header .site-navigation ul.menu > li > a {
        padding: 12px 16px;
    }

    #masthead #site-header-menu .ttm-stickable-header.fixed-header .site-navigation ul.menu > li.menu-cta > a {
        padding: 12px 26px;
    }
}


/* Below 1200px: hamburger + slide-down panel, container goes full width
------------------------*/

@media (max-width: 1199.98px) {

    #masthead.mp-header {
        --mp-bar-h: 72px;
        --mp-logo-h: 44px;
    }

    #masthead .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    #masthead .mp-topbar__item--address {
        display: none;
    }

    #masthead .site-navigation {
        position: static;
        height: 100%;
    }

    #masthead .site-branding {
        text-align: left;
    }


    /* Mobile toggle */

    #masthead .menubar {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: -10px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
    }

    #masthead .menubar:hover {
        background: rgba(var(--brand-navy-rgb), .06);
    }

    #masthead .menubar-box {
        position: relative;
        display: block;
        width: 24px;
        height: 18px;
    }

    #masthead .menubar .menubar-inner,
    #masthead .menubar .menubar-inner:before,
    #masthead .menubar .menubar-inner:after {
        position: absolute;
        left: 0;
        bottom: auto;
        display: block;
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background-color: var(--mp-ink);
        transform: none;
        opacity: 1;
        transition: top .2s ease, transform .2s ease, background-color .2s ease;
        transition-delay: 0s;
    }

    #masthead .menubar .menubar-inner {
        top: 8px;
        margin-top: 0;
    }

    #masthead .menubar .menubar-inner:before {
        content: '';
        top: -7px;
    }

    #masthead .menubar .menubar-inner:after {
        content: '';
        top: 7px;
    }

    /* open: bars collapse into an X */
    #masthead .menubar.is-active .menubar-inner {
        background-color: transparent;
        transform: none;
    }

    #masthead .menubar.is-active .menubar-inner:before {
        top: 0;
        opacity: 1;
        transform: rotate(45deg);
    }

    #masthead .menubar.is-active .menubar-inner:after {
        top: 0;
        bottom: auto;
        transform: rotate(-45deg);
    }


    /* Slide-down menu panel */

    #masthead nav.main-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--mp-bar-h));
        padding: 6px 20px 22px;
        overflow-y: auto;
        border-top: 3px solid var(--mp-accent);
        background: #fff;
        box-shadow: 0 18px 28px -16px rgba(var(--brand-navy-rgb), .35);
    }

    #masthead nav.main-menu.show {
        display: block;
        animation: mp-menu-drop .22s ease-out;
    }

    #masthead nav.main-menu ul.menu {
        display: block;
    }

    #masthead nav.main-menu ul.menu > li > a {
        padding: 15px 4px;
        border-top: 1px solid var(--mp-line);
        border-radius: 0;
        font-size: 16px;
        white-space: normal;
    }

    #masthead nav.main-menu ul.menu > li:first-child > a {
        border-top: 0;
    }

    #masthead nav.main-menu ul.menu > li > a:before {
        display: none;
    }

    #masthead nav.main-menu ul.menu > li.current > a {
        font-weight: 600;
    }

    #masthead nav.main-menu ul.menu > li.menu-cta {
        margin: 14px 0 0;
    }

    #masthead nav.main-menu ul.menu > li.menu-cta > a {
        padding: 14px 20px;
        border-top: 0;
        border-radius: 12px;
        text-align: center;
    }
}

@keyframes mp-menu-drop {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Phones and small tablets: the top bar goes away
------------------------*/

@media (max-width: 991.98px) {

    #masthead .mp-topbar {
        display: none;
    }
}

@media (max-width: 575.98px) {

    #masthead.mp-header {
        --mp-bar-h: 64px;
        --mp-logo-h: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {

    #masthead *,
    #masthead *:before,
    #masthead *:after {
        animation: none !important;
        transition: none !important;
    }
}
