/* ================================================================
   THE ORCHARD & CO. – CLEAN NAVIGATION
   Brand greens: #006837 (primary) · #004d28 (dark) · #52a832 (light)
   ================================================================ */

/* ---- Wrapper ---- */
.orchardnav {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    height: 100px;
    position: relative;    /* magic-line is positioned inside here */
}

/* ---- Top-level menu list ---- */
.orchardnav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}

/* ---- Every nav item ---- */
.orchardnav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

/* ================================================================
   MAGIC SLIDING LINE
   Injected by JS as <div class="orchardnav-magic-line">.
   It slides between top-level items with a cubic-bezier ease.
   ================================================================ */
.orchardnav-magic-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #004d28 0%, #006837 45%, #52a832 100%);
    border-radius: 2px 2px 0 0;
    pointer-events: none;
    z-index: 10001;

    /* Sliding and width transitions */
    transition:
        left    0.32s cubic-bezier(0.4, 0, 0.2, 1),
        width   0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.22s ease;

    opacity: 0;
}

.orchardnav-magic-line.is-visible {
    opacity: 1;
}

/* No transition on very first snap-to-position before it fades in */
.orchardnav-magic-line.no-transition {
    transition: opacity 0.22s ease !important;
}

/* ================================================================
   TOP-LEVEL LINKS
   border-bottom removed — the magic line replaces it.
   ================================================================ */
.orchardnav-menu > .orchardnav-item > a {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    transition: color 0.24s ease, background 0.24s ease;
}

/* Subtle green tint washes over the item on hover */
.orchardnav-menu > .orchardnav-item:hover > a {
    color: #006837;
    background: rgba(0, 104, 55, 0.04);
    text-decoration: none;
}

/* ================================================================
   CARET INDICATORS
   ================================================================ */
.orchardnav-caret,
.orchardnav-caret-right {
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.5;
    display: inline-block;
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
}

.orchardnav-menu > .orchardnav-item:hover > a .orchardnav-caret {
    transform: rotate(180deg);
    opacity: 1;
}

.orchardnav-dropdown .orchardnav-item:hover > a .orchardnav-caret-right {
    transform: translateX(3px);
    opacity: 1;
}

/* ================================================================
   DROPDOWN PANEL – HIDDEN STATE
   Uses opacity + visibility + transform so both enter and exit
   are animated. The 80ms hide-delay is the grace period.
   ================================================================ */
.orchardnav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 16px 44px rgba(0, 50, 20, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    overflow: hidden;

    /* Gradient top accent via pseudo-element */
    position: absolute;

    /* Hidden */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);

    /* Transitions when HIDING */
    transition:
        opacity    0.2s  ease   0.08s,
        transform  0.2s  ease   0.08s,
        visibility 0s    linear 0.28s;
}

/* Gradient accent bar at top of each dropdown */
.orchardnav-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #004d28 0%, #006837 50%, #52a832 100%);
    z-index: 1;
}

/* ================================================================
   DROPDOWN PANEL – SHOWN STATE
   Transitions when SHOWING (tiny 40ms delay prevents flicker
   when cursor passes briefly over a parent item).
   ================================================================ */
.orchardnav-item:hover > .orchardnav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);

    transition:
        opacity    0.24s ease   0.04s,
        transform  0.24s ease   0.04s,
        visibility 0s    linear 0s;
}

/* ================================================================
   INSTANT-SWITCH MODE
   Skips transition when cursor moves between two top-level items
   that both have dropdowns — the swap feels immediate not sluggish.
   ================================================================ */
.orchardnav.nav-switching .orchardnav-menu > .orchardnav-item > .orchardnav-dropdown {
    transition-duration: 0s !important;
    transition-delay:    0s !important;
}

/* ================================================================
   DROPDOWN ITEMS
   Two pseudo-elements create the flowing hover effect:
     ::before — background wipe that sweeps in from the left
     ::after  — accent bar that scales up from the vertical center
   No padding-shift (keeps text stable).
   ================================================================ */
.orchardnav-dropdown .orchardnav-item {
    display: block;
    position: relative;
}

.orchardnav-dropdown .orchardnav-item > a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #484848;
    text-decoration: none;
    overflow: hidden;          /* clips the wipe pseudo-element */
    z-index: 0;
    transition: color 0.22s ease;
}

/* Background wipe — slides in from the left */
.orchardnav-dropdown .orchardnav-item > a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 104, 55, 0.08) 0%, rgba(82, 168, 50, 0.04) 100%);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

