/*
 * Algolia type-ahead search modal
 * Look & behavior modeled on covalent.com site search.
 * Self-contained: no build step, no dependency on the theme SCSS pipeline.
 */

.eag-as-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
    -webkit-font-smoothing: antialiased;
    font-family: Arial, Verdana, sans-serif;
}

.eag-as-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease;
}

.eag-as-dialog {
    width: 100%;
    max-width: 720px;
    margin-top: 9vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px 0 rgba(0, 0, 0, 0.25), 0 4px 16px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-12px) scale(0.985);
    transition: transform 0.18s ease;
}

.eag-as-overlay.is-open .eag-as-dialog {
    transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
    .eag-as-dialog {
        margin-top: 1rem;
    }
}

/* input row */
.eag-as-inputwrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #ededed;
}

.eag-as-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: #1f6fb2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eag-as-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.eag-as-input {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #161616;
    font-size: 18px;
    line-height: 1.4;
    padding: 4px 0;
    font-family: inherit;
    -webkit-appearance: none;
    box-shadow: none;
    border-radius: 0;
    min-height: 0;
}

.eag-as-input::placeholder {
    color: #9aa0a6;
    font-size: 18px;
}

.eag-as-input::-webkit-search-cancel-button,
.eag-as-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.eag-as-close {
    flex: 0 0 auto;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
    color: #8a8f94;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 9px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
}

.eag-as-close:hover {
    color: #555;
    border-color: #bbb;
}

/* results */
.eag-as-results {
    overflow-y: auto;
    max-height: min(60vh, 520px);
    padding: 0.5rem;
}

.eag-as-results:empty {
    display: none;
}

.eag-as-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 10px 12px;
    border-radius: 10px;
    color: #161616;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s ease;
}

.eag-as-result:hover,
.eag-as-result:focus {
    color: #161616;
    text-decoration: none;
}

.eag-as-result.is-active {
    background: #e3f4fc;
}

.eag-as-result__body {
    flex: 1 1 auto;
    min-width: 0;
}

.eag-as-result__title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #161616;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eag-as-result__excerpt {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eag-as-result__chevron {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: #c4c8cc;
    margin-left: 0.5rem;
}

.eag-as-result__chevron svg {
    width: 16px;
    height: 16px;
    display: block;
}

.eag-as-mark,
.eag-as-result em {
    background: #ffe082;
    color: #0b1b2c;
    font-weight: 600;
    font-style: normal;
    border-radius: 2px;
    padding: 0 1px;
}

/* messages (empty / no-results) */
.eag-as-message {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #9aa0a6;
    font-size: 14px;
    line-height: 1.6;
}

.eag-as-message strong {
    color: #555;
    font-weight: 600;
}

/* footer hints */
.eag-as-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 0.7rem 1.25rem;
    border-top: 1px solid #ededed;
    background: #fafafa;
    font-size: 12px;
    color: #8a8f94;
}

.eag-as-hint span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.eag-as-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid #dcdcdc;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    color: #555;
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
}

@media (max-width: 600px) {
    .eag-as-hint {
        gap: 0.85rem;
        font-size: 11px;
    }
}
