/* ============================================================
   CMS marketing header (Pages/Cms/_Layout.cshtml)
   Built from the Figma "Desktop Nav" designs. Uses the design
   system tokens in ee-design-system.css for color/typography.
   ============================================================ */

.ee-header {
    font-family: var(--ee-font);
    position: relative;
    z-index: 1000;
}

.ee-header *,
.ee-header *::before,
.ee-header *::after {
    box-sizing: border-box;
}

/* ---------- Top green announcement bar ---------- */
.ee-header__topbar {
    background: var(--forest-green-80);
    color: var(--white);
}

.ee-header__topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 9px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: var(--font-size-14);
    line-height: 1.2;
}

.ee-header__topbar-text {
    color: var(--white);
    font-weight: var(--font-weight-medium)
}

.ee-header__topbar-link {
    color: var(--white);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ee-header__topbar-link:hover,
.ee-header__topbar-link:focus-visible {
    color: var(--disco-blue-40);
    text-decoration: none;
}

.ee-header__topbar-emoji {
    font-size: 15px;
    line-height: 1;
}

.ee-header__topbar-link .ee-chevron {
    font-size: 11px;
}

/* ---------- White nav ---------- */
.ee-nav {
    background: var(--white);
    /* border-bottom: 1px solid var(--gray-30); */
}

.ee-nav__inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.ee-nav__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.ee-nav__brand img {
    height: 34px;
    width: auto;
    display: block;
}

/* The links + actions sit as one right-aligned group, leaving a
   gap between the brand and the menu (matches the design). */
.ee-nav__menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.ee-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 28px;
    /* Centered on the page (within the nav container) independent of the brand
       and actions widths. The brand stays flush left and actions flush right;
       this list is taken out of flow and pinned to the container's center.
       Reset to in-flow inside the mobile drawer (see the media query below). */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ee-nav__item {
    position: relative;
    display: flex;
    align-items: center;
}

/* Top-level link, whether <a> or the dropdown <button> */
.ee-nav__link {
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    color: var(--forest-green-80);
    text-decoration: none;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.ee-nav__link:focus-visible {
    color: var(--disco-blue-80);
    text-decoration: none;
}

.ee-nav__caret {
    font-size: 11px;
    transition: transform 0.15s ease;
}

/* Separate caret toggle that sits next to the label link. The label link navigates (like
   Success Stories); this button opens/closes the dropdown. On desktop the panel also opens on
   hover; on touch/mobile this caret is how you reach the sub-items without leaving the page. */
.ee-nav__caret-btn {
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px 0;
    margin-left: 6px;
    color: var(--forest-green-80);
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.ee-nav__caret-btn:focus-visible {
    color: var(--disco-blue-80);
}

.ee-has-dropdown.is-open > .ee-nav__link,
.ee-has-dropdown.is-open > .ee-nav__caret-btn {
    color: var(--disco-blue-80);
}

.ee-has-dropdown.is-open > .ee-nav__caret-btn .ee-nav__caret {
    transform: rotate(180deg);
}

/* ---------- Right-side actions ---------- */
.ee-nav__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ee-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border-radius: 999px;
    padding: 11px 22px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.ee-btn--primary {
    background: var(--disco-blue-60);
    color: var(--forest-green-80);
}

.ee-btn--primary:hover,
.ee-btn--primary:focus-visible {
    background: var(--disco-blue-80);
    color: var(--white);
    text-decoration: none;
}

/* Signed-out circular user icon */
.ee-nav__usericon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--gray-30);
    color: var(--forest-green-80);
    font-size: 20px;
    text-decoration: none;
    flex: 0 0 auto;
}

.ee-nav__usericon:hover,
.ee-nav__usericon:focus-visible {
    border-color: var(--disco-blue-60);
    color: var(--disco-blue-80);
}

/* Signed-in "Hi, {name}" toggle */
.ee-nav__user-toggle {
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    color: var(--forest-green-80);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    white-space: nowrap;
}

.ee-nav__user-toggle .ee-nav__usericon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    pointer-events: none;
}

