/* Menu bar specific styles */
#navigation {
    background: linear-gradient(to bottom, #4c911a, #3d7315);
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 100;
    width: 100%;
    overflow-x: visible;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.wsite-menu-default {
    display: flex !important;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 0 10px;
    list-style: none;
    width: 100%;
    flex-wrap: nowrap;
    gap: 1px;
    opacity: 1 !important;
    visibility: visible !important;
}

.wsite-menu-item-wrap {
    position: relative;
    margin: 0;
    padding: 0;
}

.wsite-menu-item {
    display: block !important;
    padding: 8px 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    white-space: nowrap;
    text-align: center;
    opacity: 1 !important;
    visibility: visible !important;
}

.wsite-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Active menu item */
#active .wsite-menu-item {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Submenu styles */
.wsite-menu-wrap {
    position: absolute;
    display: none; /* default hidden; JS removes .collapsed to show */
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 0; /* allow natural width */
    width: max-content; /* hug contents, avoid extra right whitespace */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
}
/* When JS toggles off the collapsed class, show the submenu */
.wsite-menu-wrap:not(.collapsed) { display: block; }

/* Keep hover behavior on desktop; JS handles mobile */
.wsite-menu-item-wrap:hover .wsite-menu-wrap { display: block; }

/* Arrow for dropdown */
.wsite-menu-wrap::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}

.wsite-menu {
    padding: 0;
    margin: 0;
    list-style: none;
    white-space: nowrap; /* keep items on one line to size container to content */
}

.wsite-menu-subitem {
    display: block;
    padding: 10px 12px; /* reduce horizontal padding to eliminate right gap */
    color: #333333;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease; /* avoid layout shift */
    text-decoration: none;
    position: relative;
    text-align: left; /* align text left for consistent edge */
}

.wsite-menu-subitem:hover {
    background: #f8f8f8;
    color: #4c911a;
}

/* Animation for submenu items */
.wsite-menu li {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.wsite-menu-item-wrap:hover .wsite-menu li {
    opacity: 1;
    transform: translateY(0);
}

/* Delay each submenu item animation */
.wsite-menu li:nth-child(1) { transition-delay: 0.05s; }
.wsite-menu li:nth-child(2) { transition-delay: 0.1s; }
.wsite-menu li:nth-child(3) { transition-delay: 0.15s; }
.wsite-menu li:nth-child(4) { transition-delay: 0.2s; }
.wsite-menu li:nth-child(5) { transition-delay: 0.25s; }

.wsite-menu-subitem:hover {
    background: #f5f5f5;
    color: #4c911a;
}

/* Mobile menu styles */
@media screen and (max-width: 768px) {
    .mobile-menu-button {
        display: block;
        width: 100%;
        padding: 15px;
        background: #4c911a;
        color: white;
        border: none;
        font-size: 16px;
        font-weight: 500;
        text-align: center;
        cursor: pointer;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    #navigation {
        margin-top: 50px;
        display: block !important;
        visibility: visible !important;
    }

    .wsite-menu-default {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        visibility: visible !important;
    }

    #navigation.mobile-open .wsite-menu-default {
        display: flex;
    }

    .wsite-menu-item-wrap {
        width: 100%;
    }

    .wsite-menu-item {
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .wsite-menu-wrap {
        position: static;
        width: 100%;
        box-shadow: none;
        background: rgba(0,0,0,0.1);
    }

    .wsite-menu {
        padding: 0;
    }

    .wsite-menu-subitem {
        padding: 12px 25px;
        text-align: center;
        color: rgba(255,255,255,0.9);
        background: rgba(0,0,0,0.2);
        display: block;
        width: 100%;
    }

    .wsite-menu-subitem:hover {
        background: rgba(0,0,0,0.3);
        color: #ffffff;
    }

    /* Prevent hover showing menu on mobile */
    .wsite-menu-item-wrap:hover .wsite-menu-wrap {
        display: none;
    }
}

/* Fix: override animation rules that hid submenu contents on some pages
   Ensures submenu list items are visible by default (removes hover-only visibility)
   This is a pragmatic override to fix pages where animations or inline styles
   caused the menu to remain invisible until mouse hover. */
.wsite-menu li {
    opacity: 1 !important;
    transform: none !important;
}

.wsite-menu-wrap {
    /* allow JS to continue animating opacity if needed, but ensure it's visible */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#navigation, .wsite-menu-default, .wsite-menu-item {
    opacity: 1 !important;
    visibility: visible !important;
}
