/*
 * Aurum v2.1 — طبقة الجوال (تُحمَّل أخيراً).
 *
 * قِيس على عرض 360–430px بمتصفح حقيقي قبل الكتابة. أهم ما تعالجه:
 *  1. كل الجداول كانت تتحول على الجوال إلى «بطاقات» (صف لكل خلية) ⇒ جدول
 *     التاريخ وحده ~3000px، وطول صفحة الدولة 17,000px. الآن جداول مضغوطة
 *     حقيقية بعمود أول ثابت وتمرير أفقي داخلي عند الحاجة فقط.
 *  2. عناوين الجداول (caption) كانت تُعصر كلمةً في كل سطر.
 *  3. الهيرو: العنوان H1 محشور بجانب صورة السبائك (4 أسطر لكلمتين).
 *  4. حقول الحاسبة: الإطار كان على الـ label كاملاً لا على الحقل.
 *  5. أهداف لمس < 44px (مسار التصفح، روابط صغيرة)، ومحتوى تحت الشريط السفلي.
 */

/* ---------- عام: أرقام موقعة لا تنقلب داخل نص عربي ---------- */
.aurum-compare__pct, .aurum-compare__delta, .aurum-dcard__val, .aurum-answerbox__pts strong,
.aurum-tech__item strong, .aurum-msum__row strong, .aurum-num-ltr {
	unicode-bidi: isolate;
	direction: ltr;
	display: inline-block;
}

/* رأس الجدول اللاصق داخل غلاف overflow:hidden كان يُزاح 68px للأسفل
   فيغطي الصف الأول (عيار 24) على سطح المكتب — اللصق لا يعمل داخل غلاف
   مقصوص أصلاً، فنعيده ثابتاً. */
.aurum-table thead th { position: static; }

/* إطار الحاسبة على الحقل نفسه لا على الـ label */
.aurum-calc__field { background: transparent; border: 0; }

/* الصور والوسائط لا تتجاوز الحاوية أبداً */
img, svg, video, iframe { max-width: 100%; }
.aurum-chart-svg { height: auto; }

