/* =========================================================
   قياس+ — نظام التصميم
   Concept: "Signal / Pulse" — feedback as a live signal
   منقول من الموقع الثابت مع الحفاظ على نفس الرموز البصرية.
   ========================================================= */

:root {
	--bg: #F7F5F0;
	--bg-2: #FFFFFF;
	--surface: #FFFFFF;
	--surface-2: #FBF9F4;
	--line: rgba(23, 42, 58, .12);
	--line-strong: rgba(23, 42, 58, .22);

	--ink: #132433;
	--ink-soft: #3A4C5A;
	--muted: #6B7E8C;

	--amber-1: #F5A623;
	--amber-2: #EF7B2E;
	--mint: #12A87A;
	--mint-dim: #0E8E67;
	--rose: #E0526A;

	--amber-glow: 0 0 0 1px rgba(245, 166, 35, .30), 0 14px 34px -12px rgba(239, 123, 46, .40);
	--radius: 18px;
	--radius-lg: 26px;
	--radius-sm: 12px;
	--shadow: 0 30px 60px -32px rgba(23, 42, 58, .28);

	--f-display: 'Tajawal', system-ui, sans-serif;
	--f-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

html {
	scroll-behavior: smooth;
}

body {
	background-image:
		radial-gradient(900px 500px at 100% -5%, rgba(239, 123, 46, .07), transparent 60%),
		radial-gradient(800px 500px at -5% 20%, rgba(18, 168, 122, .06), transparent 55%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* الوصول: حلقة تركيز واضحة للتنقل بلوحة المفاتيح */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: 2px solid var(--amber-2);
	outline-offset: 3px;
	border-radius: 4px;
}

/* تخطي إلى المحتوى */
.skip-link {
	position: absolute;
	right: -9999px;
	top: 8px;
	z-index: 999;
	background: var(--ink);
	color: var(--bg);
	padding: 12px 22px;
	border-radius: 100px;
	font-weight: 600;
}

.skip-link:focus {
	right: 8px;
}

/* ---------- الترويسة ---------- */
.qp-nav {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	background: rgba(247, 245, 240, .82);
	border-bottom: 1px solid var(--line);
}

.qp-brand {
	font-family: var(--f-display);
	font-weight: 900;
	font-size: 1.18rem;
	display: inline-flex;
	align-items: center;
	gap: 11px;
	text-decoration: none;
}

.qp-brand-mark {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--amber-1), var(--amber-2));
	display: grid;
	place-items: center;
	flex: none;
}

.qp-brand-mark svg {
	width: 19px;
	height: 19px;
}

/* التنقل */
.qp-nav .wp-block-navigation {
	font-family: var(--f-body);
	font-weight: 500;
	font-size: .95rem;
}

.qp-nav .wp-block-navigation a:hover {
	color: var(--amber-2);
}

.qp-nav .wp-block-navigation .current-menu-item > a {
	color: var(--amber-2);
	font-weight: 600;
}

