/*
Theme Name: دليلك للوظائف
Theme URI: https://dalilk4jobs.com
Description: قالب فرعي لموقع وظائف عربي (RTL) — واجهة بحث بارزة، بطاقات وظائف، تصفح سريع بالأقسام والجهات.
Author: دليلك للوظائف
Template: twentytwentyfive
Version: 1.7.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: dalilk-jobs
*/

/* ===================================================================
   1) أساسيات RTL والخطوط
   =================================================================== */

:root {
	--dl-blue: #0073e6;
	--dl-blue-dark: #0a4fa3;
	--dl-blue-soft: #eaf3ff;
	--dl-green: #16a34a;
	--dl-red: #dc2626;
	--dl-ink: #14202e;
	--dl-muted: #5b6b7c;
	--dl-line: #e3e9f0;
	--dl-bg: #f4f4f4;
	--dl-radius: 12px;
	--dl-shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 16px rgba(16, 32, 48, .05);
	--dl-shadow-lg: 0 8px 30px rgba(16, 32, 48, .12);
}

body {
	background: var(--dl-bg);
	color: var(--dl-ink);
	font-family: "Cairo", "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* ووردبريس يحمّل rtl.css تلقائياً، لكن نضمن الاتجاه في الحاويات المخصصة */
.dl-card,
.dl-hero,
.dl-section,
.dl-job-body {
	direction: rtl;
	text-align: right;
}

/* ===================================================================
   2) الهيدر — شعار + قائمة + بحث بارز
   =================================================================== */

.dl-header {
	background: #fff;
	border-bottom: 1px solid var(--dl-line);
	position: sticky;
	top: 0;
	z-index: 50;
	padding-block: 0;   /* الحشو على الصف الداخلي وحده — وإلا تضاعف وتضخّم الهيدر */
}

.dl-header .wp-block-site-title a {
	color: var(--dl-blue-dark);
	font-weight: 800;
	font-size: 1.4rem;
	text-decoration: none;
}

/* --- الشعار --- */

.dl-header .wp-block-site-logo {
	margin: 0;
	line-height: 0;
}

.dl-header .wp-block-site-logo img {
	max-height: 70px;
	max-width: 220px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* كتلة الشعار لا تُطبع أصلاً إن لم يُرفع شعار،
   فوجود هذا العنصر يعني وجود شعار — عندها نخفي الاسم النصي
   حتى لا يتكرر (الشعار نفسه يحمل الاسم). */
.dl-header .wp-block-site-logo + .wp-block-site-title {
	display: none;
}

/* ===================================================================
   2.1) تحصين الهيدر
   يعمل حتى لو كانت النسخة المعروضة محفوظة في قاعدة البيانات من محرّر
   الموقع (عندها لا يوجد .dl-header إطلاقاً وتُستخدم أصناف القالب الأصل).
   =================================================================== */

header.wp-block-template-part {
	background: #ffffff;
	border-bottom: 1px solid #e5e7eb;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
	position: sticky;
	top: 0;
	z-index: 50;
}

/* القالب الأصل يضع حشواً ضخماً بأسلوب مضمّن — لا يُلغى إلا بـ important */
header.wp-block-template-part .wp-block-group.is-layout-flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 50px;
	/* 70px شعار + 7px×2 حشو = 84px ارتفاع الهيدر */
	padding-top: 7px !important;
	padding-bottom: 7px !important;
}

header.wp-block-template-part .wp-block-site-logo {
	margin: 0;
	line-height: 0;
}

header.wp-block-template-part .wp-block-site-logo img {
	max-height: 70px;
	max-width: 220px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* الاسم النصي يُخفى فقط حين يوجد شعار فعلاً (الشقيق المجاور) */
header.wp-block-template-part .wp-block-site-logo + .wp-block-site-title {
	display: none !important;
}

/* القائمة: أفقية بحجم مناسب — القالب الأصل يجعلها عمودية */
header.wp-block-template-part .wp-block-navigation {
	font-size: .95rem;
}

header.wp-block-template-part .wp-block-navigation.is-vertical,
header.wp-block-template-part .wp-block-navigation__container.is-vertical {
	flex-direction: row !important;
	align-items: center;
	gap: 4px;
}

header.wp-block-template-part .wp-block-navigation a {
	color: var(--dl-ink);
	font-weight: 600;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 8px;
	transition: background .15s, color .15s;
}

header.wp-block-template-part .wp-block-navigation a:hover {
	background: var(--dl-blue-soft);
	color: var(--dl-blue-dark);
}

@media (max-width: 768px) {
	header.wp-block-template-part .wp-block-group.is-layout-flex {
		gap: 10px;
		min-height: 44px;
		/* 52px شعار + 6px×2 = 64px */
		padding-top: 6px !important;
		padding-bottom: 6px !important;
	}

	header.wp-block-template-part .wp-block-site-logo img,
	.dl-header .wp-block-site-logo img {
		max-height: 52px;
		max-width: 170px;
	}
}

.dl-nav a {
	color: var(--dl-ink);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	padding: .45rem .7rem;
	border-radius: 8px;
	transition: background .15s, color .15s;
}

.dl-nav a:hover,
.dl-nav .current-menu-item > a {
	background: var(--dl-blue-soft);
	color: var(--dl-blue-dark);
}

/* --- محرك البحث البارز --- */

.dl-hero {
	background: linear-gradient(135deg, var(--dl-blue-dark) 0%, var(--dl-blue) 100%);
	padding: 3.5rem 1.25rem;
	text-align: center;
	color: #fff;
}

.dl-hero h1,
.dl-hero h2 {
	color: #fff;
	font-weight: 800;
	margin: 0 0 .5rem;
	line-height: 1.4;
}

.dl-hero p {
	color: rgba(255, 255, 255, .88);
	margin: 0 0 1.75rem;
	font-size: 1.05rem;
}

.dl-search,
.dl-hero .wp-block-search {
	max-width: 680px;
	margin-inline: auto;
}

.dl-hero .wp-block-search__inside-wrapper {
	background: #fff;
	border: 0;
	border-radius: 999px;
	padding: .35rem;
	box-shadow: var(--dl-shadow-lg);
}

.wp-block-search__input {
	border: 0 !important;
	background: transparent;
	padding: .8rem 1.25rem;
	font-size: 1rem;
	color: var(--dl-ink);
	outline: none;
}

.wp-block-search__input::placeholder {
	color: #9aa8b6;
}

.wp-block-search__button {
	background: var(--dl-blue);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: .75rem 1.75rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
}

.wp-block-search__button:hover {
	background: var(--dl-blue-dark);
}

/* بحث مصغّر داخل الهيدر */
.dl-header .wp-block-search__inside-wrapper {
	border: 1px solid var(--dl-line);
	border-radius: 999px;
	background: var(--dl-bg);
	padding: .15rem;
}

.dl-header .wp-block-search__input {
	padding: .5rem .9rem;
	font-size: .9rem;
}

.dl-header .wp-block-search__button {
	padding: .5rem 1.1rem;
	font-size: .85rem;
}

/* روابط بحث سريعة تحت الشريط */
.dl-quick-links {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	justify-content: center;
	margin-top: 1.25rem;
}

.dl-quick-links a {
	background: rgba(255, 255, 255, .15);
	border: 1px solid rgba(255, 255, 255, .3);
	color: #fff;
	padding: .35rem .9rem;
	border-radius: 999px;
	font-size: .85rem;
	text-decoration: none;
	transition: background .15s;
}

.dl-quick-links a:hover {
	background: rgba(255, 255, 255, .3);
}

/* ===================================================================
   3) شبكة الأقسام
   =================================================================== */

.dl-section {
	padding-block: 2.5rem;
}

.dl-section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
	border-inline-start: 4px solid var(--dl-blue);
	padding-inline-start: .75rem;
}

.dl-section-title h2 {
	font-size: 1.35rem;
	font-weight: 800;
	margin: 0;
	color: var(--dl-ink);
}

.dl-section-title a {
	color: var(--dl-blue);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* صف واحد دائماً مهما كان عدد الأقسام — flex بلا لفّ، لا شبكة تلفّ العنصر السابع */
.dl-cats {
	display: flex;
	flex-wrap: nowrap;
	gap: .6rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding-bottom: .25rem;
}

.dl-cats::-webkit-scrollbar { height: 6px; }
.dl-cats::-webkit-scrollbar-thumb { background: #c9dcf5; border-radius: 99px; }
.dl-cats::-webkit-scrollbar-track { background: transparent; }

.dl-cat {
	flex: 1 1 0;
	min-width: 0;               /* بدونه يرفض عنصر flex الانكماش */
	background: #fff;
	border: 1px solid var(--dl-line);
	border-radius: var(--dl-radius);
	padding: 1rem .45rem;
	text-align: center;
	text-decoration: none;
	color: var(--dl-ink);
	font-weight: 700;
	font-size: .85rem;
	line-height: 1.5;
	transition: transform .15s, box-shadow .15s, border-color .15s;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.dl-cat:hover {
	transform: translateY(-3px);
	box-shadow: var(--dl-shadow);
	border-color: var(--dl-blue);
	color: var(--dl-blue-dark);
}

.dl-cat .dl-cat-icon {
	font-size: 1.5rem;
	display: block;
	margin-bottom: .35rem;
	line-height: 1;
}

.dl-cat .dl-cat-count {
	display: block;
	font-size: .72rem;
	font-weight: 500;
	color: var(--dl-muted);
	margin-top: .25rem;
}

/* لوحي فقط: عرض ثابت يمنع سحق النص، مع تمرير أفقي */
@media (min-width: 769px) and (max-width: 1024px) {
	.dl-cat { flex: 0 0 140px; }
}

/* الجوال: شبكة واضحة بلا تمرير — كل الأقسام ظاهرة دفعة واحدة */
@media (max-width: 768px) {
	.dl-cats {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
		overflow: visible;
		scroll-snap-type: none;
		padding-bottom: 0;
	}

	.dl-cat {
		flex: none;          /* flex لا أثر له داخل شبكة، لكن نصفّره صراحةً */
		width: auto;
		min-width: 0;
		padding: 10px 6px;
		font-size: .78rem;
		line-height: 1.45;
		text-align: center;
		word-break: break-word;
	}

	.dl-cat .dl-cat-icon {
		font-size: 1.25rem;
		margin-bottom: .25rem;
	}

	.dl-cat .dl-cat-count {
		font-size: .65rem;
		margin-top: .15rem;
	}

	/* القسم الوحيد في آخر صف يمتد على العرض بدل أن يبدو يتيماً */
	.dl-cats > .dl-cat:last-child:nth-child(3n + 1) {
		grid-column: span 3;
	}
}

/* شاشات ضيقة جداً: عمودان */
@media (max-width: 380px) {
	.dl-cats {
		grid-template-columns: repeat(2, 1fr);
	}

	.dl-cats > .dl-cat:last-child:nth-child(3n + 1) {
		grid-column: auto;
	}

	.dl-cats > .dl-cat:last-child:nth-child(odd) {
		grid-column: span 2;
	}
}

/* ===================================================================
   4) بطاقات الوظائف
   =================================================================== */

/* --- الشبكة: عمودان على الديسكتوب واللوحي، عمود على الجوال --- */
.dl-jobs .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dl-jobs .wp-block-post-template > li {
	margin: 0;
	list-style: none;
}

@media (max-width: 600px) {
	.dl-jobs .wp-block-post-template {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

/* --- الكرت: شعار يميناً، نص وسطاً، وقت يساراً --- */
.dl-card {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	background: #fff;
	border: 0;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
	padding: 16px 20px;
	height: 100%;
	transition: box-shadow .18s ease, transform .18s ease;
}

.dl-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

/* الشعار — مربع ثابت 85px بلا تمطيط ولا خلفية تضغطه */
.dl-card .wp-block-post-featured-image {
	flex: 0 0 85px;
	width: 85px;
	height: 85px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	overflow: hidden;
}

/* الرابط الملتفّ حول الصورة يجب أن يملأ الحاوي، وإلا انكمشت الصورة داخله */
.dl-card .wp-block-post-featured-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.dl-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	display: block;
	padding: 0;
	border-radius: 8px;
}

/* الوسط — يأخذ ما تبقّى، و min-width ضروري كي ينكمش النص الطويل */
.dl-card-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.dl-card .wp-block-post-terms {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
}

.dl-card .wp-block-post-terms a {
	color: #2d7d46;
	background: none;
	padding: 0;
	border-radius: 0;
	text-decoration: none;
	display: inline;
}

.dl-card .wp-block-post-terms a:hover {
	color: #1f5c33;
	background: none;
	text-decoration: underline;
}

.dl-card .wp-block-post-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
}

.dl-card .wp-block-post-title a {
	color: #1a1a1a;
	text-decoration: none;
}

.dl-card .wp-block-post-title a:hover {
	color: var(--dl-blue);
}

/* الوقت — أقصى اليسار، أعلى الكرت */
.dl-card .dl-ago {
	flex: 0 0 auto;
	align-self: flex-start;
	margin: 0;
	color: #888888;
	font-size: 12px;
	line-height: 1.5;
	white-space: nowrap;
}

/* شارة القسم خارج الكروت (صفحة الوظيفة المفردة) */
.dl-badge {
	font-size: .75rem;
	font-weight: 700;
}

.dl-badge a {
	background: var(--dl-blue-soft);
	color: var(--dl-blue-dark);
	padding: .2rem .65rem;
	border-radius: 999px;
	text-decoration: none;
	display: inline-block;
}

.dl-badge a:hover {
	background: var(--dl-blue);
	color: #fff;
}

/* شارة "جديد" — تُضاف من الإضافة للمقالات خلال 48 ساعة */
.dl-new {
	background: var(--dl-green);
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	padding: .15rem .55rem;
	border-radius: 999px;
}

/* ===================================================================
   5) صفحة الوظيفة المفردة
   =================================================================== */

.dl-job-header {
	background: #fff;
	border: 1px solid var(--dl-line);
	border-radius: var(--dl-radius);
	padding: 1.75rem;
	text-align: center;
	margin-bottom: 1.5rem;
}

.dl-job-header .wp-block-post-featured-image img {
	max-width: 190px;
	height: auto;
	margin-inline: auto;
	object-fit: contain;
}

.dl-job-header .wp-block-post-title {
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.6;
	margin: .85rem 0 .5rem;
}

.dl-job-body {
	background: #fff;
	border: 1px solid var(--dl-line);
	border-radius: var(--dl-radius);
	padding: 1.75rem;
	line-height: 1.95;
}

.dl-job-body h2,
.dl-job-body h3 {
	color: var(--dl-blue-dark);
	font-size: 1.15rem;
	font-weight: 800;
	margin: 1.75rem 0 .6rem;
	padding-inline-start: .6rem;
	border-inline-start: 3px solid var(--dl-blue);
}

.dl-job-body ul,
.dl-job-body ol {
	padding-inline-start: 1.4rem;
	margin: .75rem 0;
}

.dl-job-body li {
	margin-bottom: .45rem;
}

.dl-job-body a {
	color: var(--dl-blue);
	font-weight: 600;
}

/* زر التقديم — الإضافة تحوّل روابط التقديم إلى هذا الشكل */
.dl-apply {
	display: block;
	background: var(--dl-green);
	color: #fff !important;
	text-align: center;
	font-weight: 800;
	font-size: 1.05rem;
	padding: .95rem 1.5rem;
	border-radius: var(--dl-radius);
	text-decoration: none !important;
	margin: 1rem 0;
	transition: filter .15s, transform .15s;
}

.dl-apply:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.dl-share {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--dl-line);
}

.dl-share a {
	flex: 1 1 auto;
	text-align: center;
	padding: .6rem 1rem;
	border-radius: 8px;
	color: #fff !important;
	font-weight: 700;
	font-size: .88rem;
	text-decoration: none !important;
	min-width: 110px;
}

.dl-share .s-tg { background: #229ED9; }
.dl-share .s-wa { background: #25D366; }
.dl-share .s-tw { background: #14171A; }

/* ===================================================================
   6) الأرشيف والبحث والترقيم
   =================================================================== */

.dl-archive-head {
	background: #fff;
	border: 1px solid var(--dl-line);
	border-radius: var(--dl-radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.dl-archive-head h1 {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 0 0 .35rem;
}

.dl-archive-head p {
	color: var(--dl-muted);
	margin: 0;
	font-size: .95rem;
}

.wp-block-query-pagination {
	margin-top: 2rem;
	gap: .4rem;
	justify-content: center;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
	background: #fff;
	border: 1px solid var(--dl-line);
	border-radius: 8px;
	padding: .5rem .9rem;
	text-decoration: none;
	color: var(--dl-ink);
	font-weight: 600;
}

.wp-block-query-pagination .current {
	background: var(--dl-blue);
	border-color: var(--dl-blue);
	color: #fff;
}

.wp-block-query-pagination a:hover {
	border-color: var(--dl-blue);
	color: var(--dl-blue);
}

/* ===================================================================
   7) الفوتر
   =================================================================== */

.dl-footer {
	background: var(--dl-ink);
	color: rgba(255, 255, 255, .75);
	padding-block: 2.5rem 1.5rem;
	margin-top: 3rem;
}

.dl-footer a {
	color: rgba(255, 255, 255, .8);
	text-decoration: none;
}

.dl-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.dl-footer h3 {
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 .75rem;
}

.dl-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	text-align: center;
	font-size: .85rem;
}

/* ===================================================================
   8) الجوال
   =================================================================== */

@media (max-width: 781px) {
	.dl-hero {
		padding: 2.25rem 1rem;
	}

	.dl-hero h1,
	.dl-hero h2 {
		font-size: 1.45rem;
	}

	/* مقاس الشعار على الجوال في استعلام 768px أعلاه */

	.dl-card {
		padding: 14px 16px;
		gap: 10px;
	}

	.dl-card .wp-block-post-featured-image {
		flex: 0 0 70px;
		width: 70px;
		height: 70px;
	}

	/* قواعد الأقسام على الجوال في استعلام 768px أعلاه — شبكة لا تمرير */

	.dl-job-header,
	.dl-job-body {
		padding: 1.15rem;
	}

	.dl-section-title h2 {
		font-size: 1.15rem;
	}
}

/* الطباعة — إخفاء ما لا يلزم عند طباعة إعلان وظيفة */
@media print {
	.dl-header, .dl-footer, .dl-share, .dl-hero { display: none !important; }
	.dl-job-body { border: 0; padding: 0; }
}
