﻿/* Kapsayıcı: Sonuç listesinin arama kutusuna göre konumlanması için relative */
.site-search {
    position: relative;
    width: 100%;
    max-width: 480px;
    font-family: inherit;
    box-sizing: border-box;
}

    .site-search *,
    .site-search *::before,
    .site-search *::after {
        box-sizing: inherit;
    }

/* Arama Kutusu */
#siteSearchInput {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
    line-height: 1.4;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    #siteSearchInput::placeholder {
        color: #94a3b8;
    }

    #siteSearchInput:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

/* Açılır Sonuç Listesi (Dropdown) */
#siteSearchResults {
    text-align:left !important;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 10px -4px rgba(15, 23, 42, 0.08);
}

    /* JS hidden / display:none durumunu korur */
    #siteSearchResults[hidden] {
        display: none !important;
    }

/* Sonuç Öğesi */
.search-result-item {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.12s ease;
}

    .search-result-item:last-child {
        border-bottom: none;
    }

    .search-result-item a {
        display: block;
        padding: 12px 16px;
        text-decoration: none;
        color: inherit;
    }

    /* Hover ve Klavye Ok Tuşları (is-active) Vurgusu */
    .search-result-item:hover,
    .search-result-item.is-active {
        background-color: #eff6ff;
    }

        .search-result-item:hover h3,
        .search-result-item.is-active h3 {
            color: #1d4ed8;
        }

    /* Sonuç Başlığı */
    .search-result-item h3 {
        margin: 0 0 4px 0;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.35;
        color: #0f172a;
    }

    /* Sonuç Açıklaması (En fazla 2 satır gösterilir) */
    .search-result-item p {
        margin: 0;
        font-size: 13px;
        line-height: 1.45;
        color: #475569;
        display: -webkit-box;
        /*-webkit-line-clamp: 2;*/
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Eşleşen Kelime Vurgusu (<mark>) */
    .search-result-item mark {
        background-color: #fef08a;
        color: #0f172a;
        font-weight: 600;
        padding: 0 2px;
        border-radius: 3px;
    }

/* Sonuç Bulunamadı Mesajı */
.search-empty {
    margin: 0;
    padding: 18px 16px;
    font-size: 14px;
    text-align: center;
    color: #64748b;
}

/* İnce Kaydırma Çubuğu (WebKit Tarayıcılar) */
#siteSearchResults::-webkit-scrollbar {
    width: 6px;
}

#siteSearchResults::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Mobil Uyumluluk */
@media (max-width: 640px) {
    .site-search {
        max-width: 100%;
    }

    /* Mobilde input odaklandığında iOS Safari'nin otomatik yakınlaştırmasını önler */
    #siteSearchInput {
        font-size: 16px;
        height: 44px;
    }

    #siteSearchResults {
        max-height: 65vh;
        border-radius: 8px;
    }

    .search-result-item a {
        padding: 11px 14px;
    }

    .search-result-item h3 {
        font-size: 14px;
    }
}
