/* ===================================================================
   * # header  — aligned with algosmiths.com main + talent navbars
   *   logo left · horizontal nav right · white dropdowns · 64px bar
   * ------------------------------------------------------------------- */

:root {
    --as-navy: #003B6E;
    --as-ink: #0a1b2e;
    --as-muted: rgba(10, 27, 46, 0.62);
    --as-border: #e2e8f0;
    --as-lime: #A8CF45;
}

.s-header {
    background-color: #FFFFFF;
    height: 64px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 500;
    border-bottom: 1px solid var(--as-border);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 6%);
    -webkit-box-shadow: 0 1px 3px 0 rgb(0 0 0 / 6%);
}

/* ------------------------------------------------------------------- *
   * ## inner flex layout
   * ------------------------------------------------------------------- */

.header__inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* ------------------------------------------------------------------- *
   * ## header logo
   * ------------------------------------------------------------------- */

.header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header__logo a {
    display: inline-flex;
    align-items: center;
    outline: 0;
    border: none;
    -webkit-transition: opacity 0.2s ease-in-out;
    transition: opacity 0.2s ease-in-out;
}

.header__logo a:hover {
    opacity: 0.8;
}

.header__logo img {
    width: 160px;
    height: 32px;
    object-fit: contain;
    display: block;
}

/* ------------------------------------------------------------------- *
   * ## main navigation (desktop)
   * ------------------------------------------------------------------- */

.header__nav-wrap {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header__nav-wrap .header__nav-heading,
.header__nav-wrap .close-mobile-menu {
    display: none;
}

.header__nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header__nav > li {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header__nav li a {
    display: inline-flex;
    align-items: center;
    color: var(--as-muted);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
    padding: 0.5rem 1rem;
    border-radius: 0.65rem;
    cursor: pointer;
    -webkit-transition: color 0.2s ease, background-color 0.2s ease;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.header__nav li a:hover,
.header__nav li a:focus {
    color: var(--as-navy);
    background-color: rgba(0, 59, 110, 0.06);
}

.header__nav .current {
    color: var(--as-navy);
    font-weight: 600;
}

/* dropdown caret */
.header__nav li.has-children > a {
    padding-right: 1.9rem;
}

.header__nav li.has-children > a::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -4px;
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transition: transform 0.2s ease-in-out;
    pointer-events: none;
    opacity: 0.6;
}

/* ------------------------------------------------------------------- *
   * ## sub menu (white popover)
   * ------------------------------------------------------------------- */

.header__nav li ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: #FFFFFF;
    border: 1px solid var(--as-border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px -10px rgb(10 27 46 / 18%);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    -webkit-transform: translateY(8px);
    transition: all 0.18s ease-in-out;
}

.header__nav li ul li {
    display: block;
    width: 100%;
}

.header__nav li ul li a {
    display: block;
    white-space: nowrap;
    padding: 0.55rem 0.9rem;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--as-ink);
    border-radius: 0.6rem;
}

.header__nav li ul li a:hover,
.header__nav li ul li a:focus {
    color: var(--as-navy);
    background-color: rgba(0, 59, 110, 0.06);
}

/* ------------------------------------------------------------------- *
   * ## actions (search + mobile toggle)
   * ------------------------------------------------------------------- */

.header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header__search-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.65rem;
    background-image: url(/static/icons/icon-search.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    -webkit-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.header__search-trigger:hover {
    background-color: rgba(0, 59, 110, 0.06);
}

/* ------------------------------------------------------------------- *
   * ## mobile hamburger
   * ------------------------------------------------------------------- */

.header__toggle-menu {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 0.65rem;
    position: relative;
    cursor: pointer;
}

.header__toggle-menu:hover {
    background-color: rgba(0, 59, 110, 0.06);
}

.header__toggle-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--as-ink);
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    font: 0/0 a;
    color: transparent;
    -webkit-transition: background 0.2s ease-in-out;
    transition: background 0.2s ease-in-out;
}

.header__toggle-menu span::before,
.header__toggle-menu span::after {
    content: '';
    width: 100%;
    height: 100%;
    background-color: inherit;
    position: absolute;
    left: 0;
}

.header__toggle-menu span::before {
    top: -6px;
}

.header__toggle-menu span::after {
    top: 6px;
}

/* ------------------------------------------------------------------- *
   * ## close button (search + mobile overlay)
   * ------------------------------------------------------------------- */

.header__overlay-close {
    position: absolute;
    display: block;
    width: 45px;
    height: 45px;
    top: 16px;
    right: 1.5rem;
    left: auto;
    font: 0/0 a;
    text-shadow: none;
    color: transparent;
    cursor: pointer;
    z-index: 10;
}

.header__overlay-close::before,
.header__overlay-close::after {
    content: '';
    position: absolute;
    display: inline-block;
    width: 2px;
    height: 20px;
    top: 12px;
    left: 22px;
    background-color: var(--as-ink);
}

