/* =====================================================
   Bunyan Header & Footer — v1.0.0
   الألوان: أخضر #0f3d35 | ذهبي #c08b40 | كريمي #fbf9f4
   ===================================================== */

body.bhf-active {
	--bhf-green: #0f3d35;
	--bhf-green-dark: #0a2a24;
	--bhf-gold: #c08b40;
	--bhf-cream: #fbf9f4;
}

/* ===================== الهيدر ===================== */

body.bhf-active #masthead {
	z-index: 9990;
	border-bottom: 3px solid transparent;
	border-image: linear-gradient(90deg, transparent, var(--bhf-gold), transparent) 1;
	box-shadow: 0 10px 30px rgba(15, 61, 53, 0.10);
}

body.bhf-sticky #masthead {
	position: sticky;
	top: 0;
}
body.bhf-sticky.admin-bar #masthead { top: 32px; }
@media (max-width: 782px) {
	body.bhf-sticky.admin-bar #masthead { top: 46px; }
}

body.bhf-active #masthead .ast-primary-header-bar {
	background: rgba(251, 249, 244, 0.88) !important;
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 0 !important;
	min-height: 76px;
	transition: min-height 0.3s ease, box-shadow 0.3s ease;
}

/* هيدر مصغّر بعد النزول (الكلاس بيضيفه الـ JS) */
body.bhf-active.bhf-scrolled #masthead .ast-primary-header-bar { min-height: 62px; }
body.bhf-active.bhf-scrolled #masthead { box-shadow: 0 8px 24px rgba(15, 61, 53, 0.16); }

/* اللوجو */
body.bhf-active #masthead .custom-logo {
	width: auto;
	height: 52px;
	max-width: none;
	transition: transform 0.3s ease, height 0.3s ease;
}
body.bhf-active.bhf-scrolled #masthead .custom-logo { height: 44px; }
body.bhf-active #masthead .custom-logo-link:hover .custom-logo { transform: scale(1.06); }

/* روابط القائمة */
body.bhf-active #masthead .main-header-menu {
	gap: 6px;
	align-items: center;
}
body.bhf-active #masthead .main-header-menu > .menu-item > .menu-link {
	position: relative;
	font-family: 'Tajawal', sans-serif;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	color: var(--bhf-green);
	padding: 10px 16px !important;
	border-radius: 999px;
	transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
body.bhf-active #masthead .main-header-menu > .menu-item > .menu-link::after {
	content: "";
	position: absolute;
	inset-inline: 16px;
	bottom: 5px;
	height: 2px;
	background: var(--bhf-gold);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.3s ease;
}
body.bhf-active #masthead .main-header-menu > .menu-item > .menu-link:hover { color: var(--bhf-gold); }
body.bhf-active #masthead .main-header-menu > .menu-item > .menu-link:hover::after { transform: scaleX(1); }

/* الصفحة الحالية: كبسولة خضراء */
body.bhf-active #masthead .main-header-menu > .current-menu-item > .menu-link {
	background: var(--bhf-green);
	color: #fff !important;
	box-shadow: 0 6px 16px rgba(15, 61, 53, 0.25);
}
body.bhf-active #masthead .main-header-menu > .current-menu-item > .menu-link::after { display: none; }

/* زرار اللغة (Polylang) */
body.bhf-active #masthead .main-header-menu > .lang-item > .menu-link {
	border: 1.5px solid var(--bhf-gold);
	color: var(--bhf-gold) !important;
	padding: 8px 18px !important;
	margin-inline-start: 12px;
	background: transparent;
}
body.bhf-active #masthead .main-header-menu > .lang-item > .menu-link::before {
	content: "\1F310";
	margin-inline-end: 8px;
	font-size: 14px;
}
body.bhf-active #masthead .main-header-menu > .lang-item > .menu-link::after { display: none; }
body.bhf-active #masthead .main-header-menu > .lang-item > .menu-link:hover {
	background: var(--bhf-gold);
	color: #fff !important;
	box-shadow: 0 6px 16px rgba(192, 139, 64, 0.35);
}