.ee-nav__user-menu.is-open .ee-nav__user-toggle {
    color: var(--disco-blue-80);
}

/* ============================================================
   Dropdown panels
   ============================================================ */
.ee-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-30);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(3, 37, 29, 0.12);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 1100;
}

/* A hover bridge so the panel doesn't close while the cursor
   travels from the trigger to the panel. */
.ee-dropdown::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

.ee-has-dropdown:focus-within > .ee-dropdown,
.ee-has-dropdown.is-open > .ee-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover affordances apply ONLY where a real (mouse) pointer exists. On touch devices — iPhone /
   Safari especially — a :hover rule that reveals the dropdown makes the OS treat the first tap as
   a "hover" and swallow the click, so tapping the caret wouldn't open the submenu. Gating these
   behind (hover: hover) lets the tap register as a real click; touch relies on the caret toggle
   (.is-open) and focus-within instead. */
@media (hover: hover) {
    .ee-nav__link:hover {
        color: var(--disco-blue-80);
        text-decoration: none;
    }

    .ee-nav__caret-btn:hover {
        color: var(--disco-blue-80);
    }

    .ee-has-dropdown:hover > .ee-nav__link,
    .ee-has-dropdown:hover > .ee-nav__caret-btn {
        color: var(--disco-blue-80);
    }

    .ee-nav__user-menu:hover .ee-nav__user-toggle {
        color: var(--disco-blue-80);
    }

    .ee-has-dropdown:hover > .ee-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.ee-dropdown--right {
    left: auto;
    right: 0;
}

/* Wide mega-panels (Resources, Pricing) drop their own positioning context so the
   panel anchors to the nav container's right edge instead of the (far-right)
   trigger li. This keeps the panel aligned to the header's content margin and
   prevents it from running off either edge at narrow desktop widths. The user
   menu intentionally keeps li-anchoring so it stays under "Hi, {name}". */
.ee-nav__item.ee-nav__item--anchor-right {
    position: static;
}

/* "How it works" / "Pricing" — primary list + secondary panel */
.ee-dropdown--split {
    display: flex;
    gap: 24px;
    width: max-content;
    /* Size to content (the competitor list can be 2-3 columns wide) but never
       exceed the viewport. The panel is right-anchored, so it grows leftward. */
    max-width: calc(100vw - 32px);
}

.ee-dropdown__primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 260px;
}

.ee-dropdown__secondary {
    padding: 8px 8px 8px 32px;
    border-left: 1px solid var(--gray-30);
    min-width: 240px;
}

/* "Resources" — 2x2 feature grid */
.ee-dropdown--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 4px 18px;
    width: max-content;
}

/* Feature item (icon + title + description). Plain line icon, no tile;
   hover underlines the title and tints the icon (matches the rollover spec). */
.ee-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
}

.ee-feature:hover,
.ee-feature:focus-visible {
    text-decoration: none;
}

.ee-feature__icon {
    flex: 0 0 auto;
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: var(--forest-green-60);
    font-size: 20px;
    margin-top: 1px;
    transition: color 0.12s ease;
}

.ee-feature:hover .ee-feature__icon,
.ee-feature:focus-visible .ee-feature__icon {
    color: var(--disco-blue-80);
}

.ee-feature__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ee-feature__title {
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-bold);
    color: var(--forest-green-80);
    line-height: 1.25;
}

.ee-feature:hover .ee-feature__title,
.ee-feature:focus-visible .ee-feature__title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ee-feature__desc {
    font-size: var(--font-size-13);
    color: var(--gray-70);
    line-height: 1.3;
}

/* Heading inside a dropdown panel ("Businesses we serve", etc.) */
.ee-dropdown__heading {
    margin: 0 0 18px;
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-medium);
    color: var(--gray-60);
}

