/* ==========================================================================
   نتایج جستجو — Novinex
   استریم کارتی مستقل (بدون ساختار آرشیوی): جعبه‌ی جست‌وجوی بزرگ + ردیف‌های
   بدون حاشیه با خط جداکننده، متمایز از گرید کارتی آرشیو فروشگاه.
   ========================================================================== */

:root {
    --ap-primary: #2B5CE6;
    --ap-primary-strong: #1E46B8;
    --ap-primary-soft: #F3F6FD;
    --ap-blue: #7fb5ff;
    --ap-ink: #14101f;
    --ap-ink-soft: #3a3350;
    --ap-muted: #6f6893;
    --ap-bg: #eef4ff;
    --ap-border: #e3ddf5;
    --ap-gradient: linear-gradient(135deg, #2B5CE6 0%, #7fb5ff 100%);
    --ap-shadow-sm: 0 8px 22px rgba(76, 42, 165, 0.08);
    --ap-shadow-md: 0 16px 40px rgba(76, 42, 165, 0.12);
    --ap-pill: 999px;
    --ap-radius: 18px;
    --ap-radius-lg: 26px;
    --ap-transition: 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ap-search-page { direction: rtl; background: var(--ap-bg); color: var(--ap-ink); overflow-x: clip }

/* ---------- هیرو + جعبه‌ی جست‌وجو ---------- */
.ap-search-hero {
    position: relative; padding: 62px 0 46px; overflow: hidden;
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(127, 181, 255, .35), transparent 60%),
        radial-gradient(700px 420px at 10% 0%, rgba(108, 43, 217, .18), transparent 55%),
        var(--ap-bg);
}
.ap-search-hero__title {
    margin: 0 0 12px; font-size: clamp(26px, 4.2vw, 42px); line-height: 1.5;
    background: linear-gradient(120deg, var(--ap-ink) 30%, var(--ap-primary) 75%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ap-search-hero__desc { margin: 0 0 24px; color: var(--ap-muted); font-size: 15px; line-height: 2 }
.ap-search-again { display: flex; gap: 10px; max-width: 620px }
.ap-search-again input {
    flex: 1; min-width: 0; box-sizing: border-box; padding: 15px 20px;
    border: 1px solid var(--ap-border); border-radius: var(--ap-pill); background: #fff;
    font: inherit; font-size: 15px; color: var(--ap-ink); outline: none;
    box-shadow: var(--ap-shadow-sm);
    transition: border-color var(--ap-transition), box-shadow var(--ap-transition);
}
.ap-search-again input:focus { border-color: var(--ap-primary); box-shadow: 0 0 0 4px var(--ap-primary-soft) }
.ap-search-again button {
    padding: 15px 30px; border: 0; border-radius: var(--ap-pill);
    background: var(--ap-gradient); color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
    box-shadow: var(--ap-shadow-sm);
    transition: transform var(--ap-transition), box-shadow var(--ap-transition);
}
.ap-search-again button:hover { transform: translateY(-2px); box-shadow: var(--ap-shadow-md) }

/* ---------- نتایج دقیق + گرید همه دوره‌ها ---------- */
.ap-search-matches { max-width: 880px; margin: 0 auto 46px; display: grid }
.ap-search-matches__heading {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 6px; padding-bottom: 14px; border-bottom: 2px solid var(--ap-border);
}
.ap-search-matches__heading .ap-eyebrow { color: var(--ap-primary); font-size: 12px; font-weight: 900 }
.ap-search-matches__heading h2 { margin: 6px 0 0; font-size: clamp(21px, 2.8vw, 28px) }
.ap-search-matches__count { color: var(--ap-muted); font-size: 12.5px; font-weight: 800; white-space: nowrap }
.ap-search-all-courses { max-width: 1180px; margin: 0 auto }

/* ---------- کارت دوره — همان DNA کارت‌های آرشیو، مستقل از افزونه ---------- */
.ap-search-courses-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px }
.ap-course-card {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--ap-border); border-radius: 22px; background: #fff;
    box-shadow: var(--ap-shadow-sm);
    transition: transform var(--ap-transition), box-shadow var(--ap-transition), border-color var(--ap-transition);
}
.ap-course-card:hover { transform: translateY(-6px); border-color: #c9b7f0; box-shadow: var(--ap-shadow-md) }
.ap-course-card__thumb {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
    background: linear-gradient(135deg, #f3effb, #eaf5ff);
}
.ap-course-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s }
.ap-course-card:hover .ap-course-card__thumb img { transform: scale(1.05) }
.ap-course-card__glyph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 42px }
.ap-course-card__type {
    position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: var(--ap-pill);
    background: rgba(28, 18, 52, .82); color: #fff; font-size: 10.5px; font-weight: 800;
}
.ap-course-card.is-in-person .ap-course-card__type { background: linear-gradient(135deg, #0ea772, #12b981) }
.ap-course-card__body { display: flex; flex: 1; flex-direction: column; padding: 17px 19px 19px }
.ap-course-card__topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--ap-muted); font-size: 11px }
.ap-course-card__topline em { font-style: normal; color: var(--ap-primary); font-weight: 700 }
.ap-course-card__body h3 {
    margin: 0 0 14px; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 15.5px; line-height: 1.7;
}
.ap-course-card__body h3 a { color: var(--ap-ink); text-decoration: none }
.ap-course-card__body h3 a:hover { color: var(--ap-primary) }
.ap-course-card__foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: auto; padding-top: 13px; border-top: 1px dashed var(--ap-border);
}
.ap-course-card__price { color: var(--ap-primary-strong); font-size: 15px; font-weight: 800 }
.ap-course-card__price.is-range { color: var(--ap-muted); font-size: 13px }
.ap-course-card__price del { margin-right: 6px; color: #b2aabd; font-size: 11px; font-weight: 500 }
.ap-course-card__cta {
    display: inline-flex; align-items: center; gap: 5px; padding: 9px 15px; border-radius: var(--ap-pill);
    background: var(--ap-gradient); color: #fff !important; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap;
    box-shadow: var(--ap-shadow-sm);
    transition: transform var(--ap-transition), box-shadow var(--ap-transition);
}
.ap-course-card__cta:hover { transform: translateY(-2px); box-shadow: var(--ap-shadow-md) }

@media (max-width: 980px) { .ap-search-courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 560px) { .ap-search-courses-grid { grid-template-columns: 1fr } }

/* ---------- بدنه: استریم بدون کارت ---------- */
.ap-search-body { padding: 26px 20px 80px }
.ap-stream-item {
    display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 20px; align-items: center;
    padding: 22px 6px; border-bottom: 1px solid var(--ap-border);
    transition: background var(--ap-transition);
}
.ap-stream-item:first-child { padding-top: 10px }
.ap-stream-item:hover { background: rgba(255, 255, 255, .65) }
.ap-stream-item__thumb {
    display: block; overflow: hidden; width: 132px; height: 92px;
    border-radius: 14px; background: linear-gradient(135deg, #f3effb, #eaf5ff);
    box-shadow: var(--ap-shadow-sm);
}
.ap-stream-item__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s }
.ap-stream-item:hover .ap-stream-item__thumb img { transform: scale(1.05) }
.ap-stream-item__glyph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 30px }
.ap-stream-item__main { min-width: 0 }
.ap-stream-item__chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px }
.ap-stream-item__chip {
    display: inline-flex; padding: 4px 11px; border-radius: var(--ap-pill);
    background: var(--ap-primary-soft); color: var(--ap-primary-strong);
    font-size: 10.5px; font-weight: 800;
}
.ap-stream-item__chip.is-course { background: var(--ap-gradient); color: #fff }
.ap-stream-item__chip.is-soft { background: #f2f6ff; color: var(--ap-ink-soft) }
.ap-stream-item__title { margin: 0 0 6px; font-size: 17.5px; line-height: 1.7 }
.ap-stream-item__title a { color: var(--ap-ink); text-decoration: none }
.ap-stream-item__title a:hover { color: var(--ap-primary) }
.ap-stream-item__excerpt {
    display: -webkit-box; overflow: hidden; margin: 0;
    color: var(--ap-muted); font-size: 13.5px; line-height: 2;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.ap-stream-item__cta {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    color: var(--ap-primary); font-size: 12px; font-weight: 800; text-decoration: none;
}
.ap-stream-item__cta:hover { gap: 10px }

/* ---------- صفحه‌بندی ---------- */
.ap-search-pagination { display: flex; justify-content: center; margin-top: 30px }
.ap-search-pagination ul { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0; list-style: none }
.ap-search-pagination a, .ap-search-pagination span {
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--ap-border); border-radius: 13px; background: #fff;
    color: var(--ap-muted); font-size: 13px; text-decoration: none;
}
.ap-search-pagination .current { border-color: var(--ap-primary); background: var(--ap-primary); color: #fff }
.ap-search-pagination a:hover { border-color: var(--ap-primary); color: var(--ap-primary) }

/* ---------- حالت خالی ---------- */
.ap-search-empty {
    display: grid; gap: 12px; justify-items: center; max-width: 620px; margin: 30px auto 0;
    padding: 64px 30px; text-align: center;
    border: 1.5px dashed #d9c8f7; border-radius: var(--ap-radius-lg); background: #fff;
    box-shadow: var(--ap-shadow-sm);
}
.ap-search-empty__icon { font-size: 44px }
.ap-search-empty strong { color: var(--ap-ink); font-size: 21px }
.ap-search-empty p { margin: 0; color: var(--ap-muted); font-size: 14.5px; line-height: 2 }
.ap-search-empty__links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px }
.ap-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: var(--ap-pill);
    font: inherit; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer;
    transition: transform var(--ap-transition), box-shadow var(--ap-transition), border-color var(--ap-transition);
}
.ap-search-btn.is-primary { background: var(--ap-gradient); color: #fff !important; box-shadow: var(--ap-shadow-sm) }
.ap-search-btn.is-primary:hover { transform: translateY(-2px); box-shadow: var(--ap-shadow-md) }
.ap-search-btn.is-ghost { background: transparent; color: var(--ap-primary) !important; border: 2px solid var(--ap-primary-soft) }
.ap-search-btn.is-ghost:hover { border-color: var(--ap-primary); transform: translateY(-2px) }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 720px) {
    .ap-search-hero { padding: 44px 0 36px }
    .ap-search-body { padding: 20px 20px 60px }
    .ap-stream-item { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 18px 2px }
    .ap-stream-item__thumb { width: 96px; height: 74px }
    .ap-stream-item__cta { grid-column: 2; justify-self: start; margin-top: 2px }
    .ap-search-again { flex-direction: column }
    .ap-search-again button { width: 100% }
    .ap-search-empty { padding: 44px 20px }
    .ap-search-matches__heading { align-items: start; flex-direction: column }
}
