/* ============================================================
   DESKTOP — Move Sun/Moon toggle more to the RIGHT
============================================================ */
@media (min-width: 1025px) {
    button#ai-dark-toggle-mobile {
        margin-left: 24px !important;  /* push it right */
        margin-right: 0 !important;    /* avoid pulling left */
    }
}

/* ============================================================
   HIDE CLONED SEARCH BUTTONS IN MOBILE MENU
============================================================ */
.c-nav__list--mobile .toggle-search-button,
.c-nav__list--mobile span:has(+ .toggle-search-button),
.c-nav__list--mobile .c-nav__item .toggle-search-button {
    display: none !important;
}

/* Always show the real relocated header search button */
.toggle-search-button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

/* Avoid mobile menu overrides */
.c-mobile-menu .toggle-search-button {
    display: none !important;
}

/* ============================================================
   MAKE SEARCH BUTTON LOOK CONSISTENT
============================================================ */
.toggle-search-button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    margin-left: 12px;
}

/* Mobile spacing for search button */
@media (max-width: 1023px) {
    .toggle-search-button {
        margin-left: 16px !important;
        margin-right: 8px !important;
    }
}

/* ============================================================
   MOBILE HEADER FIX — RIGHT ALIGN SEARCH + DARK MODE + HAMBURGER
============================================================ */
@media (max-width: 1023px) {
    .c-header__inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding-right: 12px !important;
    }

    /* Group right-side header tools (search + dark mode + hamburger) */
    .ai-mobile-tools {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
    }

    /* Match search icon spacing/size */
    .ai-mobile-tools .toggle-search-button {
        margin: 0 !important;
        padding: 2px 4px !important;
    }

    /* Prevent accidental centering */
    .toggle-search-button {
        align-self: center !important;
    }
}