/* Left accent bar — scales up from the vertical center */
.orchardnav-dropdown .orchardnav-item > a::after {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 3px;
    background: linear-gradient(180deg, #52a832, #006837);
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.04s;
    z-index: 1;
}

.orchardnav-dropdown .orchardnav-item > a:hover {
    color: #004d28;
    text-decoration: none;
}

.orchardnav-dropdown .orchardnav-item > a:hover::before {
    transform: translateX(0);
}

.orchardnav-dropdown .orchardnav-item > a:hover::after {
    transform: scaleY(1);
}

/* ================================================================
   SECOND-LEVEL FLYOUT
   Slides in from the right instead of downward.
   max-height + overflow-y prevents it growing past the viewport
   when there are many child items.
   ================================================================ */
.orchardnav-dropdown .orchardnav-dropdown {
    top: -8px;
    left: 100%;
    border-radius: 0 8px 8px 8px;

    /* Constrain height and scroll when there are many items */
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;

    /* Thin, on-brand scrollbar (Webkit) */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 104, 55, 0.35) transparent;

    /* No top gradient bar on flyouts — they have a left border instead */
    border-left: 2px solid rgba(0, 104, 55, 0.15);

    /* Fly in from the right */
    transform: translateX(10px);
}

.orchardnav-dropdown .orchardnav-dropdown::before {
    display: none;     /* suppress gradient bar on flyouts */
}

/* Webkit scrollbar styling for the flyout */
.orchardnav-dropdown .orchardnav-dropdown::-webkit-scrollbar {
    width: 4px;
}
.orchardnav-dropdown .orchardnav-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.orchardnav-dropdown .orchardnav-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 104, 55, 0.3);
    border-radius: 4px;
}
.orchardnav-dropdown .orchardnav-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 104, 55, 0.55);
}

.orchardnav-dropdown .orchardnav-item:hover > .orchardnav-dropdown {
    transform: translateX(0);
}

/* ================================================================
   TICKET / CTA BUTTON ITEM
   ================================================================ */
.orchardnav-menu > .orchardnav-item.li_tickets {
    align-items: center;
    margin-left: 8px;
}

.orchardnav-menu > .orchardnav-item.li_tickets > a {
    border-radius: 0 0 22px 22px;
    padding: 8px 18px;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    background: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.orchardnav-menu > .orchardnav-item.li_tickets > a:hover {
    opacity: 0.88;
    transform: scale(1.03);
    color: #fff !important;
    background: none;
}

/* ================================================================
   HAMBURGER BUTTON (hidden on desktop)
   ================================================================ */
.orchardnav-hamburger {
    display: none;
    background: transparent;
    border: 2px solid #444;
    border-radius: 4px;
    padding: 7px 11px;
    cursor: pointer;
    font-size: 17px;
    color: #444;
    align-self: center;
    margin-left: auto;
    line-height: 1;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.orchardnav-hamburger:hover,
.orchardnav-hamburger[aria-expanded="true"] {
    background: #006837;
    border-color: #006837;
    color: #fff;
}

/* ================================================================
   MOBILE  (≤ 768 px)
   ================================================================ */
@media (max-width: 768px) {

    .orchardnav-magic-line { display: none; }

    .orchardnav {
        height: auto;
        flex-wrap: wrap;
        align-items: center;
        padding: 8px 0;
    }

    .orchardnav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Full-width accordion panel */
    .orchardnav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        border-top: 2px solid #e6e6e6;
        margin-top: 8px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
    }

    .orchardnav-menu.orchardnav-open {
        display: flex;
    }

    .orchardnav-item {
        flex-direction: column;
    }

    /* Mobile top-level link */
    .orchardnav-menu > .orchardnav-item > a {
        border-bottom: 1px solid #eee;
        padding: 13px 20px;
        width: 100%;
        justify-content: space-between;
        background: transparent;
    }

    .orchardnav-menu > .orchardnav-item:hover > a {
        background: transparent;
    }

    /* Reset opacity/visibility — mobile uses display:none/block via JS */
    .orchardnav-dropdown {
        position: static;
        display: none;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        transition: none !important;
        box-shadow: none;
        border-radius: 0;
        border-left: 4px solid #006837;
        background: #f5f8f5;
        padding: 0;
        min-width: 0;
        width: 100%;
        overflow: visible;
    }

    .orchardnav-dropdown::before {
        display: none;
    }

    /* Prevent CSS hover from opening dropdowns on mobile */
    .orchardnav-item:hover > .orchardnav-dropdown {
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
    }

    .orchardnav-dropdown.orchardnav-open {
        display: block !important;
    }

    /* Sub-level indent */
    .orchardnav-dropdown .orchardnav-dropdown {
        top: 0;
        left: 0;
        border-left: 4px solid #004d28;
        border-right: none;
        border-radius: 0;
        margin-left: 14px;
        transform: none !important;
    }

    .orchardnav-dropdown .orchardnav-item:hover > .orchardnav-dropdown {
        display: none !important;
    }

    /* Disable wipe/accent animation on mobile items */
    .orchardnav-dropdown .orchardnav-item > a::before,
    .orchardnav-dropdown .orchardnav-item > a::after {
        display: none;
    }

    .orchardnav-dropdown .orchardnav-item > a {
        padding: 11px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        overflow: visible;
    }

    /* Caret rotation when accordion is open */
    .orchardnav-item.orchardnav-expanded > a .orchardnav-caret {
        transform: rotate(180deg);
        opacity: 1;
    }

    .orchardnav-item.orchardnav-expanded > a .orchardnav-caret-right {
        transform: rotate(90deg);
        opacity: 1;
    }
}