/* ---------- التدرج النصي ---------- */
.amber-txt,
.has-amber-gradient-background.has-text-gradient {
	background: linear-gradient(90deg, var(--amber-1), var(--amber-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---------- أنماط الفقرات ---------- */
.is-style-qiyas-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: .82rem;
	letter-spacing: .04em;
	color: var(--amber-1);
	margin-bottom: 10px;
}

.is-style-qiyas-lead {
	font-size: clamp(1.05rem, 1.6vw, 1.22rem);
	color: var(--ink-soft);
	max-width: 60ch;
}

/* ---------- البطاقات ---------- */
.is-style-qiyas-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
	box-shadow: 0 1px 2px rgba(23, 42, 58, .04);
	transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
	position: relative;
	overflow: hidden;
}

.is-style-qiyas-card:hover {
	transform: translateY(-3px);
	border-color: var(--line-strong);
	box-shadow: var(--shadow);
}

/* ---------- الأزرار ---------- */
.wp-block-button__link {
	transition: transform .18s ease, box-shadow .25s ease, background .2s ease;
	box-shadow: var(--amber-glow);
	white-space: nowrap;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 0 0 1px rgba(255, 179, 71, .5), 0 20px 50px -14px rgba(255, 138, 71, .6);
}

.is-style-qiyas-ghost .wp-block-button__link {
	background: transparent;
	background-image: none;
	color: var(--ink);
	border: 1px solid var(--line-strong);
	box-shadow: none;
}

.is-style-qiyas-ghost .wp-block-button__link:hover {
	border-color: var(--amber-1);
	color: var(--amber-1);
	box-shadow: none;
}

/* ---------- المحتوى ---------- */
.qp-content :where(p, ul, ol) {
	color: var(--ink-soft);
}

.qp-content :where(h2, h3) {
	margin-top: 2em;
	margin-bottom: .6em;
	color: var(--ink);
}

.qp-content :where(ul, ol) {
	padding-right: 1.4em;
}

.qp-content li {
	margin-bottom: .5em;
}

.qp-content a:not(.wp-block-button__link) {
	color: var(--amber-2);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/* الصور: تمنع القفز عند التحميل — CLS */
.qp-content img,
.wp-block-post-featured-image img {
	border-radius: var(--radius-sm);
	height: auto;
}

/* الجداول تنزلق داخل حاويتها بدل كسر الصفحة */
.wp-block-table {
	overflow-x: auto;
}

.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table :where(th, td) {
	border: 1px solid var(--line);
	padding: 12px 14px;
	text-align: right;
}

.wp-block-table th {
	background: var(--surface-2);
	font-family: var(--f-display);
	font-weight: 700;
}

/* ---------- بطاقات المقالات ---------- */
.qp-post-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform .22s ease, box-shadow .22s ease;
	height: 100%;
}

.qp-post-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}

.qp-post-card .wp-block-post-title {
	font-size: 1.15rem;
	line-height: 1.45;
}

.qp-post-card .wp-block-post-excerpt {
	color: var(--muted);
	font-size: .94rem;
}

/* ---------- التذييل ---------- */
.qp-footer {
	border-top: 1px solid var(--line);
	background: var(--bg-2);
	padding: 64px 0 32px;
	margin-top: 40px;
}

.qp-footer h4,
.qp-footer .wp-block-heading {
	font-size: 1rem;
	margin-bottom: 18px;
	color: var(--ink);
}

.qp-footer .wp-block-navigation {
	font-size: .94rem;
}

.qp-footer .wp-block-navigation a {
	color: var(--muted);
}

.qp-footer .wp-block-navigation a:hover {
	color: var(--amber-1);
}

/* ---------- الأسئلة الشائعة ---------- */
.wp-block-details {
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	margin-bottom: 14px;
	background: var(--surface);
	padding: 18px 22px;
}

.wp-block-details summary {
	font-family: var(--f-display);
	font-weight: 700;
	cursor: pointer;
	color: var(--ink);
}

.wp-block-details[open] summary {
	margin-bottom: 12px;
	color: var(--amber-2);
}

/* ---------- فتات الخبز ---------- */
.qp-breadcrumb {
	font-size: .88rem;
	color: var(--muted);
	padding: 18px 0;
}

.qp-breadcrumb a {
	color: var(--muted);
}

.qp-breadcrumb a:hover {
	color: var(--amber-2);
}

/* ---------- احترام تفضيل تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* ---------- الجوال ---------- */
@media (max-width: 781px) {
	.qp-footer {
		padding: 48px 0 24px;
	}
}

/* ==========================================================
   الترويسة والتذييل — تخطيط صريح (بديل wp:navigation)
   ========================================================== */
.qp-nav-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 14px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.qp-nav-links {
	display: flex;
	align-items: center;
	gap: 22px;
	font-weight: 500;
	font-size: .95rem;
}

.qp-nav-links a {
	color: var(--ink-soft);
	transition: color .16s;
}

.qp-nav-links a:hover {
	color: var(--amber-2);
}

