/* ─── إعادة تعيين ────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --max-w: 800px;
  --radius: 12px;
}

body {
  font-family: 'Noto Kufi Arabic', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); text-decoration: none; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; }
.nav-link:hover { color: var(--accent); }

/* ─── Main ───────────────────────────────────────────── */
main { flex: 1; padding: 2.5rem 0; }

/* ─── بطاقات المقالات ────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s, transform 0.3s;
}
.post-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); transform: translateY(-2px); }
.post-card .meta { display: flex; gap: 1rem; margin-bottom: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }
.post-card .category-tag {
  background: #eff6ff; color: var(--accent); padding: 0.2rem 0.7rem;
  border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-decoration: none;
}
.post-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.5; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-card .excerpt { color: var(--text-muted); margin-bottom: 1rem; }
.read-more { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* ─── مقال منفرد ─────────────────────────────────────── */
.single-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; }
.single-post .back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--accent); text-decoration: none; }
.single-post h1 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.5; }
.single-post .post-meta { color: var(--text-muted); margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.single-post .post-content { line-height: 2; }
.single-post .post-content p { margin-bottom: 1.25rem; }
.single-post .post-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; }
.single-post .post-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.single-post .post-content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.single-post .post-content a { color: var(--accent); }
.single-post .post-content blockquote { border-right: 4px solid var(--accent); padding: 1rem 1.5rem; margin: 1.5rem 0; background: #f8fafc; border-radius: 0 8px 8px 0; }
.single-post .post-content ul, .single-post .post-content ol { padding-right: 1.5rem; margin-bottom: 1.25rem; }
.single-post .post-content li { margin-bottom: 0.5rem; }
.single-post .post-content code { background: #f1f5f9; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.9em; }
.single-post .post-content pre { background: #1e293b; color: #e2e8f0; padding: 1.5rem; border-radius: 8px; overflow-x: auto; margin: 1.5rem 0; }
.single-post .post-content pre code { background: none; padding: 0; color: inherit; }

/* ─── الترقيم ────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.pagination button {
  padding: 0.5rem 1rem; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────── */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ─── حالات ──────────────────────────────────────────── */
.hidden { display: none !important; }
.loading { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .post-card { padding: 1.25rem; }
  .single-post { padding: 1.5rem; }
  .single-post h1 { font-size: 1.5rem; }
  .post-card h2 { font-size: 1.25rem; }
}
