/**
 * قسم المدير التنفيذي في ثيم هدي: «رسالة على ورق مسطّر» (template-parts/home/home-ceo.php).
 */

/* شريط أخضر الحبر بكتاب الشعار خافتاً في زاويته، والرسالة في وسطه */
.hd-ceo {
	overflow: hidden;
	padding: 84px 0 92px;
	background: linear-gradient(160deg, var(--hd-ink-soft), var(--hd-ink));
}

.hd-ceo::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--hd-gold-grad);
	opacity: 0.1;
	-webkit-mask: var(--hd-flow) left -140px bottom -90px / 620px auto no-repeat;
	mask: var(--hd-flow) left -140px bottom -90px / 620px auto no-repeat;
	pointer-events: none;
}

/* ==========================================================================
   1) الورقة: النص يميناً والصورة المثبّتة يساراً
   ========================================================================== */

.hd-ceo__letter {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 48px;
	align-items: start;
	max-width: 1040px;
	margin: 0 auto;
	padding: 52px 84px 52px 52px;
}

.hd-ceo__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.hd-ceo__title {
	margin: 0;
	color: var(--hd-ink);
	font-family: var(--hd-display);
	font-size: clamp(1.8rem, 1.35rem + 1.4vw, 2.4rem);
	font-weight: 800;
	line-height: 1.45;
}

.hd-ceo__stroke {
	margin: 2px 0 0 12px;
}

/* الكلمة: بسطر الورقة نفسه (34px) فتجلس الكلمات على السطور */
.hd-ceo__word {
	position: relative;
	margin: 26px 0 0;
	padding: 0;
	border: 0;
	background: none;
}

.hd-ceo__mark {
	display: block;
	margin-bottom: 4px;
	color: rgba(var(--hd-gold-rgb), 0.75);
	transform: scaleX(-1);
}

.hd-ceo__word p {
	margin: 0;
	color: var(--theme-text-dark, #1f2a22);
	font-size: 1.08rem;
	line-height: var(--hd-rule-gap);
}

/* التوقيع: الاسم كتوقيع آخر الرسالة */
.hd-ceo__sign {
	align-self: flex-end;
	margin-top: 26px;
	text-align: left;
}

.hd-ceo__name {
	margin: 0;
	color: var(--theme-primary);
	font-family: var(--hd-display);
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.4;
}

.hd-ceo__degree {
	margin: 2px 0 0;
	color: var(--theme-text-light, #5b6b60);
	font-size: 0.92rem;
}

/* ذيل الرسالة: بيانات التواصل والحسابات بعد خط ذهبي */
.hd-ceo__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	width: 100%;
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--hd-line-soft);
}

.hd-ceo__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hd-ceo__meta li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--theme-text-dark, #1f2a22);
	font-size: 0.92rem;
}

.hd-ceo__meta a {
	color: inherit;
	text-decoration: none;
}

.hd-ceo__meta a:hover {
	color: var(--theme-primary);
}

.hd-ceo__meta-icon {
	display: inline-flex;
	color: var(--hd-gold);
}

.hd-ceo__socials {
	display: flex;
	gap: 8px;
}

.hd-ceo__socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--hd-line);
	border-radius: 50%;
	color: var(--theme-primary);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hd-ceo__socials a:hover,
.hd-ceo__socials a:focus-visible {
	border-color: var(--theme-primary);
	background: var(--theme-primary);
	color: #ffffff;
}

/* ==========================================================================
   2) الصورة: إطار أبيض مائل قليلاً، مثبّت بمشبك ورق
   ========================================================================== */

.hd-ceo__photo {
	position: relative;
	margin: -8px 0 0;
	padding: 12px 12px 14px;
	background: #ffffff;
	box-shadow: 0 18px 36px -18px rgba(30, 40, 20, 0.45), 0 0 0 1px var(--hd-page-edge);
	transform: rotate(-2.5deg);
}

.hd-ceo__frame {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--hd-paper-deep);
}

/* بلا صورة: أخضر الحبر بجناحي كتاب الشعار، وصورة رمزية ذهبية خافتة */
.hd-ceo__photo--placeholder .hd-ceo__frame {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: radial-gradient(80% 60% at 50% 30%, var(--hd-ink-soft), var(--hd-ink));
}

.hd-ceo__photo--placeholder .hd-ceo__frame::before {
	content: '';
	position: absolute;
	top: 14%;
	left: 50%;
	width: 70%;
	aspect-ratio: 3 / 1;
	background: var(--hd-gold-grad);
	opacity: 0.35;
	-webkit-mask: var(--hd-wings) center / contain no-repeat;
	mask: var(--hd-wings) center / contain no-repeat;
	transform: translateX(-50%);
}

.hd-ceo__avatar {
	position: relative;
	width: 72%;
	height: auto;
	fill: rgba(var(--hd-gold-rgb), 0.55);
}

.hd-ceo__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hd-ceo__caption {
	margin-top: 10px;
	color: var(--hd-ink);
	font-family: var(--hd-display);
	font-size: 1.1rem;
	font-weight: 800;
	text-align: center;
}

.hd-ceo__clip {
	position: absolute;
	top: -26px;
	right: 34px;
	z-index: 2;
	width: 22px;
	height: 56px;
	color: #9aa3a0;
	filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
}

/* ==========================================================================
   3) الأجهزة اللوحية والجوال: الصورة فوق الرسالة
   ========================================================================== */

@media (max-width: 900px) {
	.hd-ceo__letter {
		grid-template-columns: minmax(0, 1fr);
		gap: 34px;
		padding: 40px 56px 40px 24px;
	}

	.hd-ceo__photo {
		grid-row: 1;
		justify-self: center;
		width: min(260px, 80%);
		margin-top: 0;
	}
}

@media (max-width: 767px) {
	.hd-ceo {
		padding: 56px 0 64px;
	}

	.hd-paper--ruled.hd-ceo__letter {
		background-image: linear-gradient(to left, transparent 26px, var(--hd-margin) 26px, var(--hd-margin) 27px, transparent 27px), var(--hd-ruled);
		padding: 34px 40px 34px 20px;
	}

	.hd-ceo__sign {
		align-self: flex-start;
		text-align: right;
	}
}
