/**
 * الشريط العلوي والهيدر لثيم النحالين (قالبهما من الأب header.php، والتنسيق هنا فقط).
 *
 * الألوان من إعدادات الموقع: الأساسي للشريط العلوي والنصوص، والثانوي (العسلي) للعنصر النشط والزر.
 * يُحمَّل في كل الصفحات من functions.php.
 */

/* ==========================================================================
   1) الشريط العلوي: أيقونات التواصل يساراً بلا دوائر، والتواصل يميناً
   ========================================================================== */

.site-top-bar {
	padding: 6px 0;
	border-bottom: 0;
	font-size: 0.82rem;
}

.site-top-bar .top-bar-container {
	flex-direction: row-reverse;
}

.site-top-bar .top-bar-social {
	gap: 14px;
}

.site-top-bar .top-bar-social-btn {
	width: auto;
	height: auto;
	background: transparent;
	opacity: 0.85;
}

.site-top-bar .top-bar-social-btn:hover,
.site-top-bar .top-bar-social-btn:focus-visible {
	background: transparent;
	box-shadow: none;
	opacity: 1;
	transform: translateY(-1px);
}

/* الأيقونات بيضاء أحادية (fill كخاصية في الـ SVG، والـ CSS يغلبها)، وتأخذ الثانوي عند المرور */
.site-top-bar .top-bar-social-btn .social-mono-svg {
	transition: fill 0.2s ease;
}

.site-top-bar .top-bar-social-btn:hover .social-mono-svg,
.site-top-bar .top-bar-social-btn:focus-visible .social-mono-svg {
	fill: var(--theme-secondary);
}

.site-top-bar .top-bar-social-btn svg,
.site-top-bar .top-bar-social-btn .social-mono-svg,
.site-top-bar .top-bar-social-btn .social-colored-svg {
	width: 14px;
	height: 14px;
}

.site-top-bar .top-bar-contact {
	display: flex;
	align-items: center;
	gap: 18px;
}

.site-top-bar .top-bar-contact-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: rgba(255, 255, 255, 0.88);
	text-decoration: none;
}

.site-top-bar .top-bar-contact-item + .top-bar-contact-item {
	padding-inline-start: 18px;
	border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
}

.site-top-bar .top-bar-icon-btn {
	width: auto;
	height: auto;
	background: transparent;
	color: var(--theme-secondary) !important;
}

.site-top-bar .top-bar-contact-item:hover .top-bar-icon-btn {
	background: transparent;
	box-shadow: none;
	transform: none;
}

/* ==========================================================================
   2) الهيدر: شعار أكبر، وعنصر نشط باللون الثانوي بخط تحته، وزر «تبرع» كبسولة بقلب
   ========================================================================== */

.site-header {
	padding: 6px 0;
	/* انحناء بسيط في نهاية الهيدر يساراً */
	border-bottom-left-radius: 80px 56px;
	box-shadow: 0 6px 24px rgba(var(--theme-primary-rgb), 0.06);
	border-bottom: 0;
}

.site-header .header-btn--bar {
	display: inline-flex;
}

.site-header .custom-logo {
	max-width: 220px;
	max-height: 64px;
}

.main-navigation .nav-menu > li > a {
	position: relative;
	color: var(--theme-primary);
	font-weight: 700;
}

.main-navigation .nav-menu > li > a:hover,
.main-navigation .nav-menu > li.current-menu-item > a,
.main-navigation .nav-menu > li.current-menu-ancestor > a,
.main-navigation .nav-menu > li.current_page_item > a {
	color: var(--theme-secondary);
}

/* خط قصير تحت العنصر النشط */
.main-navigation .nav-menu > li.current-menu-item > a::after,
.main-navigation .nav-menu > li.current-menu-ancestor > a::after,
.main-navigation .nav-menu > li.current_page_item > a::after {
	content: '';
	position: absolute;
	right: 50%; /* توسيط مع translateX(50%)، لا يتبع اتجاه الكتابة */
	bottom: -6px;
	width: 22px;
	height: 3px;
	border-radius: 3px;
	background: var(--theme-secondary);
	transform: translateX(50%);
}

.site-header .header-search-trigger {
	border-color: rgba(var(--theme-primary-rgb), 0.12);
	background: transparent;
	color: var(--theme-primary);
}

/* عند المرور: دائرة بالثانوي وأيقونة بيضاء (الأب يجعل الأيقونة بيضاء بـ !important، فبلا خلفية كانت تختفي) */
.site-header .header-search-trigger:hover {
	border-color: var(--theme-secondary);
	background: var(--theme-secondary);
	color: #ffffff !important;
}

