/* =====================================================================
   LikedWin — Site içi arama
   ---------------------------------------------------------------------
   1) Öneri paneli (.srch-pop) — header, mobil menü ve /ara kutusunda
   2) Mobil menü ve /ara sayfasındaki arama kutusu (.site-search)
   3) /ara sonuç sayfası (.srch-*)
   Gradyan yok; tüm renkler site.css token'larından (koyu tema kendiliğinden).
   Platform ikon rengi --srch-c ile satır içinden gelir.
   ===================================================================== */

/* ---------- 1) Öneri paneli ---------- */
.head-search[data-site-search] { position: relative; }

.srch-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: max(100%, 440px);
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 120;
    text-align: left;
}
.srch-pop[hidden] { display: none; }

.srch-pop__group + .srch-pop__group {
    margin-top: 4px; padding-top: 4px;
    border-top: 1px solid var(--line);
}
.srch-pop__label,
.srch-pop__head {
    padding: 8px 10px 4px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted-2);
}
.srch-pop__head { display: flex; align-items: center; justify-content: space-between; }
.srch-pop__clear {
    border: 0; background: none; padding: 2px 4px; cursor: pointer;
    font: inherit; font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 600;
    color: var(--brand);
}
.srch-pop__clear:hover { text-decoration: underline; }

.srch-pop__item {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
}
.srch-pop__item.is-active { background: var(--brand-soft); }

