/* ============================================
   Site search — shared by every page that loads search.js.

   The panel is built by search.js, so the markup is identical everywhere; this
   file only dresses it. It is separate from styles.css because the event pages
   (IJEC, Future Talks) ship their own stylesheets.
   ============================================ */
/* ============================================
   Site search
   ============================================ */
.hf-search {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 20px 20px;
}

.hf-search[hidden] {
    display: none;
}

.hf-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(3px);
}

.hf-search-panel {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: 0 40px 90px -30px rgba(2, 6, 23, 0.6);
    overflow: hidden;
}

.hf-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(2, 6, 23, 0.07);
}

.hf-search-icon {
    flex: 0 0 auto;
    color: var(--text-medium);
}

.hf-search-bar input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    font-family: inherit;
    font-size: 1.08rem;
    color: var(--text-dark);
    background: transparent;
}

.hf-search-bar input::placeholder {
    color: rgba(100, 116, 139, 0.85);
}

.hf-search-ask {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.hf-search-ask:disabled {
    opacity: 0.6;
    cursor: progress;
}

.hf-search-close {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid rgba(2, 6, 23, 0.12);
    border-radius: 9px;
    background: none;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
}

.hf-search-close:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.hf-search-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px;
}

.hf-search-empty {
    margin: 0;
    padding: 22px 16px;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.hf-search-result {
    display: block;
    padding: 13px 16px;
    border-radius: 12px;
    color: inherit;
    transition: background 0.14s ease;
}

.hf-search-result.active,
.hf-search-result:hover {
    background: rgba(255, 75, 75, 0.07);
}

.hf-search-result-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hf-search-result-head strong {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
}

.hf-search-type {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(255, 75, 75, 0.1);
    border-radius: var(--radius-full);
    padding: 3px 9px;
}

.hf-search-snippet,
.hf-search-headings {
    display: block;
    margin-top: 5px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-medium);
}

.hf-search-headings {
    margin-top: 6px;
    font-size: 0.78rem;
    color: rgba(100, 116, 139, 0.95);
}

.hf-search mark {
    background: rgba(255, 209, 102, 0.55);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

.hf-search-ai:not([hidden]) {
    margin: 6px 6px 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.06) 0%, rgba(124, 92, 255, 0.07) 100%);
    border: 1px solid rgba(255, 75, 75, 0.18);
    border-radius: 14px;
}

.hf-search-answer-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--primary);
}

.hf-search-answer-text {
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--text-dark);
}

.hf-search-answer-sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(2, 6, 23, 0.14);
    font-size: 0.82rem;
    color: var(--text-medium);
}

.hf-search-answer-sources a {
    color: var(--primary);
    font-weight: 600;
    margin-right: 10px;
}

.hf-search-thinking {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.hf-search-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.35;
    animation: hf-pulse 1s infinite ease-in-out;
}

.hf-search-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.hf-search-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes hf-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

.hf-search-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 18px;
    border-top: 1px solid rgba(2, 6, 23, 0.07);
    font-size: 0.76rem;
    color: var(--text-medium);
}

.hf-search-foot kbd {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border: 1px solid rgba(2, 6, 23, 0.15);
    border-radius: 5px;
    background: rgba(2, 6, 23, 0.03);
}

.hf-search-foot-brand {
    font-weight: 700;
    color: rgba(100, 116, 139, 0.9);
}

body.hf-search-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .hf-search {
        padding: 0;
    }

    .hf-search-panel {
        max-width: none;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }

    .hf-search-bar {
        flex-wrap: wrap;
    }

    .hf-search-bar input {
        font-size: 1rem;
    }

    .hf-search-foot {
        display: none;
    }
}

/* The trigger, for pages whose navigation is not the shared one: it borrows the
   colour of whatever nav it sits in, so it looks at home in each of them. */
.hf-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hf-search-btn:hover {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.hf-search-btn--light {
    border-color: rgba(2, 6, 23, 0.14);
    background: rgba(2, 6, 23, 0.03);
    color: var(--text-dark, #0f172a);
}

.hf-search-btn--block {
    width: 100%;
    justify-content: center;
    margin: 6px 0 10px;
    padding: 12px 18px;
    font-size: 1rem;
}

@media (max-width: 900px) {
    .hf-search-btn:not(.hf-search-btn--block) span {
        display: none;
    }
}
