/* =========================================================
   تنسيق نص التدوينات — واضح وبسيط
   يُستخدم في الموقع وفي محرر لوحة التحكم (نفس الشكل بالضبط)
   ========================================================= */

.post-content{
	--c-ink: var(--ink, #16181d);
	--c-soft: var(--ink-soft, #565c66);
	--c-alt: var(--paper-alt, #f4f4f2);
	--c-line: var(--line, #e6e6e2);
	--c-blue: var(--blue, #0057b8);
	--c-coral: var(--coral, #ff3e42);
	font-family: var(--font-read, var(--font, system-ui, sans-serif));
	font-size: 1.15rem;
	line-height: 1.95;
	letter-spacing: 0;
	color: var(--c-ink);
	overflow-wrap: break-word;
}
.post-content > *{ margin-block: 0 1.15em; }
.post-content > *:last-child{ margin-bottom: 0; }

/* الفقرات */
.post-content p{ line-height: 1.95; text-wrap: pretty; }
.post-content strong, .post-content b{ font-weight: 700; color: var(--c-ink); }

/* العناوين داخل التدوينة */
.post-content h2, .post-content h3, .post-content h4{
	line-height: 1.45; text-wrap: balance; color: var(--c-ink); font-weight: 800;
}
.post-content h2{ font-size: 1.5rem; margin: 1.9em 0 .55em; padding-bottom: .3em; border-bottom: 1px solid var(--c-line); }
.post-content h3{ font-size: 1.24rem; margin: 1.6em 0 .45em; }
.post-content h4{ font-size: 1.08rem; margin: 1.4em 0 .4em; }
.post-content h2::before{ display: none; }
.post-content h3::before{
	content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: middle;
	background: linear-gradient(135deg, var(--c-coral), var(--c-blue)); margin-inline-end: 10px; position: relative; top: -2px;
}
.post-content > h2:first-child, .post-content > h3:first-child{ margin-top: 0; }

/* الروابط */
/* (ما نلمس روابط الأجزاء المصممة خصيصًا مثل صفحة راسلني) */
.post-content a:not(.post-content [class*="contact"] a){
	color: var(--c-blue); text-decoration: underline; text-decoration-thickness: 1px;
	text-decoration-color: color-mix(in srgb, var(--c-blue) 40%, transparent); text-underline-offset: 4px;
}
.post-content a:not(.post-content [class*="contact"] a):hover{ text-decoration-color: currentColor; }

/* القوائم */
.post-content ul, .post-content ol{ padding-inline-start: 1.5em; }
.post-content li{ margin-block: .35em; line-height: 1.85; padding-inline-start: .2em; }
.post-content li::marker{ color: var(--c-coral); font-weight: 700; }
.post-content li > ul, .post-content li > ol{ margin-block: .3em; }

/* الاقتباس */
.post-content blockquote{
	margin: 1.6em 0; padding: .9em 1.3em; font-size: 1.05em; color: var(--c-ink);
	border: 0; border-inline-start: 4px solid var(--c-coral); background: var(--c-alt);
	border-radius: 0 12px 12px 0;
}
.post-content blockquote > *{ margin: 0 0 .5em; }
.post-content blockquote > *:last-child{ margin-bottom: 0; }

/* صندوق ملاحظة */
.post-content .note{
	margin: 1.6em 0; padding: 1em 1.2em; border-radius: 12px;
	background: color-mix(in srgb, var(--c-blue) 7%, transparent);
	border: 1px solid color-mix(in srgb, var(--c-blue) 22%, transparent);
}
.post-content .note::before{ content: "💡"; margin-inline-end: 8px; }

/* تمييز نص */
.post-content mark{ background: color-mix(in srgb, #ffd54a 55%, transparent); color: inherit; padding: 0 .15em; border-radius: 3px; }

/* فاصل */
.post-content hr{
	border: 0; height: auto; width: auto; margin: 2.2em auto; background: none; opacity: 1;
	text-align: center; color: var(--c-soft); letter-spacing: .6em; font-size: 1rem; line-height: 1;
}
.post-content hr::before{ content: "• • •"; }

/* الصور */
.post-content img{ display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: 14px; }
.post-content figure{ margin: 1.6em auto; text-align: center; max-width: 100%; }
.post-content figure img{ margin-inline: auto; }
.post-content figcaption, .post-content .wp-caption-text{
	font-size: .85rem; color: var(--c-soft); text-align: center; margin-top: .6em; line-height: 1.6;
}
.post-content .wp-caption{ max-width: 100% !important; margin-inline: auto; }
.post-content p > img:only-child, .post-content p > a:only-child > img{ margin-block: .4em; }
/* الصور الجانبية القديمة: على الجوال تصير بالنص */
@media (max-width: 640px){
	.post-content .alignleft, .post-content .alignright{ float: none; margin-inline: auto; }
}

/* الكود والأوامر */
.post-content code{
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em;
	background: var(--c-alt); border: 1px solid var(--c-line); padding: .1em .45em; border-radius: 6px;
	direction: ltr; unicode-bidi: isolate;
}
.post-content code.cmd{ display: block; width: fit-content; max-width: 100%; overflow-x: auto; white-space: pre; margin: .5em 0 .5em auto; padding: .45em .8em; text-align: left; }
.post-content pre{ direction: ltr; text-align: left; background: #1d2029; color: #e9ecf2; padding: 1em 1.2em; border-radius: 12px; overflow-x: auto; font-size: .9rem; line-height: 1.7; }
.post-content pre code{ background: none; border: 0; padding: 0; color: inherit; }

/* الجداول */
.post-content table{ width: 100%; border-collapse: collapse; font-size: .95em; display: block; overflow-x: auto; }
.post-content th, .post-content td{ border: 1px solid var(--c-line); padding: .55em .8em; text-align: start; }
.post-content th{ background: var(--c-alt); font-weight: 700; }

/* فيديو */
.post-content iframe{ max-width: 100%; }
.post-content .video-embed iframe{ width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 14px; }

@media (max-width: 600px){
	.post-content{ font-size: 1.07rem; line-height: 1.9; }
	.post-content h2{ font-size: 1.32rem; }
	.post-content h3{ font-size: 1.15rem; }
}

/* الصور داخل التدوينة: بحد أقصى متوسط وبالنص */
.post-content img{ max-width: min(100%, 620px); max-height: 560px; width: auto; object-fit: contain; }
.post-content figure img, .post-content .wp-caption img{ max-width: min(100%, 620px); }
.post-content .gallery img, .post-content .gallery-item img{ max-width: 100%; max-height: none; width: 100%; }
.post-content img.size-thumbnail, .post-content img.attachment-thumbnail{ max-width: min(100%, 220px); display: inline-block; margin: .3em; }
