/* ==========================================================
   URISTST — HEADER POLISH
   lightweight / no libraries
   ========================================================== */

#masthead {
    position: sticky !important;
    top: 0;
    z-index: 9999;

    transform: none !important;

    background: rgba(255, 255, 255, 0.98);

    border-bottom: 1px solid transparent;

    transition:
        box-shadow 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease !important;
}

/* Disable visible header jumping/sliding */
#masthead,
#masthead *,
.ast-primary-header-bar,
.ast-builder-grid-row-container {
    animation-name: none !important;
}

#masthead.uristst-header-scrolled {
    background: rgba(255, 255, 255, 0.99);

    border-bottom-color: rgba(23, 34, 49, 0.08);

    box-shadow:
        0 8px 24px rgba(23, 34, 49, 0.055);
}

/* ------------------------------------------
   Desktop navigation
   ------------------------------------------ */

@media (min-width: 922px) {

    #masthead .main-header-menu > .menu-item > .menu-link {
        position: relative;

        transition:
            color 180ms ease,
            opacity 180ms ease !important;
    }

    #masthead .main-header-menu > .menu-item > .menu-link::after {
        content: "";

        position: absolute;

        left: 50%;
        bottom: 13px;

        width: calc(100% - 32px);
        height: 2px;

        background: #9A503F;

        border-radius: 999px;

        transform:
            translateX(-50%)
            scaleX(0);

        transform-origin: center;

        opacity: 0;

        transition:
            transform 190ms ease,
            opacity 190ms ease;
    }

    #masthead .main-header-menu > .menu-item:hover > .menu-link::after,
    #masthead .main-header-menu > .current-menu-item > .menu-link::after,
    #masthead .main-header-menu > .current-menu-ancestor > .menu-link::after,
    #masthead .main-header-menu > .current_page_item > .menu-link::after {
        transform:
            translateX(-50%)
            scaleX(1);

        opacity: 1;
    }
}

/* ------------------------------------------
   WordPress admin bar
   ------------------------------------------ */

body.admin-bar #masthead {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #masthead {
        top: 46px;
    }
}

/* ------------------------------------------
   Mobile
   ------------------------------------------ */

@media (max-width: 921px) {

    #masthead {
        box-shadow: none;
    }

    #masthead.uristst-header-scrolled {
        box-shadow:
            0 5px 18px rgba(23, 34, 49, 0.055);
    }
}

/* ------------------------------------------
   Accessibility
   ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    #masthead,
    #masthead *,
    #masthead *::before,
    #masthead *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* URISTST ACCENT COLOR FIX START */

/* Menu hover / active */
#masthead .main-header-menu > .menu-item:hover > .menu-link,
#masthead .main-header-menu > .current-menu-item > .menu-link,
#masthead .main-header-menu > .current-menu-ancestor > .menu-link,
#masthead .main-header-menu > .current_page_item > .menu-link {
    color: #9A503F !important;
}

/* Scroll-to-top button */
#ast-scroll-top,
.ast-scroll-top-icon {
    background: #9A503F !important;
    color: #FFFFFF !important;
    border-color: #9A503F !important;
}

#ast-scroll-top:hover,
#ast-scroll-top:focus,
.ast-scroll-top-icon:hover,
.ast-scroll-top-icon:focus {
    background: #7F4134 !important;
    color: #FFFFFF !important;
    border-color: #7F4134 !important;
}

/* URISTST ACCENT COLOR FIX END */
