/**
 * LUPKYNIS Pro – 2026 HCP global header: utility bar and main menu
 * (Figma Navigation_DT_1440).
 *
 * Its own file rather than the tail of theme-overrides.css: that tail is edited by
 * every branch, and the Pantheon pre-deploy merges each PR into upstream, where it
 * has diverged from master. Loaded after theme-overrides.css via its dependency.
 */

:root {
    --header-nav-teal: #007b76;
    --header-nav-teal-dark: #004946;
    --header-nav-ink: #023038;
    --header-nav-sea-green-300: #54c8c3;
    --header-nav-mint: #b5ebdc;
    /* Height of the desktop menu card (Figma main_nav: 20px + 47px logo + 20px). */
    --header-nav-card-h: 87px;
    /* Figma main_nav bottom stroke: 3px, outside the card, so the card renders 90px. */
    --header-nav-rule-h: 3px;
    --header-nav-card-total-h: calc(var(--header-nav-card-h) + var(--header-nav-rule-h));
    /* Figma Horizontal_Light stroke on main_nav (2106:3310). */
    --header-nav-rule: linear-gradient(90deg, #004946 0%, #00ada6 50.48%, #b0e6e3 100%);
}

/* ==========================================================================
   1. Utility bar
   ========================================================================== */

.utility-nav {
    background: var(--header-nav-teal);
    color: #fff;
    font-family: "Mulish", sans-serif;
    font-size: 0.875rem;
    line-height: normal;
}

header .utility-nav {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.utility-nav .nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 2.5rem;
    max-width: none;
    margin: 0;
    padding: 0.5rem 1.25rem;
}

.utility-nav .utility-nav__disclaimer {
    margin: 0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    white-space: nowrap;
}

.utility-nav .nav .nav__section {
    flex: 1 0 0;
    align-items: center;
    justify-content: flex-end;
    gap: 1.75rem;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.utility-nav .nav .nav__section .nav__item {
    display: flex;
    align-items: center;
    height: auto;
    margin: 0;
    padding: 0;
}

/* Drop the legacy bullet separators between items. */
.utility-nav .nav__item::before,
.utility-nav .nav__item::after {
    content: none;
    display: none;
}

.utility-nav .nav .nav__link {
    display: inline-flex;
    padding: 0;
    align-items: center;
    gap: 0.375rem;
    font-family: "Mulish", sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25;
    letter-spacing: normal;
    white-space: nowrap;
    text-transform: none;
    text-decoration: underline;
    color: #fff;
}

.utility-nav .nav__link img {
    flex: none;
    display: block;
}

.utility-nav .nav .nav__link--start-form {
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--header-nav-teal-dark);
    font-weight: 700;
}

.utility-nav .nav .nav__link:hover,
.utility-nav .nav .nav__link:focus,
.utility-nav .nav .nav__link:active {
    color: #fff;
    text-decoration-thickness: 2px;
}

.utility-nav .nav__link:focus-visible,
.utility-nav .sr-only-focusable:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .utility-nav .nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        min-height: 0;
        padding: 0 clamp(1.25rem, 6.95vw, 6.25rem);
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .utility-nav .nav .nav__section {
        gap: 0.875rem;
    }

    .utility-nav .utility-nav__disclaimer,
    .utility-nav .nav .nav__link {
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   2. Main menu (desktop card). Selectors carry `header ... .nav .nav__nav-item`
   so they outrank the legacy style-min.css rules they replace.
   ========================================================================== */

@media (min-width: 992px) {
    header .header__container,
    header.sticky .header__container {
        max-width: none;
        margin-top: 0;
        padding: 0 clamp(1.25rem, 4.17vw, 3.75rem);
    }

    /* The row around the card is see-through: the page hero shows in the side margins. */
    header .header__container {
        position: relative;
        background: transparent;
    }

    header .primary-nav,
    header.sticky .primary-nav {
        position: relative;
        margin: 0;
        /*
         * Figma main_nav: white card with 10px bottom corners and a 3px gradient stroke
         * outside its bottom edge. The stroke is the bottom border painted by the
         * gradient layer, so it follows the corner curve and thins to nothing at the
         * sides instead of running square under it. Outer radius = 10px + 3px.
         */
        border-bottom: var(--header-nav-rule-h) solid transparent;
        border-radius: 0 0 calc(10px + var(--header-nav-rule-h)) calc(10px + var(--header-nav-rule-h));
        background: linear-gradient(#fff, #fff) padding-box, var(--header-nav-rule) border-box;
        box-shadow: 0 6px 16px rgba(1, 20, 24, 0.25);
    }

    header .primary-nav .primary-nav__wrapper,
    header.sticky .primary-nav .primary-nav__wrapper {
        box-sizing: border-box;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        height: var(--header-nav-card-h);
        margin: 0;
        padding: 0 clamp(1.5rem, 2.78vw, 2.5rem);
    }

    /*
     * The first hero runs up behind the card, so the card floats on its dark texture
     * (Figma: Home and interior heroes start under the utility bar). The negative
     * margin and the top border/padding cancel out, so the hero content does not move;
     * only its background grows upwards. The margin also covers the 3px rule under the
     * card (it lengthens the header), the border/padding only the card, so the hero
     * content stays where it was before the rule moved outside the card.
     */
    .subhead-wrapper > header + #intro {
        margin-top: calc(-1 * var(--header-nav-card-total-h));
        border-top: var(--header-nav-card-h) solid transparent;
        /* hcp-refresh.css sets this hero's background with an !important shorthand. */
        background-origin: border-box !important;
    }

    /* The home hero clips its art to the padding box, so it grows with padding instead. */
    #front header + main > .home-hero:first-child {
        margin-top: calc(-1 * var(--header-nav-card-total-h));
        padding-top: var(--header-nav-card-h);
    }

    /* Sticky: the card leaves the flow; hold exactly its height so nothing jumps. */
    header.sticky {
        padding-bottom: var(--header-nav-card-total-h);
    }

    header .primary-nav .primary-nav__brand-logo {
        flex: none;
        width: 160px;
    }

    header .primary-nav .primary-nav__brand-logo img,
    header.sticky .primary-nav .primary-nav__brand-logo img {
        display: block;
        width: auto;
        max-width: 160px;
        height: 47px;
        margin: 0;
    }

    header .primary-nav .nav,
    header.sticky .primary-nav .nav {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 1rem;
        margin: 0;
    }

    header .primary-nav .nav .nav__nav-item,
    header.sticky .primary-nav .nav .nav__nav-item {
        margin: 0;
    }

    header .primary-nav .nav .nav__nav-item.utility {
        display: none;
    }

    header .primary-nav .nav .nav__nav-item::before,
    header.sticky .primary-nav .nav .nav__nav-item::before {
        content: none;
        display: none;
    }

    header .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link,
    header.sticky .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link {
        display: block;
        padding: 0.25rem 0;
        font-family: "Mulish", sans-serif;
        font-weight: 600;
        font-size: 0.875rem;
        line-height: normal;
        text-transform: none;
        white-space: nowrap;
        color: var(--header-nav-ink);
    }

    header .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link:hover,
    header .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link:focus {
        color: var(--header-nav-teal);
    }

    /*
     * The current page is the link carrying aria-current. main-min.js also adds .active
     * by matching hrefs, which marks every item on a 404, so .active alone is not trusted.
     */
    header .primary-nav .nav .nav__nav-item.active > .nav__nav-item__nav-link:not([aria-current="page"]):not(:hover):not(:focus) {
        font-weight: 600;
        color: var(--header-nav-ink);
    }

    /*
     * The server also puts .active on the current item, and style-min.css paints
     * `.primary-nav .nav .nav__nav-item.active > .nav__nav-item__nav-link:not(.btn)` ink
     * (0,6,0). Repeat .active and :not(.btn) here so the Figma teal outranks it (0,7,1).
     */
    header .primary-nav .nav .nav__nav-item > .nav__nav-item__nav-link[aria-current="page"],
    header .primary-nav .nav .nav__nav-item.active > .nav__nav-item__nav-link[aria-current="page"]:not(.btn) {
        font-weight: 800;
        color: var(--header-nav-teal);
    }

    header .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link:focus-visible {
        outline: 2px solid var(--header-nav-teal);
        outline-offset: 4px;
    }

    /* Sticky state: the bar stays the same card, pinned to the top. */
    header.sticky .header__container {
        background: transparent;
        filter: none;
    }
}

@media (min-width: 1200px) {
    header .primary-nav .nav,
    header.sticky .primary-nav .nav {
        gap: clamp(1.5rem, 2.78vw, 2.5rem);
    }

    header .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link,
    header.sticky .primary-nav .nav .nav__nav-item .nav__nav-item__nav-link {
        padding: 0.25rem 0;
        font-size: 1rem;
    }

    /* Legacy sticky rule fixed the 4th item's width for the old two-line label. */
    header.sticky .primary-nav .nav .nav__nav-item:nth-child(4) a {
        width: auto;
    }
}

/* Mobile drawer keeps its existing component; only keyboard focus is made visible. */
@media (max-width: 991.98px) {
    header .primary-nav .nav .nav__nav-item__nav-link:focus-visible {
        outline: 2px solid #fff;
        outline-offset: -4px;
    }

    header .primary-nav__toggle:focus-visible {
        outline: 2px solid var(--header-nav-teal);
        outline-offset: 2px;
    }
}
