/* ====================================================================
   Latest Posts Widget - عارض المقالات الذكي
   Public Styles - تصميم الواجهة الأمامية
   ==================================================================== */

.lpw-widget {
    direction: rtl;
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    margin-bottom: 25px;
}

/* ====================================================================
   نمط البطاقات (Cards Style) - الافتراضي
   ==================================================================== */

.lpw-style-cards {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.lpw-style-cards .lpw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.lpw-style-cards .lpw-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
}

.lpw-style-cards .lpw-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpw-style-cards .lpw-icon {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.lpw-style-cards .lpw-badge {
    background: #eff6ff;
    color: #1e3a8a;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.lpw-style-cards .lpw-card {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fafbfc;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.lpw-style-cards .lpw-card:last-child {
    margin-bottom: 0;
}

.lpw-style-cards .lpw-card:hover {
    background: #fff;
    border-color: #e5e7eb;
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.lpw-style-cards .lpw-card:hover .lpw-image img {
    transform: scale(1.05);
}

.lpw-style-cards .lpw-card:hover .lpw-card-title a {
    color: #1e3a8a !important;
}

.lpw-style-cards .lpw-image {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #f3f4f6;
}

.lpw-style-cards .lpw-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.lpw-style-cards .lpw-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 10px;
}

.lpw-style-cards .lpw-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-size: 28px;
    color: #94a3b8;
}

.lpw-style-cards .lpw-number {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.4);
}

.lpw-style-cards .lpw-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.lpw-style-cards .lpw-card-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.5 !important;
    color: #0f172a !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lpw-style-cards .lpw-card-title a {
    color: #0f172a !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.lpw-style-cards .lpw-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
}

.lpw-style-cards .lpw-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
}

.lpw-style-cards .lpw-date::before {
    content: '📅';
    font-size: 11px;
}

.lpw-style-cards .lpw-category {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 10px;
}

.lpw-style-cards .lpw-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 14px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.lpw-style-cards .lpw-view-all:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

/* ====================================================================
   نمط القائمة (List Style)
   ==================================================================== */

.lpw-style-list {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.lpw-style-list .lpw-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 15px !important;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e3a8a;
    color: #0f172a !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lpw-style-list .lpw-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lpw-style-list .lpw-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.lpw-style-list .lpw-list-item:last-child {
    border-bottom: none;
}

.lpw-style-list .lpw-list-thumb {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    border-radius: 8px;
    overflow: hidden;
}

.lpw-style-list .lpw-list-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.lpw-style-list .lpw-list-content {
    flex: 1;
    min-width: 0;
}

.lpw-style-list .lpw-list-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a !important;
    text-decoration: none !important;
    margin-bottom: 4px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.lpw-style-list .lpw-list-title:hover {
    color: #1e3a8a !important;
}

.lpw-style-list .lpw-list-date {
    font-size: 11px;
    color: #94a3b8;
}

/* ====================================================================
   نمط بسيط (Minimal Style)
   ==================================================================== */

.lpw-style-minimal {
    padding: 10px 0;
}

.lpw-style-minimal .lpw-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    margin: 0 0 12px !important;
    padding-right: 10px;
    border-right: 3px solid #1e3a8a;
    color: #0f172a !important;
}

.lpw-style-minimal .lpw-minimal-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lpw-style-minimal .lpw-minimal-item {
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.lpw-style-minimal .lpw-minimal-item:last-child {
    border-bottom: none;
}

.lpw-style-minimal .lpw-minimal-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #0f172a !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.lpw-style-minimal .lpw-minimal-item a:hover {
    color: #1e3a8a !important;
}

.lpw-style-minimal .lpw-minimal-title {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.lpw-style-minimal .lpw-minimal-date {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* ====================================================================
   متجاوب
   ==================================================================== */

@media (max-width: 768px) {
    .lpw-style-cards .lpw-image {
        width: 65px;
        height: 65px;
    }
    
    .lpw-style-cards .lpw-card-title {
        font-size: 12px !important;
    }
    
    .lpw-style-list .lpw-list-thumb {
        width: 50px;
        height: 50px;
    }
}

.lpw-no-posts {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    background: #f9fafb;
    border-radius: 8px;
    font-style: italic;
}