.qp-nav-cta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.qp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-weight: 600;
	font-size: .95rem;
	padding: 11px 22px;
	border-radius: 100px;
	white-space: nowrap;
	transition: transform .18s ease, box-shadow .25s ease;
}

.qp-btn-primary {
	background: linear-gradient(100deg, var(--amber-1), var(--amber-2));
	color: #25160A;
	box-shadow: var(--amber-glow);
}

.qp-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 0 0 1px rgba(255, 179, 71, .5), 0 20px 50px -14px rgba(255, 138, 71, .6);
}

.qp-nav-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--ink);
	cursor: pointer;
	padding: 6px;
}

.qp-nav-toggle svg {
	width: 26px;
	height: 26px;
}

.qp-mobile-menu {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 24px 20px;
	border-top: 1px solid var(--line);
}

.qp-mobile-menu a {
	padding: 12px 8px;
	color: var(--ink-soft);
	font-weight: 500;
	border-radius: 10px;
}

.qp-mobile-menu a:hover {
	background: var(--surface-2);
	color: var(--amber-2);
}

.qp-mobile-menu .qp-btn-primary {
	margin-top: 8px;
	justify-content: center;
	color: #25160A;
}

@media (max-width: 900px) {
	.qp-nav-links,
	.qp-nav-cta .qp-btn-primary {
		display: none;
	}

	.qp-nav-toggle {
		display: inline-flex;
	}
}

@media (min-width: 901px) {
	.qp-mobile-menu {
		display: none !important;
	}
}

/* التذييل */
.qp-footer-grid {
	max-width: 1200px;
	margin: 0 auto 44px;
	padding: 0 24px;
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 40px;
}

.qp-footer-grid h4 {
	font-size: 1rem;
	margin-bottom: 18px;
	color: var(--ink);
}

.qp-footer-about {
	color: var(--muted);
	font-size: .94rem;
	max-width: 34ch;
	margin-top: 6px;
}

.qp-footer-links {
	line-height: 1;
}

.qp-footer-links li {
	margin-bottom: 11px;
}

.qp-footer-links a {
	color: var(--muted);
	font-size: .94rem;
	transition: color .16s;
}

.qp-footer-links a:hover {
	color: var(--amber-1);
}

.qp-footer-bottom {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 24px 0;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	color: var(--muted);
	font-size: .9rem;
}

@media (max-width: 781px) {
	.qp-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 28px;
	}
}

/* ==========================================================
   تنسيقات المقالات — صناديق، رسوم، إحصاءات، جدول محتويات
   ========================================================== */

/* فقرة افتتاحية بارزة (الإجابة المباشرة) */
.qp-answer {
	background: linear-gradient(180deg, var(--surface-2), var(--surface));
	border: 1px solid var(--line);
	border-right: 4px solid var(--amber-2);
	border-radius: var(--radius-sm);
	padding: 20px 24px;
	margin: 8px 0 32px;
	font-size: 1.08rem;
	line-height: 1.9;
	color: var(--ink);
}

.qp-answer strong { color: var(--amber-2); }

/* صناديق التنبيه */
.qp-callout {
	display: flex;
	gap: 14px;
	padding: 18px 20px;
	border-radius: var(--radius-sm);
	margin: 26px 0;
	border: 1px solid var(--line);
	background: var(--surface);
	font-size: .98rem;
	line-height: 1.85;
}

.qp-callout .qp-callout-ic {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: grid;
	place-items: center;
	color: #fff;
}

.qp-callout.tip .qp-callout-ic { background: var(--mint); }
.qp-callout.info .qp-callout-ic { background: var(--amber-2); }
.qp-callout.warn .qp-callout-ic { background: var(--rose); }
.qp-callout p { margin: 0; }
.qp-callout b { color: var(--ink); }

/* صندوق الخلاصة السريعة */
.qp-takeaway {
	background: var(--ink);
	color: var(--bg);
	border-radius: var(--radius);
	padding: 26px 28px;
	margin: 34px 0;
}

.qp-takeaway h4 {
	color: var(--amber-1);
	margin-bottom: 14px;
	font-size: 1.05rem;
}

