/* ─── Search toggle button ─────────────────────────────────── */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 0.75rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s;
}
.search-toggle:hover {
    color: #fff;
}

/* ─── Full-screen overlay ───────────────────────────────────── */
#searchOverlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(18, 22, 72, 0.97);
    display: none;
    flex-direction: column;
    padding: 3rem 2.5rem 2.5rem;
}
#searchOverlay.is-open {
    display: flex;
}

.search-overlay-inner {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

/* ─── Close button ─────────────────────────────────────────── */
.search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
    font-family: inherit;
}
.search-close:hover {
    color: #fff;
}

/* ─── Input area ───────────────────────────────────────────── */
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.85);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
}
.search-input-wrap svg {
    flex-shrink: 0;
}
#searchInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 1.4rem;
    color: #fff;
    font-family: inherit;
}
#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
#searchInput::-webkit-search-cancel-button {
    display: none;
}

/* ─── Results count ────────────────────────────────────────── */
.search-results-count {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    margin-bottom: 1rem;
    min-height: 1.2em;
}

/* ─── Result list ──────────────────────────────────────────── */
#searchResults {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* ─── Individual card ──────────────────────────────────────── */
.search-result {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.search-result:hover,
.search-result:focus,
.search-result.is-focused {
    background: rgba(255, 255, 255, 0.09);
    outline: none;
}

.search-result-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.search-result-icon {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.35);
}

.search-result-body {
    flex: 1;
    min-width: 0;
}
.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.search-result-type {
    font-size: 0.55rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.2em 0.6em;
    border-radius: 99px;
    flex-shrink: 0;
}
.search-result-type.type-project {
    background: rgba(91, 168, 255, 0.2);
    color: #7ec8ff;
}
.search-result-type.type-news {
    background: rgba(255, 191, 91, 0.2);
    color: #ffd07e;
}
.search-result-type.type-page {
    background: rgba(180, 180, 255, 0.15);
    color: #c4c4ff;
}

.search-result-cat {
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.search-result-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-arrow {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    margin-left: auto;
}

.search-loading,
.search-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    padding: 1rem 0;
    text-align: center;
}

/* ─── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    #searchOverlay {
        padding: 2rem 1.25rem 1.5rem;
    }
    #searchInput {
        font-size: 1.1rem;
    }
    .search-result-title {
        font-size: 0.875rem;
    }
}