/* زر الهيدر (نصه ورابطه من الإعدادات: «تبرع الآن» مثلاً). الظهور والإخفاء للأب: زر الشريط على الكمبيوتر، ونسخته داخل القائمة على الجوال */

.site-header .header-btn,
.main-navigation .header-btn {
	align-items: center;
	gap: 8px;
	padding: 9px 22px;
	border: 0 !important;
	border-radius: 999px;
	/* ‎.btn-primary‎ في الأب يفرض الأساسي بـ !important */
	background: var(--theme-secondary) !important;
	color: #ffffff !important;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(var(--theme-secondary-rgb), 0.3);
}

.site-header .header-btn::before,
.main-navigation .header-btn::before {
	content: '';
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1 1.1L12 21l7.8-7.5 1-1.1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1 1.1L12 21l7.8-7.5 1-1.1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.site-header .header-btn:hover,
.main-navigation .header-btn:hover {
	background: var(--theme-primary) !important;
	box-shadow: 0 8px 20px rgba(var(--theme-primary-rgb), 0.25);
	transform: translateY(-1px);
}

/*
 * شريط تقدّم التمرير (assets/js/header.js): خط باللون الثانوي أسفل الهيدر يمتد من اليمين بنسبة ما نزله
 * الزائر (--bee-scroll من 0 إلى 1)، ويختفي في أعلى الصفحة.
 */
.site-header .bee-scroll-progress {
	position: absolute;
	inset-inline-start: 0;
	bottom: 0;
	inset-inline-end: 80px; /* يتوقف قبل انحناء الركن الأيسر */
	height: 3px;
	border-radius: 3px;
	background: var(--theme-secondary);
	transform: scaleX(var(--bee-scroll, 0));
	transform-origin: right center;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.site-header.is-scrolled .bee-scroll-progress {
	opacity: 1;
}

/* ==========================================================================
   3)لسان الشعار (الشاشات الواسعة): منطقة بيضاء يمين الشريط العلوي يصعد إليها الشعار،
      وينتهي الأخضر عندها بمنحنى نازل. عرضها يتبع حاوية الهيدر (1400px وحشوة 20px) وعرض الشعار
      الأقصى (220px)، فتبقى محاذية للشعار في كل العروض.
   ========================================================================== */

@media (min-width: 1025px) {
	.site-top-bar {
		--bee-edge: max(0px, (100vw - 1400px) / 2);
		--bee-tab: calc(var(--bee-edge) + 20px + 240px + 70px);
		z-index: 999; /* تحت الهيدر، فيظهر الشعار الصاعد فوقه */
	}

	/* المنطقة البيضاء: قطعة منحنية بعرض 70px على يسارها، والباقي مستطيل */
	.site-top-bar::after {
		content: '';
		position: absolute;
		top: 0;
		inset-inline-start: 0;
		bottom: -1px;
		width: var(--bee-tab);
		background: #ffffff;
		-webkit-mask:
			url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 36' preserveAspectRatio='none'%3E%3Cpath d='M70 0H62C38 0 34 36 0 36H70Z'/%3E%3C/svg%3E") left / 70px 100% no-repeat,
			linear-gradient(#000, #000) right / calc(100% - 69px) 100% no-repeat;
		mask:
			url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 36' preserveAspectRatio='none'%3E%3Cpath d='M70 0H62C38 0 34 36 0 36H70Z'/%3E%3C/svg%3E") left / 70px 100% no-repeat,
			linear-gradient(#000, #000) right / calc(100% - 69px) 100% no-repeat;
		pointer-events: none;
	}

	/* محتوى الشريط بمحاذاة حواف الهيدر، ويتوقف قبل المنطقة البيضاء */
	.site-top-bar .top-bar-container {
		max-width: none;
		padding-inline-start: calc(var(--bee-tab) + 12px);
		padding-inline-end: calc(var(--bee-edge) + 20px);
	}

	.site-header .custom-logo {
		max-height: 60px;
	}

	/* الشعار أعلى قليلاً داخل اللسان (6px، بقدر حشوة الهيدر فلا يُقصّ حين يُثبَّت) */
	.site-header .site-branding {
		transform: translateY(-6px);
	}
}


/*
 * صورة سلايدر الرئيسية تمتد تحت أسفل الهيدر بقدر انحنائه (56px)، فتظهر من خلال انحناء طرفه الأيسر كما في
 * التصميم. فقط حين يكون السلايدر أول قسم في الرئيسية.
 */
.site-main > .child-hero:first-child,
.site-main > .home-hero-slider-wrapper:first-child {
	margin-top: -56px;
}
