* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #eef0f3;
  color: #2d3748;
}

/* ===== Header (يحاكي شريط ZergNet: شعار ثنائي اللون + روابط تصنيفات رمادية) ===== */
.site-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e5ea;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: #1a202c;
  text-decoration: none;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.logo span { color: #4f8fd1; }

.site-nav {
  display: flex;
  gap: 22px;
  overflow-x: auto;
}
.site-nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.site-nav a:hover { color: #4f8fd1; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 20px 40px; }

/* ===== بطاقة مميّزة أعلى الصفحة (أول مقال) — صورة كاملة + تراكب داكن + عنوان أبيض ===== */
.hero-card {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  margin-bottom: 24px;
  background: #1a202c;
  min-height: 320px;
}
.hero-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.hero-card .hero-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #2d3748, #1a202c);
}
.hero-overlay {
  position: relative;
  z-index: 1;
  padding: 36px 28px;
  max-width: 560px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #4f8fd1;
  color: #fff;
  font-weight: 800;
  margin-bottom: 14px;
}
.hero-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 20px;
  display: inline;
  background: rgba(26, 32, 44, 0.78);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 2px 8px;
}
.hero-btn {
  display: inline-block;
  background: #4f8fd1;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 26px;
  border-radius: 4px;
}

/* ===== شبكة البطاقات (مطابقة لأسلوب ZergNet: صورة أعلى، عنوان غامق تحتها، ثم مقتطف رمادي) ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e2e5ea, #cbd2db);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  color: #9aa3b0;
}

.card-body { padding: 14px 16px 18px; }
.card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #4f8fd1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px;
  color: #2d3748;
}
.card-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== صفحة المقال ===== */
.article-header { max-width: 760px; margin: 28px auto 24px; }
.article-category {
  display: inline-block;
  background: #4f8fd1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.article-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #1a202c;
}
.article-byline {
  font-size: 13px;
  color: #718096;
  margin: 0;
}
.article-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}
.article-body {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  padding: 8px 28px 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.75;
  color: #374151;
}
.article-body h2 { font-size: 24px; margin-top: 32px; color: #1a202c; }
.article-body h3 { font-size: 20px; margin-top: 24px; color: #1a202c; }
.article-body p { margin: 16px 0; }

.article-hashtags {
  max-width: 760px;
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-hashtags span {
  background: #eef2f7;
  border: 1px solid #dde3ea;
  color: #4f8fd1;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
}

.site-footer {
  text-align: center;
  padding: 30px;
  color: #9aa3b0;
  font-size: 13px;
  border-top: 1px solid #e2e5ea;
  margin-top: 40px;
}

@media (max-width: 640px) {
  .hero-title { font-size: 22px; }
  .article-title { font-size: 24px; }
  .article-body { font-size: 16px; padding: 4px 18px 18px; }
}

/* ===== Quizzes ===== */
.quiz-wrap {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.quiz-intro p { font-size: 17px; line-height: 1.6; color: #374151; margin: 0 0 22px; }
.quiz-progress { margin-bottom: 20px; }
.quiz-progress-bar { background: #eef2f7; border-radius: 999px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.quiz-progress-fill { background: #4f8fd1; height: 100%; width: 0%; transition: width 0.25s ease; }
.quiz-progress span { font-size: 13px; color: #9aa3b0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.quiz-question h2 { font-size: 22px; color: #1a202c; margin: 0 0 20px; line-height: 1.35; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left;
  background: #f7f9fb;
  border: 1.5px solid #e2e5ea;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px;
  color: #2d3748;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: #4f8fd1; background: #eef5fc; }
.quiz-result { text-align: center; }
.quiz-result img { width: 160px; height: 120px; border-radius: 8px; margin-bottom: 18px; object-fit: cover; }
.quiz-result h2 { font-size: 26px; color: #1a202c; margin: 0 0 12px; }
.quiz-result p { font-size: 16px; line-height: 1.6; color: #4b5563; margin: 0 0 24px; }

@media (max-width: 640px) {
  .quiz-wrap { padding: 24px 18px; }
}
