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

.cds, .cds-pages { box-sizing: border-box; width: 100%; max-width: 860px; margin: 8px auto 28px; min-width: 0; }
.cds { container-type: inline-size; container-name: cds; }
.cds *, .cds *::before, .cds *::after, .cds-pages *, .cds-pages *::before, .cds-pages *::after { box-sizing: border-box; }
.cds svg { flex: 0 0 auto; max-width: none; }
.cds-intro { margin-bottom: 18px; }
.cds-none { padding: 20px; text-align: center; color: var(--muted, #6b7280); background: var(--surface, #fff); border: 1px dashed var(--line, #e6e1d3); border-radius: 14px; }

/* ---------- الشريط الموحّد ---------- */
.cds-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(--pri, #0e4a55), var(--pri2, #12704f));
	border-inline-start: 6px solid var(--gold, #c9963c);
	box-shadow: var(--sh, 0 8px 24px rgba(16, 24, 40, .16));
}
.cds-main-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cds-main-label { font-size: 14px; opacity: .9; overflow-wrap: anywhere; }
.cds-main-num { font-size: clamp(18px, 5.2cqw, 24px); font-weight: 800; letter-spacing: .5px; direction: ltr; unicode-bidi: isolate; text-align: right; overflow-wrap: anywhere; }

/* ---------- البطاقات (واحدة في كل سطر) ---------- */
.cds-list { display: flex; flex-direction: column; gap: 14px; }
.cds-card {
	display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 18px;
	padding: 18px 20px; text-align: right;
	background: var(--surface, #fff); border: 1px solid var(--line, #e6e1d3); border-radius: 16px;
	box-shadow: var(--sh, 0 4px 16px rgba(16, 24, 40, .06));
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cds-av {
	width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
	background: var(--bg, #f6f4ee); color: var(--muted, #9aa0a8);
	border: 3px solid var(--surface, #fff); box-shadow: 0 0 0 2px var(--gold, #c9963c);
}
.cds-av img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.cds-av svg { width: 40px; height: 40px; }
.cds-body { min-width: 0; }
.cds-name { margin: 0 0 4px; font-size: 18px; line-height: 1.5; color: var(--ink, #1f2226); overflow-wrap: anywhere; }
.cds-role { margin: 0; font-size: 14px; color: var(--muted, #6b7280); overflow-wrap: anywhere; }

/* ---------- الأزرار ---------- */
.cds-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line, #e6e1d3); }
.cds-main .cds-actions { margin: 0; padding: 0; border: 0; }
.cds-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;
}
.cds-btn, .cds-btn:hover, .cds-btn:focus { color: #fff; }
.cds-btn:focus-visible { outline: 3px solid rgba(0, 0, 0, .3); outline-offset: 2px; }
.cds-btn:active { filter: brightness(.95); }
.cds-call { background: #0b6bcb; }
.cds-wa { background: #1fa855; }

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

/* ---------- فهرس الصفحات ---------- */
.cds-pages { display: grid; gap: 12px; }
.cds-pg { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink, #1f2226); background: var(--surface, #fff); border: 1px solid var(--line, #e6e1d3); border-radius: 16px; box-shadow: var(--sh, 0 4px 16px rgba(16, 24, 40, .06)); transition: transform .2s ease, border-color .2s ease; }
.cds-pg-i { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--pri, #0e4a55), var(--pri2, #12704f)); }
.cds-pg-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cds-pg-b b { font-size: 17px; overflow-wrap: anywhere; }
.cds-pg-b small { color: var(--muted, #6b7280); overflow-wrap: anywhere; }
.cds-pg em { flex: 0 0 auto; font-style: normal; font-size: 13px; color: var(--muted, #6b7280); background: var(--bg, #f6f4ee); border-radius: 999px; padding: 2px 12px; }

@media (hover: hover) {
	.cds-card:hover, .cds-pg:hover { transform: translateY(-3px); border-color: var(--gold, #c9963c); }
	.cds-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
}

/* ====== حاوية ضيقة (جوال) ====== */
@container cds (max-width: 560px) {
	.cds-main { flex-direction: column; align-items: stretch; text-align: center; padding: 16px 14px; }
	.cds-main-info { align-items: center; }
	.cds-card { grid-template-columns: 60px minmax(0, 1fr); column-gap: 12px; row-gap: 0; padding: 14px; }
	.cds-av { width: 60px; height: 60px; border-width: 2px; grid-row: 1 / span 2; align-self: center; }
	.cds-av svg { width: 32px; height: 32px; }
	.cds-body { display: contents; }
	.cds-name { grid-column: 2; align-self: end; margin: 0; font-size: 17px; }
	.cds-role { grid-column: 2; align-self: start; font-size: 13px; }
	.cds-norole .cds-name { align-self: center; }
	.cds-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; }
	.cds-main .cds-actions { margin: 0; padding: 0; }
	.cds-btn { width: 100%; min-height: 48px; }
	.cds-map { padding: 14px; margin-top: 18px; }
	.cds-map-f { aspect-ratio: 4 / 3; min-height: 220px; }
}
@container cds (max-width: 340px) {
	.cds-card { grid-template-columns: 52px minmax(0, 1fr); padding: 12px; }
	.cds-av { width: 52px; height: 52px; }
	.cds-actions { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .cds-pg { padding: 14px; } .cds-pg em { display: none; } }
@media (prefers-reduced-motion: reduce) { .cds-card, .cds-pg, .cds-btn { transition: none; } .cds-card:hover, .cds-pg:hover, .cds-btn:hover { transform: none; } }
