/* Blog Content Styles - Optimized for Persian/RTL */ /* Base typography */ .blog-content { font-size: 1.0625rem; /* 17px - کمی کوچک‌تر */ line-height: 1.75; /* خط‌فاصله متعادل‌تر */ letter-spacing: 0.01em; color: rgb(55, 65, 81); max-width: 70ch; /* کمی باریک‌تر برای خوانایی بهتر */ overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; } .dark .blog-content { color: rgb(229, 231, 235); } /* RTL-specific improvements */ .blog-content-rtl { line-height: 1.9 !important; /* فارسی نیاز به فاصله بیشتری داره ولی نه خیلی زیاد */ letter-spacing: 0.015em !important; font-size: 1.0625rem; } /* Force LTR for code blocks in RTL */ .blog-content-rtl pre, .blog-content-rtl code { direction: ltr; text-align: left; } /* Headings */ .blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 { scroll-margin-top: 2.5rem; } .blog-content h1 { margin-top: 2.5rem; margin-bottom: 1.5rem; line-height: 1.3; font-weight: 700; font-size: 2em; color: rgb(17, 24, 39); } .dark .blog-content h1 { color: rgb(243, 244, 246); } .blog-content h2 { margin-top: 2.5rem; margin-bottom: 1.25rem; line-height: 1.4; font-weight: 700; font-size: 1.75em; color: rgb(17, 24, 39); } .dark .blog-content h2 { color: rgb(243, 244, 246); } .blog-content h3 { margin-top: 2rem; margin-bottom: 1rem; line-height: 1.5; font-weight: 600; font-size: 1.375em; color: rgb(17, 24, 39); } .dark .blog-content h3 { color: rgb(243, 244, 246); } .blog-content h4 { margin-top: 1.75rem; margin-bottom: 0.875rem; line-height: 1.5; font-weight: 600; font-size: 1.125em; color: rgb(17, 24, 39); } .dark .blog-content h4 { color: rgb(243, 244, 246); } /* Paragraphs - فاصله متعادل */ .blog-content p { margin-top: 1.5rem; margin-bottom: 1.5rem; line-height: inherit; } /* First paragraph after heading */ .blog-content h1 + p, .blog-content h2 + p, .blog-content h3 + p, .blog-content h4 + p { margin-top: 1rem; } /* Lists */ .blog-content ul, .blog-content ol { margin-top: 1.5rem; margin-bottom: 1.5rem; padding-left: 2rem; } .blog-content-rtl ul, .blog-content-rtl ol { padding-left: 0; padding-right: 2rem; } /* Better bullet styling with custom bullets */ .blog-content ul { list-style: none; } .blog-content ul > li { position: relative; padding-left: 1.75rem; } .blog-content ul > li::before { content: "●"; position: absolute; left: 0.25rem; color: var(--ui-color-primary-500); font-size: 1.1em; font-weight: bold; line-height: 1.75; } .dark .blog-content ul > li::before { color: var(--ui-color-primary-400); } .blog-content-rtl ul > li { padding-left: 0; padding-right: 1.75rem; } .blog-content-rtl ul > li::before { left: auto; right: 0.25rem; } .blog-content li { margin-top: 0.75rem; margin-bottom: 0.75rem; line-height: 1.75; } .blog-content-rtl li { line-height: 1.9; } .blog-content li p { margin-top: 0.75rem; margin-bottom: 0.75rem; } /* Nested lists */ .blog-content ul ul, .blog-content ol ol, .blog-content ul ol, .blog-content ol ul { margin-top: 1rem; margin-bottom: 1rem; } /* Strong text */ .blog-content strong { font-weight: 700; color: rgb(17, 24, 39); } .dark .blog-content strong { color: rgb(243, 244, 246); } /* Highlighted key phrases - for emphasized sentences */ .blog-content em strong, .blog-content strong em { background-color: var(--ui-color-primary-50); border-left: 3px solid var(--ui-color-primary-500); padding: 0.25rem 0.75rem; border-radius: 0.375rem; display: inline-block; margin: 0.125rem 0; font-style: normal; } .dark .blog-content em strong, .dark .blog-content strong em { background-color: color-mix(in srgb, var(--ui-color-primary-950) 30%, transparent); border-left-color: var(--ui-color-primary-400); } .blog-content-rtl em strong, .blog-content-rtl strong em { border-left: none; border-right: 3px solid var(--ui-color-primary-500); } .dark .blog-content-rtl em strong, .dark .blog-content-rtl strong em { border-right-color: var(--ui-color-primary-400); } /* Code blocks */ .blog-content pre { margin-top: 2rem; margin-bottom: 2rem; line-height: 1.6; font-size: 0.875rem; overflow-x: auto; max-width: 100%; } @media (max-width: 1024px) { .blog-content pre { font-size: 0.875rem; } } /* Inline code */ .blog-content code:not(pre code) { padding: 0.25em 0.5em; background-color: var(--ui-color-primary-100); color: var(--ui-color-primary-700); border-radius: 0.375rem; font-size: 0.9em; font-weight: 500; } .dark .blog-content code:not(pre code) { background-color: color-mix(in srgb, var(--ui-color-primary-950) 40%, transparent); color: var(--ui-color-primary-300); } /* Blockquotes */ .blog-content blockquote { margin-top: 2rem; margin-bottom: 2rem; padding: 1.5rem; border-left: 4px solid var(--ui-color-primary-500); background-color: var(--ui-color-primary-50); border-radius: 0.75rem; font-style: italic; line-height: 1.75; } .dark .blog-content blockquote { border-left-color: var(--ui-color-primary-400); background-color: color-mix(in srgb, var(--ui-color-primary-950) 20%, transparent); } .blog-content-rtl blockquote { border-left: none; border-right: 4px solid var(--ui-color-primary-500); } .dark .blog-content-rtl blockquote { border-right-color: var(--ui-color-primary-400); } .blog-content blockquote p { margin-top: 1rem; margin-bottom: 1rem; } /* Links */ .blog-content a { color: var(--ui-color-primary-600); text-decoration: underline; text-decoration-color: var(--ui-color-primary-300); text-underline-offset: 0.25em; font-weight: 500; transition: all 0.2s ease; } .dark .blog-content a { color: var(--ui-color-primary-400); text-decoration-color: var(--ui-color-primary-600); } .blog-content a:hover { color: var(--ui-color-primary-700); text-decoration-color: var(--ui-color-primary-500); } .dark .blog-content a:hover { color: var(--ui-color-primary-300); text-decoration-color: var(--ui-color-primary-400); } /* Horizontal rule */ .blog-content hr { margin-top: 2.5rem; margin-bottom: 2.5rem; border-color: rgba(148, 163, 184, 0.3); } .dark .blog-content hr { border-color: rgba(71, 85, 105, 0.5); } /* Images */ .blog-content img { margin-top: 2rem; margin-bottom: 2rem; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); } /* Tables */ .blog-content table { margin-top: 2rem; margin-bottom: 2rem; width: 100%; border-collapse: collapse; font-size: 0.875rem; display: block; overflow-x: auto; max-width: 100%; } @media (max-width: 1024px) { .blog-content table { font-size: 0.875rem; } } .blog-content th, .blog-content td { padding: 0.875rem 1rem; border: 1px solid rgba(148, 163, 184, 0.3); line-height: 1.8; } .blog-content th { background-color: var(--ui-color-primary-100); color: rgb(17, 24, 39); font-weight: 600; } .dark .blog-content th { background-color: color-mix(in srgb, var(--ui-color-primary-950) 30%, transparent); color: rgb(243, 244, 246); } .dark .blog-content td { border-color: rgba(71, 85, 105, 0.4); } /* Images - prevent overflow */ .blog-content img { max-width: 100%; height: auto; } /* Prevent horizontal scroll on all elements */ .blog-content * { max-width: 100%; } .blog-content pre, .blog-content code, .blog-content table { max-width: 100%; } /* Responsive */ @media (max-width: 640px) { .blog-content { font-size: 1rem; } .blog-content h1 { font-size: 2em; } .blog-content h2 { font-size: 1.625em; } .blog-content h3 { font-size: 1.375em; } .blog-content pre { font-size: 0.8125rem; margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: 0; } }