/* =====================================================
   وديفة - القالب الافتراضي (ewdifh)
   مطابق لتصميم موقع إعلانات الوظائف الأصلي
   الألوان قابلة للoverride من لوحة التحكم عبر :root
   ===================================================== */

:root {
    --c-header: #2386C8;
    --c-primary: #b91c1c;
    --c-accent: #1d4ed8;
    --c-footer: #343A40;
    --c-body: #e5e7eb;
    --c-text: #1f2937;
    --c-muted: #6b7280;
    --c-border: #e5e7eb;
    --c-card: #ffffff;
    --nav-grad: linear-gradient(135deg, #2b2b2b 0%, #424242 50%, #111111 100%);
    --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: var(--c-body);
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container {
    max-width: 1024px; /* max-w-5xl */
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================= الهيدر ============================= */
.site-header {
    background: var(--c-header);
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    transition: min-height .2s;
}
.site-header a.logo { display: inline-block; }
.site-header img.site-logo {
    max-height: 100px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}
.site-header .logo-text {
    color: #fff;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.site-header .tagline {
    display: block;
    color: rgba(255,255,255,.85);
    font-size: .95rem;
    text-align: center;
    margin-top: 4px;
}

/* ============================= القائمة ============================= */
.main-nav {
    background: var(--nav-grad);
    border-bottom: 3px solid #6b7280;
    position: sticky;
    top: 0;
    z-index: 50;
}
.main-nav .nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.main-nav .nav-inner::-webkit-scrollbar { height: 3px; }
.main-nav .nav-inner::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 3px; }
.main-nav .nav-inner::-webkit-scrollbar-thumb { background: var(--c-header); border-radius: 3px; }
.main-nav .nav-inner::-webkit-scrollbar-thumb:hover { filter: brightness(1.15); }
@supports not selector(::-webkit-scrollbar) {
    .main-nav .nav-inner {
        scrollbar-width: thin;
        scrollbar-color: var(--c-header) transparent;
    }
}
.main-nav a.nav-link {
    display: inline-block;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: var(--radius);
    transition: background .15s;
    flex-shrink: 0;
}
.main-nav a.nav-link:hover,
.main-nav a.nav-link.active { background: rgba(255,255,255,.14); }

/* ============================= البحث ============================= */
.search-row { background: #f3f4f6; border-bottom: 1px solid var(--c-border); }
.search-row form {
    display: flex;
    gap: 0;
    max-width: 640px;
    margin: 12px auto;
}
.search-row input[type="text"] {
    flex: 1;
    height: 35px;
    background: #f9f9f9;
    border: 1px solid var(--c-border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0 14px;
    font-family: inherit;
    font-size: .9rem;
    outline: none;
}
.search-row input[type="text"]:focus { border-color: var(--c-header); }
.search-row button {
    height: 35px;
    padding: 0 22px;
    background: #363636;
    color: #fff;
    border: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s;
}
.search-row button:hover { background: #2563eb; }

/* ============================= المحتوى ============================= */
.page-wrap { padding: 20px 0 30px; min-height: 45vh; }

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 8px 0 16px;
    color: var(--c-text);
}
.section-title::before {
    content: '';
    width: 5px;
    height: 22px;
    background: var(--c-primary);
    border-radius: 3px;
    flex-shrink: 0;
}
.section-title .count {
    font-size: .8rem;
    font-weight: 500;
    color: var(--c-muted);
    background: #fff;
    border: 1px solid var(--c-border);
    padding: 2px 10px;
    border-radius: 20px;
}

/* شبكة الوظائف */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .jobs-grid { grid-template-columns: 1fr; }
}

/* بطاقة وظيفة */
.job-card {
    background: var(--c-card);
    border-radius: 6px; /* rounded-md */
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    padding: 14px; /* p-3 */
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s, transform .15s;
}
.job-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.14);
    transform: translateY(-2px);
}
.job-card .card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.job-card .org-logo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 1px dashed #9ca3af;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
}
.job-card .org-logo img { width: 100%; height: 100%; object-fit: cover; }
.job-card .org-logo .initial {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--c-header);
}
.job-card h3.job-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 3-line clamp */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.6em;
}
.job-card h3.job-title a:hover { color: var(--c-header); }
.job-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: .78rem;
    color: var(--c-muted);
}
.job-card .card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-card .badge-featured {
    position: absolute;
    margin: 0;
}
.job-card .card-cta {
    display: block;
    margin-top: 12px;
    text-align: center;
    background: var(--c-primary); /* red-700 */
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    padding: 9px 10px;
    border-radius: 6px;
    transition: background .15s;
}
.job-card .card-cta:hover { background: #991b1b; }
.job-card { position: relative; }
.job-card .featured-star {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--c-accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

/* ============================= صفحة الوظيفة ============================= */
.breadcrumb {
    font-size: .8rem;
    color: var(--c-muted);
    margin-bottom: 12px;
}
.breadcrumb a:hover { color: var(--c-header); }
.breadcrumb .sep { margin: 0 6px; color: #cbd5e1; }

.job-single {
    background: var(--c-card);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    padding: 28px 24px;
}
.job-single .org-logo-big {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px dashed #9ca3af;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}
.job-single .org-logo-big img { width: 100%; height: 100%; object-fit: cover; }
.job-single .org-logo-big .initial { font-size: 4rem; font-weight: 800; color: var(--c-header); }
.job-single h1 {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.6;
}
.job-single .job-sub {
    text-align: center;
    color: var(--c-muted);
    font-size: .9rem;
    margin-bottom: 18px;
}

.meta-bar {
    background: #5f6870;
    color: #fff;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 26px;
    padding: 11px 16px;
    font-size: .82rem;
    margin-bottom: 22px;
}
.meta-bar span { display: inline-flex; align-items: center; gap: 6px; opacity: .95; }

.job-content { line-height: 2; font-size: .95rem; word-wrap: break-word; }
.job-content h1, .job-content h2, .job-content h3 { font-weight: 800; margin: 20px 0 10px; }
.job-content h2 { font-size: 1.15rem; }
.job-content h3 { font-size: 1.02rem; }
.job-content p { margin: 10px 0; }
.job-content ul, .job-content ol { padding-right: 22px; padding-left: 0; margin: 10px 0; }
.job-content li { margin: 4px 0; }
.job-content img { border-radius: 6px; height: auto; }
.job-content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.job-content td, .job-content th { border: 1px solid var(--c-border); padding: 8px 10px; font-size: .88rem; }
.job-content a { color: var(--c-accent); text-decoration: underline; }
.job-content blockquote {
    border-right: 4px solid var(--c-header);
    background: #f8fafc;
    margin: 12px 0;
    padding: 10px 16px;
    border-radius: 4px;
    color: #374151;
}

.safety-note {
    background: #fef3c7; /* amber-100 */
    border: 1px solid #fcd34d;
    color: #92400e;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: .85rem;
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.safety-note i { margin-top: 4px; }

.job-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 22px 0 8px;
}
.btn-source {
    display: block;
    text-align: center;
    background: var(--c-primary); /* red-700 */
    color: #fff;
    font-weight: 700;
    padding: 11px;
    border-radius: 6px;
    font-size: .92rem;
    transition: background .15s;
}
.btn-source:hover { background: #991b1b; }
.btn-apply {
    display: block;
    text-align: center;
    background: var(--c-accent); /* blue-700 */
    color: #fff;
    font-weight: 700;
    padding: 11px;
    border-radius: 6px;
    font-size: .92rem;
    transition: background .15s;
}
.btn-apply:hover { background: #1e40af; }

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    font-size: .85rem;
    color: var(--c-muted);
}
.share-row a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .9rem;
    transition: opacity .15s;
}
.share-row a:hover { opacity: .85; }
.share-row .sh-wa { background: #25d366; }
.share-row .sh-tw { background: #1da1f2; }
.share-row .sh-fb { background: #1877f2; }
.share-row .sh-tg { background: #229ed9; }
.share-row .sh-cp { background: #6b7280; cursor: pointer; border: none; }

/* ============================= الإعلانات ============================= */
.ad-slot { margin: 16px 0; text-align: center; }
.ad-slot img { max-width: 100%; height: auto; border-radius: 6px; }

/* ============================= الفوتر ============================= */
.site-footer {
    background: var(--c-footer);
    color: #fff;
    border-top: 3px solid #6b7280;
    margin-top: 30px;
    padding: 34px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.site-footer h4 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.site-footer h4::after {
    content: '';
    display: block;
    width: 34px;
    height: 3px;
    background: var(--c-header);
    margin-top: 6px;
    border-radius: 2px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin: 7px 0; }
.site-footer a { color: rgba(255,255,255,.8); font-size: .85rem; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-about p { color: rgba(255,255,255,.8); font-size: .85rem; margin: 0; }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    transition: background .15s;
}
.footer-social a:hover { background: var(--c-header); }
.footer-disclaimer {
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 26px;
    padding: 14px 0;
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    text-align: center;
    line-height: 1.8;
}
.footer-copy {
    background: rgba(0,0,0,.25);
    padding: 12px 0;
    text-align: center;
    font-size: .8rem;
    color: rgba(255,255,255,.75);
}
.footer-copy a { color: #fff; font-weight: 700; }

/* ============================= الترقيم ============================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 26px 0 6px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
}
.pagination a:hover { border-color: var(--c-header); color: var(--c-header); }
.pagination span.current { background: var(--c-header); border-color: var(--c-header); color: #fff; }
.pagination span.disabled { color: #cbd5e1; background: #f9fafb; }

/* ============================= صفحات عامة ============================= */
.static-page {
    background: var(--c-card);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    padding: 28px 24px;
}
.static-page h1 { font-size: 1.3rem; font-weight: 800; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--c-body); }

.empty-state {
    background: #fff;
    border-radius: 6px;
    text-align: center;
    padding: 48px 20px;
    color: var(--c-muted);
}
.empty-state i { font-size: 2.4rem; color: #d1d5db; margin-bottom: 10px; display: block; }

.error-page {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    text-align: center;
    padding: 60px 24px;
}
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--c-header); line-height: 1; margin-bottom: 8px; }
.error-page p { color: var(--c-muted); margin: 0 0 20px; }
.btn-home {
    display: inline-block;
    background: var(--c-header);
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: .9rem;
}
.btn-home:hover { filter: brightness(.94); }

.category-head {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 18px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.category-head h1 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.category-head p { margin: 4px 0 0; color: var(--c-muted); font-size: .85rem; }

/* تحسينات الجوال */
@media (max-width: 768px) {
    .site-header { min-height: 85px; }
    .site-header img.site-logo { max-height: 64px; max-width: 170px; }
    .site-header .logo-text { font-size: 1.7rem; }
    .job-single { padding: 20px 16px; }
    .job-single .org-logo-big { width: 140px; height: 140px; }
    .job-actions { grid-template-columns: 1fr; }
    .meta-bar { gap: 6px 16px; font-size: .76rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