.header__overlay-close::before {
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

.header__overlay-close::after {
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

/* ------------------------------------------------------------------- *
   * ## full-screen search overlay
   * ------------------------------------------------------------------- */

.header__search {
    display: block;
    text-align: center;
    background-color: #FFFFFF;
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    z-index: 900;
}

.header__search-form {
    width: 100%;
    -webkit-transform: translate3d(0, -50%, 0);
    transform: translate3d(0, -50%, 0);
    position: absolute;
    top: 50%;
}

.header__search-form label {
    color: var(--as-ink);
    display: flex;
    flex-direction: column;
}

.header__search-form::after {
    content: "Press Enter to begin your search.";
    display: block;
    font-size: 16px;
    letter-spacing: 0.6px;
    margin-top: 3rem;
    text-align: center;
    color: rgba(10, 27, 46, 0.5);
}

.search-text {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    margin-bottom: 0.9rem !important;
    line-height: 1.714 !important;
    color: var(--as-ink) !important;
}

.search-field {
    font-size: 4.2rem;
}

.header__search-form input[type="search"] {
    background-color: transparent;
    color: var(--as-ink);
    height: auto;
    width: 100%;
    font-weight: 700;
    line-height: 1.5;
    border: none;
    border-bottom: 1px solid rgba(10, 27, 46, 0.1) !important;
    max-width: 680px;
    padding-top: .6rem !important;
    padding-bottom: .6rem !important;
    margin: 0 auto;
    text-align: center;
}

.header__search-form input[type="search"]::placeholder {
    color: rgba(10, 27, 46, 0.4);
}

.header__search-form input[type="search"]:focus {
    outline: none;
}

.header__search-form input[type="submit"] {
    display: none;
}

body.search-is-visible {
    overflow: hidden;
}

.search-is-visible .header__search {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------------------------- *
   * ## desktop hover dropdown
   * ------------------------------------------------------------------- */

@media only screen and (min-width: 1025px) {
    .header__nav li:hover > ul,
    .header__nav li:focus-within > ul {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        -webkit-transform: translateY(0);
    }

    .header__nav li.has-children:hover > a::after {
        transform: rotate(225deg);
        -webkit-transform: rotate(225deg);
    }

    /* keep the last menu item's dropdown from overflowing the viewport */
    .header__nav > li:last-child ul,
    .header__nav > li:nth-last-child(2) ul {
        left: auto;
        right: 0;
    }
}

/* ------------------------------------------------------------------- *
   * ## responsive — mobile overlay nav
   * ------------------------------------------------------------------- */

@media only screen and (max-width: 1024px) {
    .header__toggle-menu {
        display: block;
    }

    .header__nav-wrap {
        background-color: #FFFFFF;
        margin: 0;
        border: none;
        opacity: 0;
        visibility: hidden;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 600;
        overflow-y: auto;
        display: block;
    }

    .header__nav-wrap .header__nav-heading {
        display: block;
        font-weight: 800;
        font-size: 1.2rem;
        line-height: 1.2;
        color: var(--as-navy);
        text-transform: uppercase;
        letter-spacing: .25rem;
        margin: 5rem 0 2rem;
        text-align: center;
    }

    .header__nav-wrap .close-mobile-menu {
        display: block;
    }

    .header__nav {
        display: block;
        margin: 0 2rem 3rem;
        border-bottom: 1px solid rgba(10, 27, 46, 0.08);
    }

    .header__nav > li {
        display: block;
        border-top: 1px solid rgba(10, 27, 46, 0.08);
    }

    .header__nav li {
        text-align: left;
    }

    .header__nav li a {
        display: block;
        line-height: 1;
        padding: 1.1rem 0.5rem;
        font-size: 16px;
        color: var(--as-ink);
        border-radius: 0;
    }

    .header__nav li a:hover {
        background-color: transparent;
        color: var(--as-navy);
    }

    .header__nav li.has-children > a::after {
        right: 0.75rem;
        opacity: 0.5;
    }

    .header__nav li.has-children > a.sub-menu-is-open::after {
        transform: rotate(225deg);
        -webkit-transform: rotate(225deg);
    }

    .header__nav li ul {
        display: none;
        position: static;
        min-width: 0;
        background-color: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0 0 0.75rem 0.75rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        -webkit-transform: none;
        transition: none !important;
    }

    .header__nav li ul li a {
        padding: 0.6rem 0.5rem;
        font-size: 14px;
        color: var(--as-muted);
    }

    header.nav-wrap-is-visible {
        overflow: hidden;
    }

    .nav-wrap-is-visible .header__nav-wrap {
        opacity: 1;
        visibility: visible;
    }
}

@media only screen and (max-width: 480px) {
    .header__inner {
        padding: 0 1rem;
    }

    .header__logo img {
        width: 140px;
        height: 28px;
    }
}
