/* ============================================
   COMPONENT: Navigation Bar
   Top nav with logo on left, links centered,
   CTA on right. Matches Figma layout.
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-surface-line-soft);
    /* Side gutter lives on the full-width bar (OUTSIDE the 1240 cap), so the
       inner container is a TRUE 1240px wide — aligning it with .hero__card.
       Extra inset beyond section padding for the nav-only spacing request. */
    --navbar-side-extra: 24px;
    padding: 0 calc(var(--section-side-padding) + var(--navbar-side-extra));
}

.navbar__container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.navbar__logo {
    display: inline-flex;
    align-items: center;
    /* Never let the flex row crush the mark — that was the squish path. */
    flex-shrink: 0;
}

.navbar__logo-mark {
    /* Scale with height only; width follows the PNG's 400×292 ratio. */
    height: 58px;            /* tall enough that the baked-in tagline stays legible */
    width: auto;
    aspect-ratio: 400 / 292;
    max-width: none;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
}

.navbar__menu {
    flex: 1;
    display: flex;
    justify-content: center;
}

.navbar__list {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    line-height: 20px;
    letter-spacing: -0.26px;
    color: var(--color-text-strong);
    border-radius: 6px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    white-space: nowrap;
}

.navbar__link:hover,
.navbar__link:focus-visible,
.navbar__item--dropdown:hover > .navbar__link {
    color: var(--color-primary);
    background-color: var(--color-surface-soft); /* gray hover pill */
}

/* Meet the Team: pink text hover only — no gray highlight */
.navbar__link--no-bg:hover,
.navbar__link--no-bg:focus-visible {
    background-color: transparent;
}

.navbar__chevron {
    color: currentColor;
    flex-shrink: 0;
}

.navbar__cta {
    flex-shrink: 0;
}

.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
}

.navbar__toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-heading);
    border-radius: 2px;
    transition: transform var(--transition-fast);
}

/* ----- Dropdown submenu (e.g. Our Approach) ----- */
.navbar__item--dropdown {
    position: relative;
}

.navbar__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--color-white);
    border: 1px solid var(--color-surface-line-soft);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 200;
}

.navbar__item--dropdown:hover .navbar__submenu,
.navbar__item--dropdown:focus-within .navbar__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar__submenu-link {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    line-height: 20px;
    color: var(--color-text-strong);
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.navbar__submenu-link:hover {
    background: var(--color-surface-soft);
    color: var(--color-primary);
}

/* Lock page scroll while the mobile drawer is open, and dim the page
   behind it so outside taps land on this layer (not content under the menu). */
body.navbar-is-open {
    overflow: hidden;
}

body.navbar-is-open::before {
    content: "";
    position: fixed;
    inset: 76px 0 0 0;
    z-index: 99; /* below .navbar (100), above page content */
    background: rgba(46, 42, 52, 0.28);
}

@media (max-width: 1200px) {
    .navbar__list {
        gap: 4px;
    }
    .navbar__link {
        font-size: 12px;
    }
}

@media (max-width: 1024px) {
    .navbar {
        --navbar-side-extra: 12px;
    }

    .navbar__toggle {
        display: flex;
        order: 2;
        margin-left: auto;
    }

    .navbar__logo {
        order: 1;
    }

    .navbar__menu {
        display: none;
        order: 4;
        position: absolute;
        top: 76px;
        left: 0;
        right: 0;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-surface-line-soft);
        padding: var(--space-lg) var(--container-padding);
        box-shadow: var(--shadow-md);
        /* The panel is absolutely positioned inside a sticky navbar, so it
           adds no page height — without a cap a long menu simply runs off
           the bottom of the screen with no way to reach the last items.
           dvh keeps it right as mobile browser chrome shows and hides. */
        max-height: calc(100vh - 76px);
        max-height: calc(100dvh - 76px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .navbar__menu.navbar__menu--open {
        display: flex;
    }

    .navbar__list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        width: 100%;
    }

    /* Keep a compact header CTA on tablet/phone (don't let later .btn rules
       fight a hide rule). Shrink it so logo + toggle + CTA still fit at 320. */
    .navbar__cta.btn {
        display: inline-flex;
        order: 3;
        margin-left: 8px;
        padding: 7px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .navbar__logo-mark {
        height: 48px;            /* width stays auto via aspect-ratio */
    }

    /* In the mobile menu the submenu is shown inline (static + indented) */
    .navbar__submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 4px 0 0 16px;
        min-width: 0;
        margin-top: 4px;
    }
}

@media (max-width: 360px) {
    .navbar__cta.btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .navbar__logo-mark {
        height: 44px;            /* width stays auto via aspect-ratio */
    }

    .navbar {
        --navbar-side-extra: 0;
        padding: 0 16px; /* was 12px — keep a bit more air on narrow phones */
    }
}