.srch-pop__media {
    flex: none;
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 14px;
}
.srch-pop__media.has-color { background: var(--srch-c); color: #fff; }
.srch-pop__media.has-color.is-light { color: var(--ink-on-light); }
.srch-pop__media--img { overflow: hidden; background: var(--bg-soft); }
.srch-pop__media--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.srch-pop__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srch-pop__title {
    font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srch-pop__sub {
    font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srch-pop__title mark,
.srch-item__title mark,
.srch-item__snip mark {
    background: none; color: var(--brand); font-weight: 800;
}
.srch-pop__go { flex: none; font-size: 12px; color: var(--muted-2); opacity: 0; transition: opacity var(--ease), transform var(--ease); }
.srch-pop__item.is-active .srch-pop__go { opacity: 1; color: var(--brand); transform: translateX(2px); }

.srch-pop__all {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: 6px; padding: 11px 12px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
    font-size: 13px; font-weight: 700; color: var(--brand);
    text-decoration: none;
}
.srch-pop__all span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-pop__all b {
    flex: none; min-width: 26px; padding: 2px 8px; border-radius: 8px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 12px; text-align: center;
}
.srch-pop__all.is-active { background: var(--brand-soft); }
.srch-pop__all.is-active b { background: var(--brand); color: #fff; }

.srch-pop__recent { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px 8px; }
.srch-pop__chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 11px; border-radius: 8px;
    background: var(--bg-soft); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--text);
    text-decoration: none;
}
.srch-pop__chip i { font-size: 11px; color: var(--muted-2); }
.srch-pop__chip.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.srch-pop__empty {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 22px 16px; text-align: center;
    font-size: 13px; color: var(--muted);
}
.srch-pop__empty b { font-size: 14px; color: var(--ink); }
.srch-pop__empty a { color: var(--brand); font-weight: 600; }
.srch-pop__empty-ico {
    display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px;
    border-radius: 10px; background: var(--bg-soft); color: var(--muted-2); font-size: 16px;
}

/* Yüklenirken büyüteç yerine dönen halka */
[data-site-search].is-loading .head-search__icon,
[data-site-search].is-loading .site-search__icon { animation: srchPulse .8s ease-in-out infinite alternate; color: var(--brand); }
@keyframes srchPulse { from { opacity: .35; } to { opacity: 1; } }

/* ---------- 2) Mobil menü + /ara kutusu ---------- */
.site-search { position: relative; display: flex; align-items: center; }
.site-search__icon {
    position: absolute; left: 15px; top: 0; height: 48px;
    display: flex; align-items: center;
    font-size: 15px; color: var(--muted-2); pointer-events: none;
}
.site-search__input {
    width: 100%; height: 48px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: 15px; font-weight: 500;
    outline: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.site-search__input::placeholder { color: var(--muted-2); }
.site-search__input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.site-search:focus-within .site-search__icon { color: var(--brand); }

/* Mobil menü: öneriler kutunun altında satır içi (menü zaten kayıyor) */
.site-search--drawer { flex-wrap: wrap; padding: 12px 20px 4px; }
.site-search--drawer .site-search__icon { left: 35px; top: 12px; }
.site-search--drawer .srch-pop {
    position: static; width: 100%; max-height: none;
    margin-top: 8px; box-shadow: none;
}

/* /ara sayfası: büyük kutu + Ara butonu */
.site-search--page { max-width: 680px; margin: 22px auto 0; flex-wrap: wrap; }
.site-search--page .site-search__icon { height: 56px; left: 18px; font-size: 17px; }
.site-search--page .site-search__input {
    height: 56px; padding: 0 110px 0 48px;
    border-radius: 14px; font-size: 16px;
    box-shadow: var(--shadow-md);
}
.site-search__submit {
    position: absolute; right: 7px; top: 7px; height: 42px;
    padding: 0 22px; border: 0; border-radius: 10px;
    background: var(--brand); color: #fff;
    font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
    transition: background var(--ease);
}
.site-search__submit:hover { background: var(--brand-dark); }
.site-search--page .srch-pop { width: 100%; top: calc(56px + 8px); }

/* ---------- 3) /ara sonuç sayfası ---------- */
.srch-hero {
    padding: clamp(28px, 4vw, 48px) 0 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    text-align: center;
}
.srch-hero__title {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(22px, 3vw, 34px); font-weight: 800; line-height: 1.2;
    letter-spacing: -.02em; color: var(--ink);
    overflow-wrap: anywhere;
}
.srch-hero__sub { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.srch-hero__sub b { color: var(--ink); }

.srch-tabs {
    display: flex; gap: 6px;
    margin-top: 26px;
    overflow-x: auto; scrollbar-width: none;
    justify-content: center;
}
.srch-tabs::-webkit-scrollbar { display: none; }
.srch-tab {
    flex: none;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 14px 12px;
    border-bottom: 2px solid transparent;
    font-size: 14px; font-weight: 600; color: var(--muted);
    text-decoration: none; white-space: nowrap;
    transition: color var(--ease), border-color var(--ease);
}
.srch-tab i { font-size: 12px; }
.srch-tab span {
    padding: 1px 7px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.srch-tab:hover { color: var(--ink); }
.srch-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.srch-tab.is-active span { background: var(--brand); border-color: var(--brand); color: #fff; }

.srch-body { padding: clamp(24px, 3.4vw, 44px) 0 clamp(48px, 6vw, 80px); }
.srch-body .container { max-width: 980px; }

.srch-group + .srch-group { margin-top: clamp(26px, 3vw, 38px); }
.srch-group__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.srch-group__title {
    margin: 0; display: inline-flex; align-items: center; gap: 9px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 17px; font-weight: 800; color: var(--ink);
}
.srch-group__title i { font-size: 14px; color: var(--brand); }
.srch-group__count { font-size: 13px; color: var(--muted-2); font-weight: 600; }
.srch-group__more {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.5px; font-weight: 700; color: var(--brand); text-decoration: none;
}
.srch-group__more:hover { text-decoration: underline; }

.srch-list {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.srch-list--grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px;
    background: none; border: 0; border-radius: 0; overflow: visible;
}

.srch-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 15px 18px;
    color: var(--text); text-decoration: none;
    transition: background var(--ease);
}
.srch-list:not(.srch-list--grid) .srch-item + .srch-item { border-top: 1px solid var(--line); }
.srch-item:hover { background: var(--bg-soft); }
.srch-item--card {
    align-items: center;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.srch-item--card:hover { background: var(--surface); border-color: var(--brand-line-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.srch-item__media {
    flex: none; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand); font-size: 16px;
}
.srch-item__media[style] { background: var(--srch-c); color: #fff; }
.srch-item.is-light .srch-item__media[style] { color: var(--ink-on-light); }
.srch-item__media--img { width: 72px; height: 50px; overflow: hidden; background: var(--bg-soft); }
.srch-item__media--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.srch-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srch-item__title { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.srch-item--card .srch-item__title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-item__sub { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.srch-item__snip {
    margin-top: 3px; font-size: 13.5px; line-height: 1.55; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.srch-item__go { flex: none; align-self: center; font-size: 13px; color: var(--muted-2); transition: color var(--ease), transform var(--ease); }
.srch-item:hover .srch-item__go { color: var(--brand); transform: translateX(3px); }

/* Boş durum */
.srch-empty {
    max-width: 620px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
    padding: clamp(18px, 3vw, 34px) 0; text-align: center;
}
.srch-empty__ico {
    display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 16px;
    border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 24px;
}
.srch-empty__t {
    margin: 0 0 8px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(18px, 2.2vw, 22px); font-weight: 800; color: var(--ink);
    overflow-wrap: anywhere;
}
.srch-empty__d { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.srch-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.srch-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none;
    transition: border-color var(--ease), color var(--ease);
}
.srch-chip i { font-size: 11px; color: var(--brand); }
.srch-chip:hover { border-color: var(--brand); color: var(--brand); }
.srch-empty__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.srch-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 18px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--line-strong);
    font-size: 14px; font-weight: 700; color: var(--text); text-decoration: none;
}
.srch-btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.srch-btn:hover { border-color: var(--brand); }
.srch-btn--primary:hover { background: var(--brand-dark); }

@media (max-width: 640px) {
    .srch-tabs { justify-content: flex-start; margin-left: -20px; margin-right: -20px; padding: 0 12px; }
    .site-search--page .site-search__input { padding-right: 16px; }
    .site-search__submit { display: none; }
    .srch-item { padding: 13px 14px; gap: 12px; }
    .srch-item__media--img { width: 56px; height: 42px; }
    .srch-group__head { flex-wrap: wrap; }
    .srch-list--grid { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    [data-site-search].is-loading .head-search__icon,
    [data-site-search].is-loading .site-search__icon { animation: none; }
}