.qp-takeaway ul { padding: 0; margin: 0; }

.qp-takeaway li {
	position: relative;
	padding-right: 26px;
	margin-bottom: 10px;
	color: #E8EEF2;
}

.qp-takeaway li::before {
	content: "";
	position: absolute;
	right: 0;
	top: 9px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--amber-1);
}

/* حاوية الرسوم */
.qp-figure {
	margin: 30px 0;
	padding: 26px 22px 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-align: center;
	overflow-x: auto;
}

.qp-figure svg { max-width: 100%; height: auto; }

.qp-figure figcaption {
	margin-top: 14px;
	font-size: .86rem;
	color: var(--muted);
}

/* صف إحصاءات */
.qp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 16px;
	margin: 30px 0;
}

.qp-stat {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 22px 18px;
	text-align: center;
}

.qp-stat .num {
	font-family: var(--f-display);
	font-weight: 900;
	font-size: 2.2rem;
	line-height: 1;
	background: linear-gradient(100deg, var(--amber-1), var(--amber-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.qp-stat .lbl {
	margin-top: 8px;
	font-size: .9rem;
	color: var(--muted);
}

/* جدول محتويات */
.qp-toc {
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 20px 24px;
	margin: 0 0 32px;
}

.qp-toc strong {
	display: block;
	margin-bottom: 12px;
	font-family: var(--f-display);
	color: var(--ink);
}

.qp-toc ol { margin: 0; padding-right: 20px; }
.qp-toc li { margin-bottom: 7px; }
.qp-toc a { color: var(--ink-soft); text-decoration: none; }
.qp-toc a:hover { color: var(--amber-2); }

/* اقتباس بارز */
.qp-content blockquote {
	border-right: 3px solid var(--amber-1);
	padding: 6px 22px;
	margin: 26px 0;
	color: var(--ink-soft);
	font-size: 1.1rem;
}

/* بطاقة الكاتب */
.qp-author {
	display: flex;
	gap: 16px;
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 22px;
	margin: 40px 0 0;
}

.qp-author .av {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--amber-1), var(--amber-2));
	display: grid;
	place-items: center;
	color: #fff;
	font-family: var(--f-display);
	font-weight: 900;
	font-size: 1.4rem;
	flex: none;
}

.qp-author .nm { font-family: var(--f-display); font-weight: 700; color: var(--ink); }
.qp-author .ro { font-size: .88rem; color: var(--muted); margin-top: 2px; }

/* مكوّنات المحتوى v2 */
.qp-def {
	display: block;
	background: var(--surface);
	border: 1px solid var(--line);
	border-right: 4px solid var(--mint);
	border-radius: var(--radius-sm);
	padding: 18px 22px;
	margin: 24px 0;
}
.qp-def-term {
	display: block;
	font-family: var(--f-display);
	font-weight: 800;
	color: var(--mint-dim);
	margin-bottom: 6px;
	font-size: 1.05rem;
}
.qp-def-body { color: var(--ink-soft); line-height: 1.9; }

.qp-example {
	background: var(--surface-2);
	border: 1px dashed var(--line-strong);
	border-radius: var(--radius-sm);
	padding: 18px 22px;
	margin: 24px 0;
}
.qp-example-lbl {
	display: inline-block;
	font-family: var(--f-display);
	font-weight: 700;
	font-size: .82rem;
	color: var(--amber-2);
	background: rgba(239,123,46,.1);
	padding: 3px 12px;
	border-radius: 100px;
	margin-bottom: 10px;
}

.qp-checklist { list-style: none; padding: 0; margin: 22px 0; }
.qp-checklist li {
	position: relative;
	padding-right: 32px;
	margin-bottom: 12px;
	color: var(--ink-soft);
	line-height: 1.8;
}
.qp-checklist li::before {
	content: "✓";
	position: absolute;
	right: 0;
	top: 0;
	width: 22px;
	height: 22px;
	background: var(--mint);
	color: #fff;
	border-radius: 6px;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 700;
}