.ee-dropdown__cols {
    display: flex;
    gap: 56px;
}

.ee-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ee-link-list a {
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    color: var(--forest-green-80);
    text-decoration: none;
    white-space: nowrap;
}

.ee-link-list a:hover,
.ee-link-list a:focus-visible {
    color: var(--forest-green-80);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- User menu dropdown ---------- */
.ee-dropdown--user {
    min-width: 240px;
    padding: 14px;
}

.ee-dropdown--user .ee-dropdown__heading {
    font-size: var(--font-size-16);
    color: var(--forest-green-80);
    padding: 4px 10px;
    margin-bottom: 8px;
}

.ee-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ee-menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    color: var(--forest-green-80);
    text-decoration: none;
}

.ee-menu-list a .ee-menu-icon {
    width: 20px;
    text-align: center;
    color: var(--gray-70);
    font-size: 16px;
}

.ee-menu-list a:hover,
.ee-menu-list a:focus-visible {
    background: var(--disco-blue-20);
    color: var(--disco-blue-80);
    text-decoration: none;
}

.ee-menu-list a:hover .ee-menu-icon,
.ee-menu-list a:focus-visible .ee-menu-icon {
    color: var(--disco-blue-80);
}

.ee-menu-divider {
    height: 1px;
    background: var(--gray-30);
    border: 0;
    margin: 8px 4px;
}

/* ---------- Mobile toggle (hamburger) ---------- */
.ee-nav__toggle {
    display: none;
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
}

.ee-nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--forest-green-80);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ee-header.is-menu-open .ee-nav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ee-header.is-menu-open .ee-nav__toggle span:nth-child(2) {
    opacity: 0;
}

.ee-header.is-menu-open .ee-nav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Responsive — collapse to a vertical drawer below 992px
   ============================================================ */
@media (max-width: 991.98px) {
    .ee-nav__toggle {
        display: flex;
    }

    .ee-nav__menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-30);
        box-shadow: 0 18px 40px rgba(3, 37, 29, 0.12);
        padding: 8px 16px 20px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        display: none;
    }

    .ee-header.is-menu-open .ee-nav__menu {
        display: flex;
    }

    .ee-nav__list {
        position: static;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    /* Row that wraps: label link + caret button on line 1, the dropdown panel (full width)
       on line 2 when open. */
    .ee-nav__item {
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid var(--gray-20);
    }

    .ee-nav__link {
        flex: 1 1 auto;
        padding: 14px 4px;
    }

    .ee-nav__caret-btn {
        margin-left: 0;
        padding: 14px 10px;   /* larger tap target, pushed to the right by the flexed link */
    }

    /* Dropdowns become inline accordions on mobile */
    .ee-dropdown {
        position: static;
        flex-basis: 100%;     /* force onto its own full-width row below the label/caret */
        opacity: 1;
        visibility: visible;
        transform: none;
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0 0 12px 8px;
        display: none;
        width: auto;
        max-width: none;
    }

    .ee-dropdown::before {
        display: none;
    }

    .ee-has-dropdown.is-open > .ee-dropdown {
        display: block;
    }

    .ee-dropdown--split,
    .ee-dropdown--grid {
        display: none;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .ee-has-dropdown.is-open > .ee-dropdown--split {
        display: flex;
    }

    .ee-has-dropdown.is-open > .ee-dropdown--grid {
        display: grid;
    }

    .ee-dropdown__secondary {
        border-left: 0;
        padding: 8px 0 0;
    }

    .ee-dropdown__cols {
        gap: 24px;
    }

    .ee-nav__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 16px;
        width: 100%;
    }

    .ee-btn--primary {
        width: 100%;
    }

    .ee-nav__user-menu {
        width: 100%;
    }

    .ee-nav__user-toggle {
        justify-content: space-between;
        width: 100%;
        padding: 14px 4px;
    }

    .ee-dropdown--user {
        min-width: 0;
        padding: 0 0 8px;
    }
}
