/* ===== بطاقات التواصل — تصميم متجاوب =====
   يعتمد على عرض الحاوية نفسها (container query) لا عرض الشاشة، فيتكيّف مع وجود الشريط الجانبي أو غيابه. */

.hcc-wrap {
	--hcc-accent: var(--sabiq-accent, #e02020);
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 20px 0;
	direction: rtl;
	container-type: inline-size;
	container-name: hcc;
}
.hcc-wrap *, .hcc-wrap *::before, .hcc-wrap *::after { box-sizing: border-box; }
.hcc-wrap svg { flex: 0 0 auto; max-width: none; }

/* ---------- الشريط الموحد ---------- */
.hcc-main {
	display: flex; align-items: center; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap;
	margin-bottom: 16px; padding: 16px 20px; border-radius: 16px; color: #fff;
	background: linear-gradient(135deg, var(--sabiq-dark, #14161a), #2a2f38);
	border-inline-start: 6px solid var(--hcc-accent);
	box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}
.hcc-main-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hcc-main-label { font-size: 14px; opacity: .85; overflow-wrap: anywhere; }
.hcc-main-number {
	font-size: clamp(18px, 5.2cqw, 24px); font-weight: 800; letter-spacing: .5px;
	direction: ltr; unicode-bidi: isolate; text-align: right; overflow-wrap: anywhere;
}

/* ---------- القائمة والبطاقات ---------- */
.hcc-list { display: flex; flex-direction: column; gap: 14px; }

.hcc-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	column-gap: 18px;
	padding: 18px 20px;
	background: var(--sabiq-white, #fff);
	border: 1px solid var(--sabiq-border, #e7e7ea);
	border-radius: 16px;
	box-shadow: 0 4px 16px rgba(16, 24, 40, .06);
	text-align: right;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hcc-avatar {
	width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	background: var(--sabiq-bg, #f7f7f8); color: var(--sabiq-muted, #9aa0a8);
	border: 3px solid #fff; box-shadow: 0 0 0 2px var(--hcc-accent);
}
.hcc-avatar .hcc-photo { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.hcc-body { min-width: 0; }
.hcc-name {
	margin: 0 0 4px; font-size: 18px; line-height: 1.5;
	font-family: var(--font-heading, inherit); color: var(--sabiq-text, #1f2226);
	overflow-wrap: anywhere;
}
.hcc-role { margin: 0; font-size: 14px; color: var(--sabiq-muted, #6b7280); overflow-wrap: anywhere; }

/* ---------- الأزرار ---------- */
.hcc-actions {
	display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px;
	margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--sabiq-border, #e7e7ea);
}
.hcc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-width: 44px; min-height: 44px; padding: 8px 16px; border-radius: 12px;
	font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; color: #fff;
	-webkit-tap-highlight-color: transparent;
	transition: transform .15s ease, filter .15s ease;
}
.hcc-btn:focus-visible { outline: 3px solid rgba(0, 0, 0, .3); outline-offset: 2px; }
.hcc-btn:active { filter: brightness(.95); }
.hcc-call { background: #0b6bcb; }
.hcc-wa   { background: #1fa855; }
.hcc-map  { background: #e8453c; }
.hcc-btn, .hcc-btn:hover, .hcc-btn:focus { color: #fff; }

/* ---------- الخريطة ---------- */
.hcc-map-box {
	margin-top: 24px; padding: 18px;
	background: var(--sabiq-white, #fff); border: 1px solid var(--sabiq-border, #e7e7ea);
	border-radius: 16px; box-shadow: 0 4px 16px rgba(16, 24, 40, .06); text-align: center;
}
.hcc-map-title {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	margin: 0 0 14px; font-size: 18px; line-height: 1.5;
	font-family: var(--font-heading, inherit); color: var(--sabiq-text, #1f2226);
}
.hcc-map-title svg { color: #e8453c; }
.hcc-map-frame {
	position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 240px;
	border-radius: 12px; overflow: hidden; background: var(--sabiq-bg, #f7f7f8);
}
.hcc-map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; border: 0; }

/* ---------- الترقيم وحالات أخرى ---------- */
.hcc-pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.hcc-pager a {
	min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--sabiq-border, #e7e7ea); border-radius: 10px; text-decoration: none; font-weight: 700;
	color: var(--sabiq-text, #1f2226); background: #fff;
}
.hcc-pager a:hover { border-color: var(--hcc-accent); color: var(--hcc-accent); }
.hcc-pager a.is-current { background: var(--hcc-accent); border-color: var(--hcc-accent); color: #fff; }
.hcc-empty { padding: 20px; text-align: center; color: var(--sabiq-muted, #6b7280); background: var(--sabiq-bg, #f7f7f8); border-radius: 12px; }
.hcc-intro { margin-bottom: 8px; }

/* ---------- تأثيرات للأجهزة التي تدعم المؤشر فقط ---------- */
@media (hover: hover) {
	.hcc-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 24, 40, .12); border-color: var(--hcc-accent); }
	.hcc-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
	.hcc-pager a:hover { border-color: var(--hcc-accent); }
}

/* ====================================================
   حاوية متوسطة/ضيقة (جوال أو عمود ضيق)
   ==================================================== */
@container hcc (max-width: 560px) {
	.hcc-main { flex-direction: column; align-items: stretch; text-align: center; padding: 16px 14px; }
	.hcc-main-info { align-items: center; }
	.hcc-main .hcc-actions { width: 100%; }

	/* الصورة بجانب الاسم، والأزرار تحتهما بعرض كامل */
	.hcc-card {
		grid-template-columns: 60px minmax(0, 1fr);
		column-gap: 12px;
		row-gap: 0;
		padding: 14px;
	}
	.hcc-avatar { width: 60px; height: 60px; border-width: 2px; grid-row: 1 / span 2; align-self: center; }
	.hcc-body { display: contents; }
	.hcc-name { grid-column: 2; align-self: end; margin: 0; font-size: 17px; }
	.hcc-role { grid-column: 2; align-self: start; font-size: 13px; }
	.hcc-card--norole .hcc-name { align-self: center; }

	.hcc-actions {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
		gap: 8px;
		margin-top: 12px; padding-top: 12px;
	}
	.hcc-main .hcc-actions { margin: 0; padding: 0; border: 0; }
	.hcc-btn { width: 100%; min-height: 48px; }

	.hcc-map-box { padding: 14px; margin-top: 18px; }
	.hcc-map-frame { aspect-ratio: 4 / 3; min-height: 220px; }
}

/* شاشات صغيرة جدًا */
@container hcc (max-width: 340px) {
	.hcc-card { grid-template-columns: 52px minmax(0, 1fr); padding: 12px; }
	.hcc-avatar { width: 52px; height: 52px; }
	.hcc-name { font-size: 16px; }
	.hcc-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.hcc-card, .hcc-btn { transition: none; }
	.hcc-card:hover, .hcc-btn:hover { transform: none; }
}
