/* =========================================================
   Nexora — المدوّنة وصفحة المقال
   يعتمد على التوكنات المعرَّفة في style.css
   ========================================================= */

/* الظهور التدريجي (نسخة مستقلة — home.css لا يُحمَّل هنا) */
.nx-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.nx-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.nx-reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   ترويسة المدوّنة
   ========================================================= */
.nx-blog-head {
	max-width: var(--container);
	margin-inline: auto;
	padding: clamp(48px, 6vw, 84px) 24px clamp(28px, 3.5vw, 48px);
	text-align: center;
}
/* نفس تعريف home.css — مكرَّر هنا لأن home.css لا يُحمَّل في المدوّنة */
.nx-label {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
	margin-bottom: 14px;
	letter-spacing: .01em;
}
.nx-blog-head h1 {
	font-size: clamp(32px, 4.6vw, 52px);
	font-weight: 700;
	line-height: 1.24;
	max-width: 16ch;
	margin: 0 auto 18px;
}
.nx-blog-head p {
	max-width: 56ch;
	margin: 0 auto;
	color: var(--ink-soft);
	font-size: 17px;
}

/* =========================================================
   المقال المميّز (أول بطاقة)
   ========================================================= */
.nx-blog-wrap { max-width: var(--container); margin-inline: auto; padding: 0 24px 96px; }

.nx-feat {
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	align-items: stretch;
	gap: 0;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	overflow: hidden;
	box-shadow: var(--shadow);
	margin-bottom: clamp(32px, 4vw, 56px);
	transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.nx-feat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.nx-feat__media { position: relative; overflow: hidden; background: var(--surface-muted); min-height: 340px; }
.nx-feat__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.nx-feat:hover .nx-feat__media img { transform: scale(1.04); }

.nx-feat__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 16px;
	padding: clamp(28px, 3.4vw, 52px);
}
.nx-feat__body h2 { font-size: clamp(24px, 2.7vw, 36px); font-weight: 700; line-height: 1.32; color: var(--ink); }
.nx-feat:hover .nx-feat__body h2 { color: var(--accent); }
.nx-feat__body p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.85; }

/* =========================================================
   شارات وميتا
   ========================================================= */
.nx-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--accent-soft);
	color: var(--accent-deep);
	border-radius: var(--radius-pill);
	padding: 6px 14px;
	font-size: 12.5px;
	font-weight: 700;
	flex: none;
}
.nx-badge--solid { background: var(--accent); color: var(--accent-ink); }

.nx-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	color: var(--ink-soft);
	font-size: 13.5px;
}
.nx-meta__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); flex: none; }

.nx-readmore {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 14.5px;
	color: var(--accent);
}
.nx-readmore svg { width: 16px; height: 16px; transition: transform .3s ease; }
.nx-feat:hover .nx-readmore svg,
.nx-card:hover .nx-readmore svg { transform: translateX(-4px); }

/* =========================================================
   شبكة البطاقات
   ========================================================= */
.nx-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(20px, 2.2vw, 30px);
	align-items: start;
}

.nx-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	overflow: hidden;
	box-shadow: var(--shadow);
	height: 100%;
	transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.nx-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.nx-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-muted); }
.nx-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.nx-card:hover .nx-card__media img { transform: scale(1.05); }

.nx-card__badge { position: absolute; inset-block-start: 14px; inset-inline-start: 14px; z-index: 2; }

.nx-card__body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 26px; flex: 1 0 auto; }
.nx-card__body h3 { font-size: 19.5px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.nx-card:hover .nx-card__body h3 { color: var(--accent); }
.nx-card__body p { margin: 0; color: var(--ink-soft); font-size: 14.8px; line-height: 1.8; }
.nx-card__foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* الرابط يغطي البطاقة كلها — أفضل مساحة نقر */
.nx-cover-link { position: absolute; inset: 0; z-index: 3; }
.nx-cover-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.nx-card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

/* حالة فارغة */
.nx-empty {
	max-width: 560px;
	margin: 0 auto;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	padding: 56px 32px;
	box-shadow: var(--shadow);
}
.nx-empty h2 { font-size: 24px; margin-bottom: 10px; }
.nx-empty p { color: var(--ink-soft); margin: 0 0 22px; }

/* =========================================================
   صفحة المقال
   ========================================================= */
.nx-article-head {
	max-width: 820px;
	margin-inline: auto;
	padding: clamp(40px, 5vw, 72px) 24px clamp(22px, 2.6vw, 34px);
	text-align: center;
}
.nx-article-head h1 {
	font-size: clamp(30px, 4.2vw, 50px);
	font-weight: 700;
	line-height: 1.26;
	margin: 16px 0 18px;
	color: var(--ink);
}
.nx-article-head .nx-meta { justify-content: center; }

/* شريط تقدّم القراءة */
.nx-progress {
	position: fixed;
	inset-block-start: 0;
	inset-inline: 0;
	height: 3px;
	background: transparent;
	z-index: 60;
	pointer-events: none;
}
.nx-progress__bar {
	height: 100%;
	width: 0;
	background: var(--accent);
	transform-origin: right center;
	transition: width .1s linear;
}

/* غلاف المقال */
.nx-article-cover {
	max-width: 1000px;
	margin: 0 auto clamp(30px, 3.6vw, 52px);
	padding-inline: 24px;
}
.nx-article-cover figure {
	margin: 0;
	border-radius: var(--radius-card);
	overflow: hidden;
	border: 1px solid var(--line);
	box-shadow: var(--shadow-lg);
	background: var(--surface-muted);
}
.nx-article-cover img { width: 100%; height: auto; }

/* نص المقال — يرث تنسيقات .entry-content من style.css */
.nx-article .entry-content { max-width: 68ch; padding-bottom: clamp(40px, 5vw, 72px); }

.nx-article .entry-content blockquote {
	margin: 2em 0;
	padding: 24px 28px;
	background: var(--accent-soft);
	border-inline-start: 4px solid var(--accent);
	border-radius: 18px;
	color: var(--ink);
	font-size: 17px;
	line-height: 1.9;
}
.nx-article .entry-content blockquote p:last-child { margin-bottom: 0; }

/* مشاركة */
.nx-share {
	max-width: 68ch;
	margin: 0 auto;
	padding: 0 24px clamp(48px, 6vw, 80px);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}
.nx-share__label { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.nx-share a, .nx-share button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px; height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.nx-share a:hover, .nx-share button:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	transform: translateY(-2px);
}
.nx-share svg { width: 18px; height: 18px; }
.nx-share__done { font-size: 13px; color: var(--accent); font-weight: 700; }

/* مقالات مرتبطة */
.nx-related {
	border-top: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.nx-related__inner { max-width: var(--container); margin-inline: auto; padding: clamp(48px, 6vw, 84px) 24px; }
.nx-related__head { margin-bottom: clamp(24px, 3vw, 40px); text-align: center; }
.nx-related__head h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; }

/* =========================================================
   استجابة
   ========================================================= */
@media (max-width: 1024px) {
	.nx-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
	.nx-feat { grid-template-columns: 1fr; }
	.nx-feat__media { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (max-width: 620px) {
	.nx-cards { grid-template-columns: 1fr; }
	.nx-blog-wrap { padding-inline: 20px; padding-bottom: 64px; }
	.nx-blog-head { padding-inline: 20px; }
	.nx-article-cover { padding-inline: 20px; }
	.nx-article .entry-content { padding-inline: 20px; }
	.nx-share { padding-inline: 20px; }
}
