/* Moteur de recherche - styles */

.site-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0 1rem;
    max-width: 360px;
    width: 100%;
}

.site-search-input {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1px solid #d0d4dc;
    border-radius: 999px;
    padding: 0.55rem 1.1rem 0.55rem 2.4rem;
    font-size: 0.92rem;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 220px;
}

.site-search-input::placeholder {
    color: #94a3b8;
}

.site-search-input:focus {
    outline: none;
    border-color: #b45309;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18);
}

.site-search::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.site-search-submit {
    appearance: none;
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 0;
    width: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.site-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(540px, calc(100vw - 2rem));
    max-height: min(70vh, 540px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    z-index: 1100;
    display: none;
    padding: 0.4rem 0;
}

.site-search-results.search-results--visible {
    display: block;
}

.search-results-count {
    padding: 0.55rem 1rem 0.4rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #f1f5f9;
}

.search-result {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.12s ease;
}

.search-result:last-child {
    border-bottom: 0;
}

.search-result:hover,
.search-result:focus {
    background-color: #fff8ed;
    outline: none;
}

.search-result-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-result-region {
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    color: #ffffff;
}

.search-region-tanzanie {
    background: #b45309;
}

.search-region-kenya {
    background: #047857;
}

.search-region-general {
    background: #475569;
}

.search-result-cat {
    color: #64748b;
    align-self: center;
}

.search-result-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.search-result-excerpt {
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.4;
}

.search-result mark {
    background: rgba(180, 83, 9, 0.18);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.search-empty {
    padding: 1rem;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.search-empty a {
    color: #b45309;
    font-weight: 600;
}

/* Responsive : sur mobile, la barre passe en pleine largeur sous le logo */
@media (max-width: 900px) {
    .site-search {
        order: 99;
        margin: 0.6rem 0 0;
        max-width: 100%;
    }
    .site-search-input {
        min-width: 0;
    }
    .site-search-results {
        left: 0;
        right: 0;
        width: auto;
        max-height: 60vh;
    }
}
