:root {
  --dark: #233242;
  --dark-2: #1a2733;
  --blue: #1e88d2;
  --blue-d: #156fae;
  --green: #2e9e5b;
  --green-d: #237d47;
  --olive: #6d7c45;
  --olive-d: #566234;
  --purple: #7b5ea7;
  --purple-d: #634a8a;
  --bg: #eef1f4;
  --card: #ffffff;
  --text: #2b3440;
  --muted: #7a8694;
  --border: #e3e8ed;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ===== الشريط العلوي ===== */
.topbar { background: var(--dark-2); color: #aebdcc; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }

/* ===== الترويسة ===== */
.site-header { background: var(--dark); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding-top: 8px; padding-bottom: 8px; gap: 8px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; color: #fff; }
.brand-icon { width: 34px; height: 34px; display: block; }
.brand-text b { color: #4fc3f7; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { color: #cfd9e3; padding: 8px 14px; border-radius: 6px; font-weight: 500; transition: .2s; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav a.active { color: #fff; background: var(--blue); }

/* ===== قسم البطل ===== */
.hero { background: linear-gradient(135deg, var(--dark) 0%, #2c4a63 100%); color: #fff; text-align: center; padding: 40px 0 32px; }
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.hero p { color: #b9c8d6; font-size: 16px; }
.stats-bar { display: flex; justify-content: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 10px 22px; min-width: 130px; }
.stat b { display: block; font-size: 24px; color: #4fc3f7; }
.stat span { font-size: 13px; color: #c4d2de; }

/* ===== أقسام الوظائف ===== */
.jobs-section { margin: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; color: #fff; border-radius: 10px 10px 0 0; padding: 12px 18px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.head-blue { background: linear-gradient(90deg, var(--blue), var(--blue-d)); }
.head-green { background: linear-gradient(90deg, var(--green), var(--green-d)); }
.head-olive { background: linear-gradient(90deg, var(--olive), var(--olive-d)); }
.head-purple { background: linear-gradient(90deg, var(--purple), var(--purple-d)); }
.last-update { font-size: 13px; opacity: .9; }

.jobs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #f7f9fa; border: 1px solid var(--border); border-top: 0; padding: 14px; }
@media (max-width: 760px) { .jobs-grid { grid-template-columns: 1fr; } }

/* ===== بطاقة الوظيفة ===== */
.job-card { position: relative; display: flex; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; transition: .18s; }
.job-card:hover { box-shadow: 0 4px 14px rgba(30,136,210,.16); border-color: #bcd9ee; transform: translateY(-1px); }
.job-card-link { position: absolute; inset: 0; z-index: 1; }
.job-logo { flex-shrink: 0; width: 56px; height: 56px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; }
.job-logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue), #5fb3e8); }
.job-info { min-width: 0; flex: 1; }
.job-title { font-size: 15px; font-weight: 700; color: #16456b; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-card:hover .job-title { color: var(--blue); }
.job-company { font-size: 13px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.badge-new { background: #e8f7ee; color: var(--green-d); border: 1px solid #bfe6cf; padding: 1px 9px; border-radius: 20px; font-weight: 700; font-size: 11px; }
.badge-gov { background: #fff4e0; color: #a96b00; border: 1px solid #f1ddb4; padding: 1px 9px; border-radius: 20px; font-weight: 700; font-size: 11px; z-index: 2; position: relative; }
.badge-mil { background: #eef2e0; color: #566234; border: 1px solid #d4ddb8; padding: 1px 9px; border-radius: 20px; font-weight: 700; font-size: 11px; z-index: 2; position: relative; }

/* ===== زر المزيد ===== */
.more-btn { display: block; text-align: center; color: #fff; font-weight: 700; padding: 12px; border-radius: 0 0 10px 10px; transition: .2s; }
.btn-blue { background: var(--blue); } .btn-blue:hover { background: var(--blue-d); }
.btn-green { background: var(--green); } .btn-green:hover { background: var(--green-d); }
.btn-olive { background: var(--olive); } .btn-olive:hover { background: var(--olive-d); }
.btn-purple { background: var(--purple); } .btn-purple:hover { background: var(--purple-d); }

/* ===== صفحة القوائم ===== */
.page-main { padding: 26px 16px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.count-pill { background: var(--blue); color: #fff; border-radius: 20px; padding: 2px 14px; font-size: 14px; font-weight: 700; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs a { background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 7px 20px; font-weight: 500; color: var(--muted); transition: .2s; }
.filter-tabs a:hover { border-color: var(--blue); color: var(--blue); }
.filter-tabs a.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.page-main .jobs-grid { border: 0; background: transparent; padding: 0; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.pagination a { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 22px; font-weight: 700; color: var(--blue); }
.pagination a:hover { background: var(--blue); color: #fff; }
.page-info { color: var(--muted); font-size: 14px; }

/* ===== صفحة الوظيفة ===== */
.job-detail { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 26px; }
.job-detail-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.job-logo-lg { width: 84px; height: 84px; border-radius: 12px; }
.job-logo-lg .logo-fallback { font-size: 36px; }
.job-detail-title { font-size: 24px; font-weight: 800; color: #16456b; margin-bottom: 6px; }
.job-detail-company { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.apply-btn { display: inline-block; background: var(--green); color: #fff; font-size: 17px; font-weight: 800; padding: 13px 34px; border-radius: 9px; transition: .2s; margin: 6px 0 18px; }
.apply-btn:hover { background: var(--green-d); box-shadow: 0 4px 12px rgba(46,158,91,.3); }
.job-desc h2 { font-size: 18px; border-right: 4px solid var(--blue); padding-right: 10px; margin: 16px 0 10px; }
.job-desc-body { color: #3d4854; font-size: 15px; }
.job-desc-body ul, .job-desc-body ol { margin: 8px 24px 8px 0; }
.job-desc-body p { margin-bottom: 8px; }
.job-desc-body h3 { font-size: 16px; font-weight: 800; color: var(--blue-d); margin: 14px 0 6px; }
.job-title-original { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.job-desc-original { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 10px; }
.job-desc-original summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.desc-note { color: var(--muted); background: #f5f8fa; border: 1px dashed var(--border); border-radius: 8px; padding: 14px; }
.job-src-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ===== حالات فارغة ===== */
.empty-state { background: #fff; border: 1px dashed #c9d4dd; border-radius: 10px; padding: 36px; text-align: center; color: var(--muted); font-size: 16px; }
.notfound h1 { font-size: 64px; color: var(--blue); }
.notfound .more-btn { display: inline-block; border-radius: 8px; margin-top: 14px; padding: 10px 30px; }

/* ===== التذييل ===== */
.site-footer { background: var(--dark-2); color: #aebdcc; margin-top: 40px; }
.footer-inner { padding: 34px 16px 22px; text-align: center; }
.footer-brand { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.footer-inner p { max-width: 640px; margin: 0 auto 14px; font-size: 14px; }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: #cfd9e3; font-size: 14px; }
.footer-links a:hover { color: #4fc3f7; }
.footer-copy { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; font-size: 13px; }

/* ===== عناصر السيو والتنقل المضافة ===== */
.job-title a { position: relative; z-index: 2; }
.page-intro { color: var(--muted); font-size: 14.5px; line-height: 1.9; margin-bottom: 16px; max-width: 850px; }
.list-subhead { font-size: 17px; font-weight: 700; color: #16456b; margin: 4px 0 12px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--blue); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .crumb-current { color: var(--muted); max-width: 480px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expired-note { background: #fdf0ef; border: 1px solid #f3c1bd; color: #a33a31; border-radius: 10px; padding: 14px 18px; font-weight: 700; margin: 14px 0; }
.expired-note a { color: var(--blue); text-decoration: underline; }
.pagination { flex-wrap: wrap; }
.pagination a { padding: 8px 14px; min-width: 42px; text-align: center; }
.pagination .page-current { background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 8px; padding: 8px 14px; min-width: 42px; text-align: center; font-weight: 700; }
.pagination .page-gap { color: var(--muted); padding: 0 2px; }
.city-links { display: flex; flex-wrap: wrap; gap: 9px; padding: 16px; background: #f7f9fa; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px; }
.city-links a { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #bcd9ee; border-radius: 24px; padding: 7px 16px; font-size: 14px; font-weight: 700; color: var(--blue-d); box-shadow: 0 1px 3px rgba(35,50,66,.06); transition: .18s; }
.city-links a:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(30,136,210,.25); }
.city-links .city-count { background: #e8f1fb; color: var(--blue-d); border-radius: 12px; font-size: 11px; font-weight: 700; padding: 1px 8px; line-height: 1.7; }
.city-links a:hover .city-count { background: rgba(255,255,255,.92); color: var(--blue-d); }
a.badge-gov:hover, a.badge-mil:hover, a.badge-cat:hover { text-decoration: underline; }

/* ===== روابط الفئات (التخصصات) في صفحات القوائم ===== */
.category-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.category-links a { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #bcd9ee; border-radius: 24px; padding: 6px 15px; font-size: 13.5px; font-weight: 700; color: var(--blue-d); box-shadow: 0 1px 3px rgba(35,50,66,.06); transition: .18s; }
.category-links a:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(30,136,210,.25); }
.category-links a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.category-links .cat-count { background: #e8f1fb; color: var(--blue-d); border-radius: 12px; font-size: 11px; font-weight: 700; padding: 1px 8px; line-height: 1.7; }
.category-links a:hover .cat-count, .category-links a.active .cat-count { background: rgba(255,255,255,.92); color: var(--blue-d); }

/* شارة الفئة في صفحة الوظيفة */
.badge-cat { background: #e8f1fb; color: #16456b; border: 1px solid #c6dcf2; padding: 1px 9px; border-radius: 20px; font-weight: 700; font-size: 11px; z-index: 2; position: relative; }

/* حواجز عامة ضد فيضان النصوص الطويلة (عناوين إنجليزية بلا فواصل) */
.job-detail-head > div { min-width: 0; }
.job-title, .job-detail-title { overflow-wrap: break-word; }

/* ===== الجوال ===== */
@media (max-width: 860px) {
  /* الشريط العلوي: سطر مرن متمركز بدل التمدد بين الطرفين */
  .topbar-inner { justify-content: center; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; }

  /* الترويسة: غير مثبتة على الجوال (المثبتة تأكل الشاشة)، الشعار فوق وروابط التنقل أزرار متمركزة */
  .site-header { position: static; }
  .header-inner { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 10px; padding-bottom: 12px; gap: 10px; }
  .brand { justify-content: center; font-size: 21px; }
  .brand-icon { width: 28px; height: 28px; }
  .main-nav { justify-content: center; gap: 6px; }
  .main-nav a { padding: 6px 12px; font-size: 14px; background: rgba(255,255,255,.07); }

  /* قسم البطل والإحصاءات */
  .hero { padding: 26px 0 22px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .stats-bar { gap: 8px; margin-top: 16px; }
  .stat { flex: 1 1 104px; max-width: 46%; min-width: 104px; padding: 8px 12px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 12px; }

  /* رؤوس الأقسام وصفحات القوائم */
  .section-head { flex-wrap: wrap; gap: 2px 10px; padding: 10px 14px; }
  .section-head h2 { font-size: 17px; }
  .page-main { padding-top: 18px; padding-bottom: 32px; }
  .page-head { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
  .page-head h1 { font-size: 20px; }
  .count-pill { font-size: 12px; padding: 2px 10px; }
  .filter-tabs a { padding: 6px 14px; font-size: 14px; }
  .breadcrumb .crumb-current { max-width: 100%; }

  /* صفحة الوظيفة */
  .job-detail { padding: 16px; }
  .job-detail-head { gap: 12px; margin-bottom: 14px; }
  .job-logo-lg { width: 60px; height: 60px; border-radius: 10px; }
  .job-logo-lg .logo-fallback { font-size: 26px; }
  .job-detail-title { font-size: 19px; }
  .job-detail-company { font-size: 14px; }
  .apply-btn { display: block; text-align: center; }
}