@media (max-width: 720px) {
	/* ---------- 1) الجداول: مضغوطة بدل البطاقات ---------- */
	.aurum-table { display: table; width: 100%; font-size: 13.5px; }
	.aurum-table thead { display: table-header-group; }
	.aurum-table tbody { display: table-row-group; }
	.aurum-table tr { display: table-row; padding: 0; border: 0; }
	.aurum-table td, .aurum-table th, .aurum-table tbody th {
		display: table-cell;
		width: auto;
		padding: 10px 9px;
		border-bottom: 1px solid var(--line);
		white-space: nowrap;
		vertical-align: middle;
		justify-content: initial;
	}
	.aurum-table td::before { content: none; }
	.aurum-table thead th { font-size: 12px; padding: 9px; position: static; }
	.aurum-table thead th::after { margin-top: 7px; }
	.aurum-table caption {
		display: table-caption;
		caption-side: top;
		white-space: normal;
		font-size: .8rem;
		padding: 12px 12px 4px;
		text-align: start;
	}
	/* عمود العنوان ثابت أثناء التمرير الأفقي */
	.aurum-table tbody th {
		position: sticky;
		inset-inline-start: 0;
		z-index: 1;
		background: var(--panel-solid, var(--bg));
		font-weight: 800;
		color: var(--gold-1);
	}
	.aurum-table-wrap {
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scrollbar-width: thin;
		max-width: 100%;
	}
	/* جداول طويلة الأعمدة: تلميح بصري بوجود تمرير */
	.aurum-table-wrap.is-scrollable { box-shadow: inset 18px 0 14px -14px rgba(0, 0, 0, .18); }

	/* سُلّم الجرامات (بقش) — نفس المعالجة */
	.aurum-ladder { display: table; width: 100%; font-size: 13.5px; }
	.aurum-ladder thead { display: table-header-group; }
	.aurum-ladder tbody { display: table-row-group; }
	.aurum-ladder tr { display: table-row; padding: 0; }
	.aurum-ladder td, .aurum-ladder th, .aurum-ladder tbody th { display: table-cell; width: auto; padding: 9px; white-space: nowrap; }
	.aurum-ladder td::before { content: none; }

	/* ---------- 2) الهيرو: العنوان بعرض كامل ---------- */
	.aurum-chero { padding: 18px 16px; margin-block: 12px; }
	.aurum-chero__inner { flex-direction: column; align-items: stretch; gap: 10px; }
	.aurum-chero__intro { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; }
	.aurum-chero__bars { width: 72px; height: auto; flex: 0 0 72px; }
	.aurum-chero__bars svg, .aurum-chero__bars img { width: 72px; height: auto; }
	.aurum-chero__titles { flex: 1 1 auto; min-width: 0; }
	.aurum-chero__h1 { font-size: clamp(1.35rem, 6vw, 1.7rem); line-height: 1.35; margin: 8px 0 4px; }
	.aurum-chero__upd { font-size: .8rem; }

	/* ---------- 3) الإجابة المختصرة: تسمية فوق القيمة ---------- */
	.aurum-answerbox { padding: 16px; }
	.aurum-answerbox__text { font-size: 1rem; line-height: 1.85; }
	.aurum-answerbox__pts { grid-template-columns: 1fr 1fr; gap: 8px; }
	.aurum-answerbox__pts li { flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; }
	.aurum-answerbox__pts span { font-size: .76rem; }
	.aurum-answerbox__pts strong { font-size: .98rem; white-space: normal; line-height: 1.4; }

	/* ---------- 4) بطاقات المؤشرات: شبكة 2×2 بدل عمود طويل ---------- */
	.aurum-dash__cards { grid-template-columns: 1fr 1fr !important; gap: 10px; }
	.aurum-dcard { padding: 12px; min-width: 0; }
	.aurum-dcard__val { font-size: 1.15rem !important; }
	.aurum-dcard__foot svg { max-height: 30px; }

	/* ---------- 5) الحاسبة والنماذج ---------- */
	.aurum-calc__row { grid-template-columns: 1fr 1fr; }
	.aurum-calc__row > :last-child:nth-child(odd) { grid-column: 1 / -1; }
	.aurum-calc__field input, .aurum-calc__field select,
	.aurum-alert__form input, .aurum-alert__form select, .aurum-zakat input, .aurum-zakat select {
		font-size: 16px; /* أقل من 16px يجعل iOS يكبّر الصفحة عند التركيز */
		min-height: 46px;
	}
	.aurum-calc__result { flex-wrap: wrap; gap: 6px; }

	/* ---------- 6) أهداف اللمس ---------- */
	.aurum-breadcrumb { font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
	.aurum-breadcrumb a { display: inline-flex; align-items: center; min-height: 36px; padding-inline: 2px; }
	.aurum-news__all, .aurum-chart-tabs button, .aurum-regions__tabs button, .aurum-refresh { min-height: 40px; }
	.aurum-faq__q { min-height: 48px; display: flex; align-items: center; }
	.aurum-related__list { grid-template-columns: 1fr; }

	/* ---------- 7) المسافات العامة ---------- */
	.aurum-section-title { font-size: 1.12rem; line-height: 1.5; }
	.aurum-yday, .aurum-monthly, .aurum-rank, .aurum-related { margin-block: 20px; }
	.aurum-container { padding-inline: 14px; }

	/* المحتوى لا يختبئ خلف الشريط السفلي الثابت */
	body.aurum-has-mnav { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 480px) {
	/* أعمدة ثانوية تختفي على الهواتف (تبقى في سطح المكتب والـ Schema) */
	.aurum-table .aurum-col-opt { display: none; }
	/* الشريط العلوي الداكن يكرر ما في الشريط الحي — 40px مهدرة فوق الطيّة */
	.aurum-topbar { display: none; }
	.aurum-livestrip { font-size: .8rem; }
	.aurum-livestrip__time { display: none; }
}

@media (max-width: 380px) {
	.aurum-table { font-size: 12.5px; }
	.aurum-table td, .aurum-table th { padding: 9px 7px; }
	.aurum-answerbox__pts { grid-template-columns: 1fr; }
	.aurum-dash__cards { grid-template-columns: 1fr !important; }
	.aurum-calc__row { grid-template-columns: 1fr; }
}

/* محور الرسم: كان الوسمان يلتصقان («26/1024/11») — الرسم LTR فالمحور كذلك */
.aurum-chart-axis { display: flex; justify-content: space-between; direction: ltr; margin-top: 6px; color: var(--ink-3); font-size: 11px; }
.aurum-chart-val, .aurum-chart-date { unicode-bidi: isolate; }

/* أعمدة الشبكات: min-width:auto الافتراضي يجعل جدولاً بـ nowrap يوسّع العمود
   خارج الشاشة — نسمح بالانكماش ويتولّى غلاف الجدول التمرير الداخلي */
[class*="aurum-row"] > *, .aurum-dash > *, .aurum-dash__cards > *, .aurum-market > *, .aurum-landing > * { min-width: 0; }
.aurum-dcard__foot { min-width: 0; }
.aurum-dcard__spark { flex: 1 1 auto; min-width: 0; max-width: 60%; }
.aurum-dcard__spark svg { width: 100%; height: auto; }

@media (max-width: 720px) {
	/* التذييل: العلامة بعرض كامل ثم عمودان */
	.aurum-footer__top { grid-template-columns: 1fr 1fr !important; gap: 22px 16px; }
	.aurum-footer__top > :first-child { grid-column: 1 / -1; }
	.aurum-footer a { display: inline-block; padding-block: 6px; }
}

/* الزكاة: السطر كان لا يلتف فيخرج المبلغ خارج الشاشة */
.aurum-zakat__line { flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.aurum-zakat__line > * { min-width: 0; overflow-wrap: anywhere; }

/* الحاسبة: أعمدة تتكيّف مع عرض الحاوية بدل 3 أعمدة ثابتة */
.aurum-calc__row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* الأجهزة اللوحية (721–1024): القائمة الأفقية لا تتسع ⇒ درج جانبي كالجوال */
@media (min-width: 721px) and (max-width: 1024px) {
	.aurum-hdr__nav {
		position: fixed;
		inset: 0;
		background: color-mix(in srgb, var(--bg) 96%, transparent);
		backdrop-filter: blur(16px);
		z-index: 98;
		flex-direction: column;
		justify-content: flex-start;
		padding: 74px 22px 22px;
		transform: translateX(105%);
		visibility: hidden;
		transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .35s;
	}
	.aurum-hdr__nav.is-open { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
	.aurum-navmenu { flex-direction: column; width: 100%; gap: 6px; }
	.aurum-navmenu a { font-size: 1.05rem; padding: 13px 14px; }
	.aurum-nav-close { display: grid; place-items: center; position: absolute; top: 16px; inset-inline-end: 18px; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
	.aurum-menu-toggle { display: block; }
}

.aurum-more { margin: 12px 0 0; }
.aurum-more__link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--gold-1); font-weight: 800; font-size: .9rem; text-decoration: none; }
.aurum-more__link:hover, .aurum-more__link:focus-visible { border-color: var(--gold-2); }

/* نموذج التعليقات (comments.php الجديد) */
.aurum-comments textarea, .aurum-comments input[type="text"], .aurum-comments input[type="email"], .aurum-comments input[type="url"] { width: 100%; max-width: 100%; box-sizing: border-box; font-size: 16px; }