/* موبايل */
@media (max-width: 921px) {
	body.bhf-active #masthead .ast-primary-header-bar { min-height: 68px; }
	body.bhf-active #masthead .custom-logo { height: 44px; }

	body.bhf-active #masthead .menu-toggle.main-header-menu-toggle {
		background: var(--bhf-green) !important;
		color: #fff !important;
		border-radius: 12px;
		padding: 9px 11px;
		box-shadow: 0 6px 14px rgba(15, 61, 53, 0.25);
	}

	body.bhf-active #masthead .ast-mobile-header-content {
		background: var(--bhf-cream) !important;
		border-radius: 0 0 22px 22px;
		padding: 12px 16px 20px;
		box-shadow: 0 20px 40px rgba(15, 61, 53, 0.18);
		border-top: 1px solid rgba(15, 61, 53, 0.06);
	}
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link {
		display: block;
		padding: 13px 16px !important;
		border-radius: 14px;
		color: var(--bhf-green);
		font-weight: 700;
	}
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link::after { display: none; }
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link:hover {
		background: rgba(192, 139, 64, 0.12);
		color: var(--bhf-gold);
	}
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu > .current-menu-item > .menu-link {
		background: var(--bhf-green);
		color: #fff !important;
	}
	body.bhf-active #masthead .ast-mobile-header-content .main-header-menu > .lang-item > .menu-link {
		margin-inline-start: 0;
		margin-top: 6px;
		text-align: center;
		border: 1.5px solid var(--bhf-gold);
		color: var(--bhf-gold) !important;
	}
}

/* ===================== فوتر Astra الافتراضي ===================== */

body.bhf-hide-astra-footer .site-footer,
body.bhf-hide-astra-footer #colophon {
	display: none !important;
}

/* ===================== فوتر بُنيان ===================== */

.bhf-footer {
	position: relative;
	background: linear-gradient(180deg, #0f3d35 0%, #0a2a24 100%);
	color: rgba(255, 255, 255, 0.82);
	font-family: 'Tajawal', sans-serif;
	padding: 72px 0 0;
	margin-top: 40px;
	border-top: 4px solid var(--bhf-gold, #c08b40);
	overflow: hidden;
}
.bhf-footer::before {
	content: "";
	position: absolute;
	top: -120px;
	inset-inline-start: -120px;
	width: 320px;
	height: 320px;
	background: radial-gradient(circle, rgba(192, 139, 64, 0.22), transparent 70%);
	pointer-events: none;
}
.bhf-container {
	position: relative;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}
.bhf-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1.1fr 1.2fr;
	gap: 40px;
	padding-bottom: 48px;
}
.bhf-grid--3 { grid-template-columns: 1.6fr 1fr 1fr; }

.bhf-logo {
	display: inline-flex;
	background: #fff;
	padding: 10px 16px;
	border-radius: 16px;
	margin-bottom: 18px;
}
.bhf-logo img { height: 52px; width: auto; display: block; }

.bhf-about {
	margin: 0 0 20px;
	font-size: 14.5px;
	line-height: 1.9;
	color: rgba(255, 255, 255, 0.75);
	max-width: 360px;
}

.bhf-title {
	position: relative;
	margin: 0 0 22px;
	padding-bottom: 12px;
	font-size: 17px;
	font-weight: 800;
	color: #fff;
}
.bhf-title::after {
	content: "";
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	width: 36px;
	height: 3px;
	border-radius: 3px;
	background: var(--bhf-gold, #c08b40);
}

.bhf-links {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}
.bhf-links li { margin: 0 0 12px; }
.bhf-links a {
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 500;
	transition: color 0.2s ease, padding 0.2s ease;
}
.bhf-links a:hover {
	color: var(--bhf-gold, #c08b40);
	padding-inline-start: 6px;
}

.bhf-btn {
	display: inline-block;
	background: var(--bhf-gold, #c08b40);
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	padding: 11px 24px;
	border-radius: 999px;
	box-shadow: 0 8px 20px rgba(192, 139, 64, 0.35);
	transition: transform 0.2s ease, background 0.2s ease;
}
.bhf-btn:hover { background: #a37535; transform: translateY(-2px); }

.bhf-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.bhf-socials a {
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	padding: 7px 14px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.bhf-socials a:hover {
	background: var(--bhf-gold, #c08b40);
	border-color: var(--bhf-gold, #c08b40);
}

.bhf-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px 24px;
	padding: 22px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.10);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.60);
}

/* زر العودة للأعلى */
.bhf-top {
	position: fixed;
	bottom: 22px;
	inset-inline-end: 22px;
	z-index: 9980;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 14px;
	background: var(--bhf-gold, #c08b40);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(15, 61, 53, 0.30);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.bhf-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.bhf-top:hover { background: var(--bhf-green, #0f3d35); }

@media (max-width: 900px) {
	.bhf-grid,
	.bhf-grid--3 { grid-template-columns: 1fr 1fr; gap: 32px; }
	.bhf-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.bhf-footer { padding-top: 52px; }
	.bhf-grid,
	.bhf-grid--3 { grid-template-columns: 1fr; }
	.bhf-bottom { flex-direction: column; align-items: flex-start; }
}

.bhf-about + .bhf-btn { margin-bottom: 20px; }
.bhf-links .bhf-static { color: rgba(255,255,255,.78); font-size: 14.5px; line-height: 1.7; }
