/*
|--------------------------------------------------------------------------
| Page: ADUA Institutional Header - Search Styles
| File: assets/css/search.css
| Company: Ygrace Tech
| Author: Ibrahim Olalekan
|
| Purpose:
| Defines the visual presentation of the ADUA Institutional Header
| search button, expandable panel and search form.
|
| Architecture:
| - Uses scoped ADUA search selectors.
| - Supports desktop and mobile visibility settings.
| - Provides responsive search panel positioning.
| - Includes accessible focus and interaction states.
| - Uses institutional CSS variables with safe fallbacks.
| - Avoids interference with Astra and Elementor components.
|
| Version: 1.0.0
| Timestamp: 2026-11-21
|--------------------------------------------------------------------------
*/

/* ---------------------------------------------------------
   SEARCH ROOT
--------------------------------------------------------- */

.adua-ih-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 100;
}

/* ---------------------------------------------------------
   SEARCH TOGGLE
--------------------------------------------------------- */

.adua-ih-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--adua-ih-text-color, #243447);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.adua-ih-search-toggle:hover {
    background: rgba(0, 0, 0, 0.045);
    color: var(--adua-ih-primary, #123b68);
}

.adua-ih-search-toggle:focus-visible,
.adua-ih-search-close:focus-visible,
.adua-ih-search-submit:focus-visible {
    outline: 3px solid rgba(18, 59, 104, 0.3);
    outline-offset: 3px;
}

.adua-ih-search-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}



/* ---------------------------------------------------------
   VISIBILITY SETTINGS
--------------------------------------------------------- */

/*
 * DESKTOP
 * Show the search container when desktop search is enabled.
 * Hide it only when the desktop visibility class is absent.
 */

@media (min-width: 769px) {
    .adua-ih-search-mobile {
        display: none !important;
    }

    .adua-ih-search-desktop {
        display: inline-flex !important;
    }
}

/*
 * MOBILE
 * Show the search container when mobile search is enabled.
 * Hide it only when the mobile visibility class is absent.
 */

@media (max-width: 768px) {
    .adua-ih-search-desktop {
        display: none !important;
    }

    .adua-ih-search-mobile {
        display: inline-flex !important;
    }

    .adua-ih-search-toggle {
        min-width: 42px;
        min-height: 42px;
        padding: 0 10px;
    }
}



/* ---------------------------------------------------------
   SEARCH PANEL
--------------------------------------------------------- */

.adua-ih-search-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: min(540px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid rgba(20, 35, 55, 0.1);
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(15, 35, 60, 0.17);
    color: #243447;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 99999;
}

.adua-ih-search-panel[hidden] {
    display: none !important;
}

.adua-ih-search-panel.is-open {
    opacity: 1;
    transform: translateY(0);
}

.adua-ih-search-panel-inner {
    padding: 27px;
}

/* ---------------------------------------------------------
   PANEL HEADING
--------------------------------------------------------- */

.adua-ih-search-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.adua-ih-search-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--adua-ih-primary, #123b68);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.adua-ih-search-heading h2 {
    margin: 0;
    color: #172b43;
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
}

.adua-ih-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f4f7;
    color: #35465a;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.adua-ih-search-close:hover {
    background: #e5ebf1;
    color: var(--adua-ih-primary, #123b68);
}

/* ---------------------------------------------------------
   SEARCH FORM
--------------------------------------------------------- */

.adua-ih-search-form {
    display: block;
    width: 100%;
    margin: 0;
}

.adua-ih-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 6px 7px 6px 16px;
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    background: #ffffff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.adua-ih-search-input-wrap:focus-within {
    border-color: var(--adua-ih-primary, #123b68);
    box-shadow: 0 0 0 3px rgba(18, 59, 104, 0.09);
}

.adua-ih-search-input-icon {
    display: block;
    flex: 0 0 22px;
    color: #758497;
}

.adua-ih-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #243447;
    font-family: inherit;
    font-size: 15px;
}

.adua-ih-search-input::placeholder {
    color: #8794a3;
    opacity: 1;
}

.adua-ih-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 19px;
    border: 0;
    border-radius: 4px;
    background: var(--adua-ih-primary, #123b68);
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.adua-ih-search-submit:hover {
    background: var(--adua-ih-primary-dark, #0b2c50);
    color: #ffffff;
}

/* ---------------------------------------------------------
   HELP TEXT
--------------------------------------------------------- */

.adua-ih-search-help {
    margin: 14px 0 0;
    color: #778596;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   MOBILE PANEL
--------------------------------------------------------- */

@media (max-width: 768px) {
    .adua-ih-search-panel {
        position: fixed;
        top: var(--adua-ih-search-mobile-top, 90px);
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }

    .adua-ih-search-panel-inner {
        padding: 22px 18px;
    }

    .adua-ih-search-heading h2 {
        font-size: 19px;
    }

    .adua-ih-search-input-wrap {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .adua-ih-search-input-icon {
        margin-left: 3px;
    }

    .adua-ih-search-input {
        flex: 1 1 calc(100% - 45px);
    }

    .adua-ih-search-submit {
        width: 100%;
        min-height: 43px;
    }
}

/* ---------------------------------------------------------
   REDUCED MOTION
--------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .adua-ih-search-toggle,
    .adua-ih-search-panel,
    .adua-ih-search-close,
    .adua-ih-search-submit {
        transition: none;
    }
}
