/*
Theme Name: مدونة مرام التقنية
Description: قالب ووردبريس عربي احترافي للمدونات التقنية مع دعم RTL كامل
Author: Maram Tech Blog
Version: 1.0
Text Domain: maram-tech
Domain Path: /languages
*/

/* إعادة تعيين الأساسيات */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* المتغيرات الأساسية */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --background-color: #ffffff;
  --surface-color: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --font-family-ar: 'Noto Sans Arabic', 'Cairo', Arial, sans-serif;
  --font-family-en: 'Inter', system-ui, sans-serif;
}

/* الوضع المظلم */
.dark-mode {
  --background-color: #0f172a;
  --surface-color: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
}

/* الخطوط الأساسية */
body {
  font-family: var(--font-family-ar);
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  transition: all 0.3s ease;
}

/* الروابط */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* الحاوي الرئيسي */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* الهيدر */
.site-header {
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* القائمة الرئيسية */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
  background-color: var(--primary-color);
  color: white;
}

/* البحث */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-color);
  color: var(--text-primary);
  width: 200px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* المحتوى الرئيسي */
.site-main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* بطاقات المقالات */
.article-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-featured-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-category {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.article-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.article-title a {
  color: var(--text-primary);
}

.article-title a:hover {
  color: var(--primary-color);
}

.article-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.article-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.read-more {
  color: var(--primary-color);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* الشريط الجانبي */
.sidebar {
  background: var(--surface-color);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.widget {
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 1.125rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
  border-bottom: none;
}

/* الفوتر */
.site-footer {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-secondary);
  color: white;
}

/* الشبكة المتجاوبة */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-sidebar {
  grid-template-columns: 1fr 300px;
}

/* التجاوب */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main-navigation {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .grid-sidebar {
    grid-template-columns: 1fr;
  }
  
  .search-input {
    width: 100%;
  }
}

/* الرسوم المتحركة */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* التحسينات الإضافية */
.highlight {
  background: linear-gradient(120deg, var(--primary-color) 0%, var(--primary-color) 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.2em;
  background-position: 0 88%;
}

.text-gradient {
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}