/* صندوق البحث الرئيسي */
.cls-search-box {
    position: relative;
    max-width: 320px;
    margin: 0 auto;
}

/* الفورم */
.cls-search-form {
    display: flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.cls-search-input {
    flex: 1;
    padding: 8px 10px;
    border: none;
    outline: none;
    text-align: right;
}

.cls-search-submit {
    border: none;
    background: #005b8f;
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.cls-search-submit:hover {
    background: #00456b;
}

/* قائمة النتائج (AJAX) */
.cls-results-list {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    display: none; /* نخفيها افتراضياً، نظهرها من الـ JS عند وجود نتائج */
}

.cls-results-list.is-visible {
    display: block;
}

.cls-result-item {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f3f3;
}

.cls-result-item:last-child {
    border-bottom: none;
}

.cls-result-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.cls-result-item a:hover {
    color: #005b8f;
}

.cls-result-author {
    display: block;
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.cls-results-empty {
    padding: 8px 10px;
    color: #777;
    font-size: 13px;
}

/* صفحة نتائج البحث - تنسيق محسّن */
.cls-search-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    direction: rtl;
}

/* التخطيط مع الأعمدة الجانبية */
.cls-search-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* العمود الجانبي */
.cls-search-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 20px;
}

.cls-sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.cls-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #005b8f;
}

/* مقالات السايد بار مع الصور */
.cls-sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cls-sidebar-post {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 20px;
}

.cls-sidebar-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cls-sidebar-post-image {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.cls-sidebar-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cls-sidebar-post-image:hover img {
    transform: scale(1.05);
}

.cls-sidebar-post-content {
    flex: 1;
}

.cls-sidebar-post-title {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.cls-sidebar-post-title a {
    text-decoration: none;
    color: #1f2937;
    transition: color 0.2s;
}

.cls-sidebar-post-title a:hover {
    color: #005b8f;
}

.cls-sidebar-post-excerpt {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cls-sidebar-post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.cls-sidebar-post-author {
    font-weight: 500;
}

.cls-sidebar-post-sep {
    opacity: 0.6;
}

.cls-sidebar-post-date {
    font-variant-numeric: tabular-nums;
}

/* قالب Elementor في السايد بار */
.cls-sidebar-elementor-template {
    width: 100%;
}

.cls-sidebar-elementor-template .elementor {
    width: 100%;
}

.cls-sidebar-elementor-template .elementor-section {
    margin: 0;
    padding: 0;
}

.cls-sidebar-elementor-template .elementor-container {
    max-width: 100%;
    padding: 0;
}

/* المحتوى الرئيسي */
.cls-search-main {
    flex: 1;
    min-width: 0;
}

.cls-search-results-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.cls-search-results-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.4;
}

.cls-search-results-title .cls-search-query {
    color: #005b8f;
    font-weight: 700;
}

.cls-search-results-count {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.cls-search-results-wrapper {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 0;
}

.cls-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cls-search-result-item {
    padding: 16px 20px;
    margin: 0 8px 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cls-search-result-item:hover {
    border-color: #005b8f33;
    box-shadow: 0 2px 8px rgba(0, 91, 143, 0.08);
}

.cls-search-result-item:last-of-type {
    margin-bottom: 0;
}

.cls-search-result-link {
    display: block;
    text-decoration: none;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 6px;
}

.cls-search-result-link:hover {
    color: #005b8f;
}

.cls-search-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b7280;
}

.cls-search-result-author {
    font-weight: 500;
}

.cls-search-result-sep {
    opacity: 0.6;
}

.cls-search-result-date {
    font-variant-numeric: tabular-nums;
}

/* الترقيم */
.cls-search-pagination {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.cls-search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    margin: 0 4px;
    font-size: 0.9rem;
    color: #4b5563;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.cls-search-pagination .page-numbers:hover,
.cls-search-pagination .page-numbers.current {
    background: #005b8f;
    color: #fff;
    border-color: #005b8f;
}

.cls-search-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.cls-search-pagination .page-numbers.dots:hover {
    background: transparent;
    color: inherit;
}

/* لا توجد نتائج */
.cls-search-no-results {
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.cls-search-no-results p {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsive - للشاشات الصغيرة */
@media (max-width: 768px) {
    .cls-search-layout {
        flex-direction: column;
        gap: 24px;
    }
    
    .cls-search-sidebar {
        flex: 1;
        position: static;
        width: 100%;
        max-width: 100%;
    }
    
    .cls-search-results-page {
        padding: 24px 16px 32px;
    }
    
    .cls-sidebar-widget {
        margin-bottom: 20px;
    }
    
    .cls-sidebar-posts {
        gap: 16px;
    }
    
    .cls-sidebar-post {
        padding-bottom: 16px;
    }
}


