/* ===================================
   HOMEPAGE STICKY MENU NAVIGATION
   Sticky positioned below the fixed hero bar
   Modeled after single-property sticky menu (sp-condo-menu-info)
   =================================== */

/* Spacer to prevent content jump */
.hp-menu-spacer {
    height: 0;
    margin: 0;
    padding: 0;
    transition: height 0.2s ease;
}

.hp-menu-spacer.active {
    height: 48px; /* Matches menu height */
}

/* Sticky Menu Container */
.hp-condo-menu-info {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
    position: sticky;
    top: 0;
    z-index: 998; /* Below sticky hero (999) */
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    transition: top 0.3s ease;
}

/* Remove bottom margin from hero section so menu sits flush against it */
.hp-hero-section {
    margin-bottom: 0 !important;
}

/* The fixed sticky hero is position:fixed so it doesn't affect flow,
   but ensure no spacing from its wrapper */
.hp-sticky-hero + .hp-menu-spacer {
    margin-top: 0;
}

/* When sticky hero is visible, push menu below it */
.hp-condo-menu-info.hp-below-hero {
    top: var(--hp-sticky-hero-height, 80px);
}

.hp-condo-menu-nav {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.hp-condo-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
}

.hp-condo-menu-item {
    margin: 0;
    position: relative;
    flex: 1;
}

.hp-condo-menu-link {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 0;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    text-align: center;
}

.hp-condo-menu-link:hover {
    color: #2c5aa0;
    background-color: rgb(44 90 160 / 5%);
    border-bottom-color: #2c5aa0;
    text-decoration: none;
}

.hp-condo-menu-link:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.hp-condo-menu-link.active {
    color: #2c5aa0;
    background-color: rgb(44 90 160 / 10%);
    border-bottom-color: #2c5aa0;
}

/* "Top" link - special styling */
.hp-condo-project-title-item .hp-condo-menu-link {
    font-weight: 700;
    color: #1a1a1a;
    background-color: rgb(44 90 160 / 10%);
    border-bottom-color: #2c5aa0;
}

.hp-condo-project-title-item .hp-condo-menu-link:hover {
    background-color: rgb(44 90 160 / 15%);
}

/* Hidden conditional items (when target section doesn't exist) */
.hp-condo-menu-item.hp-menu-hidden {
    display: none;
}

/* ===================================
   INLINE SEARCH IN MENU BAR
   =================================== */

/* Search menu item - takes more space than nav items */
.hp-menu-item-search {
    flex: 2;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
}

/* Override acs-section when inside menu */
.hp-menu-item-search .acs-section {
    padding: 0;
    width: 100%;
}

.hp-menu-item-search .acs-container {
    max-width: 100%;
    padding: 0;
}

/* Compact search wrapper to fit menu height */
.hp-menu-item-search .acs-search-wrapper {
    border-radius: 6px;
    border-width: 1px;
    border-color: #dee2e6;
}

.hp-menu-item-search .acs-search-input {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.hp-menu-item-search .acs-dropdown-toggle {
    width: 36px;
}

/* Tree dropdown inside menu: ensure it opens below properly */
.hp-menu-item-search .acs-tree-dropdown {
    left: 0;
    right: 0;
    z-index: 10000;
}

/* Hide search when sticky hero is visible (menu is in sticky/below-hero mode) */
.hp-condo-menu-info.hp-below-hero .hp-menu-item-search {
    display: none;
}

/* ===================================
   RESPONSIVE - TABLET
   =================================== */

@media (width <= 1024px) {
    .hp-condo-menu-list {
        justify-content: flex-start;
        gap: 0;
    }

    .hp-condo-menu-link {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* ===================================
   RESPONSIVE - MOBILE: Hide menu
   =================================== */

@media (width <= 768px) {
    .hp-condo-menu-info {
        display: none;
    }

    .hp-menu-spacer {
        display: none;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .hp-condo-menu-info,
    .hp-condo-menu-link,
    .hp-menu-spacer {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .hp-condo-menu-info {
        border: 2px solid #000;
    }

    .hp-condo-menu-link.active {
        border-bottom-width: 3px;
    }
}

/* ===================================
   PRINT: Hide sticky menu
   =================================== */

@media print {
    .hp-condo-menu-info,
    .hp-menu-spacer {
        display: none;
    }
}
