/* ========== Public Blog — CompiShop ========== */
.blog-page {
	--blog-accent: #0d9488;
	--blog-accent-soft: rgba(13, 148, 136, 0.12);
	--blog-surface: #ffffff;
	--blog-text: var(--site-text, #0f172a);
	--blog-muted: var(--site-text-muted, #64748b);
	--blog-border: var(--site-border, #e2e8f0);
	--blog-hero: linear-gradient(135deg, #ffffff 0%, #f0fdfa 50%, #ecfdf5 100%);
	--blog-h1: var(--brand-primary-dark, #620890);
	--blog-h23: var(--brand-primary, #720ba1);
	--blog-h45: var(--brand-primary-deep, #520878);
}

html[data-theme="dark"] .blog-page {
	--blog-accent: #2dd4bf;
	--blog-accent-soft: rgba(45, 212, 191, 0.16);
	--blog-surface: var(--site-bg-card, #1e293b);
	--blog-text: var(--site-text, #f1f5f9);
	--blog-muted: var(--site-text-muted, #94a3b8);
	--blog-border: var(--site-border, #334155);
	--blog-hero: linear-gradient(135deg, #1e293b 0%, #134e4a 52%, #0f172a 100%);
	--blog-h1: var(--brand-primary, #a85fc0);
	--blog-h23: var(--color-purple-300, #c99ad6);
	--blog-h45: var(--color-purple-400, #a85fc0);
}

/* هم‌راستا با صفحه اصلی / بازارچه / فروشگاه‌ها */
.blog-shell {
	position: relative;
	min-height: 100vh;
	padding-bottom: max(5.5rem, env(safe-area-inset-bottom));
	overflow-x: hidden;
}
@media (min-width: 64rem) {
	.blog-shell { padding-bottom: 2.5rem; }
}

.blog-container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 100rem;
	margin-inline: auto;
	padding-inline: 1rem;
}
@media (min-width: 40rem) {
	.blog-container { padding-inline: 1.5rem; }
}
@media (min-width: 48rem) {
	.blog-container { padding-inline: 2.5rem; }
}
@media (min-width: 64rem) {
	.blog-container { padding-inline: 3rem; }
}
@media (min-width: 80rem) {
	.blog-container { padding-inline: 4rem; }
}

.blog-top {
	width: 100%;
}

/* موبایل: هدر بالای سایت لازم نیست — منوی اپ پایین کافی است */
@media (max-width: 63.99rem) {
	.blog-page .blog-top {
		display: none !important;
	}
	.blog-page .blog-main {
		padding-top: 0.75rem;
	}
}

.blog-page .home-nav-shell {
	background: rgba(255, 255, 255, 0.95);
}
html[data-theme="dark"] .blog-page .home-nav-shell {
	background: rgba(30, 41, 59, 0.95);
	border-color: #334155;
}
html[data-theme="dark"] .blog-page .home-nav-brand,
html[data-theme="dark"] .blog-page .home-nav-link-idle {
	color: #e2e8f0;
}
html[data-theme="dark"] .blog-page .home-nav-shell .home-nav-link.bg-violet-100 {
	background: rgba(255, 255, 255, 0.95) !important;
	color: #620890 !important;
}
html[data-theme="dark"] .blog-page .home-nav-cta {
	background: rgba(30, 41, 59, 0.95) !important;
	border: 1px solid rgba(71, 85, 105, 0.65);
}
html[data-theme="dark"] .blog-page .theme-toggle-btn {
	background: rgba(51, 65, 85, 0.85);
	color: #e2e8f0;
}

.blog-main {
	width: 100%;
	padding: 1.25rem 0 2rem;
}
@media (min-width: 640px) {
	.blog-main { padding: 1.75rem 0 2.5rem; }
}

/* مقاله راست + ستون کناری چپ (در RTL ستون اول سمت راست است) */
.blog-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
	width: 100%;
}
@media (min-width: 64rem) {
	.blog-post-layout {
		grid-template-columns: minmax(0, 1fr) 19.5rem;
		gap: 1.5rem;
	}
}
@media (min-width: 80rem) {
	.blog-post-layout {
		grid-template-columns: minmax(0, 1fr) 22rem;
		gap: 1.75rem;
	}
}

.blog-article {
	width: 100%;
	max-width: none;
	margin-inline: 0;
	background: var(--blog-surface);
	border: 1px solid var(--blog-border);
	border-radius: 1.5rem;
	padding: 1.35rem 1.15rem 1.75rem;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}
@media (min-width: 640px) {
	.blog-article { padding: 1.85rem 2rem 2.25rem; }
}
@media (min-width: 80rem) {
	.blog-article { padding: 2.1rem 2.35rem 2.5rem; }
}
.blog-article__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
}
.blog-article__content {
	margin-top: 0.25rem;
	max-width: 100%;
	overflow-x: auto;
}

/* ستون کناری */
.blog-aside {
	width: 100%;
	min-width: 0;
}
.blog-aside__inner {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}
@media (min-width: 64rem) {
	.blog-aside__inner {
		position: sticky;
		top: 1rem;
	}
}

.blog-aside__ads {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.blog-aside-widget {
	background: var(--blog-surface);
	border: 1px solid var(--blog-border);
	border-radius: 1.25rem;
	padding: 1rem 1.05rem 1.1rem;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.blog-aside-widget__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}
.blog-aside-widget__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 800;
	color: var(--blog-text);
}
.blog-aside-widget__more {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--blog-accent);
	text-decoration: none;
}
.blog-aside-widget__text {
	margin: 0.35rem 0 0.85rem;
	font-size: 0.8125rem;
	line-height: 1.65;
	color: var(--blog-muted);
}
.blog-aside-widget__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.35rem;
	padding: 0.45rem 1rem;
	border-radius: 999px;
	background: var(--blog-accent);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 800;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.blog-aside-widget__btn:hover { filter: brightness(1.05); }

.blog-aside-stores {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}
.blog-aside-store {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.55rem 0.6rem;
	border-radius: 0.95rem;
	border: 1px solid transparent;
	background: color-mix(in srgb, var(--blog-accent) 6%, var(--blog-surface));
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.blog-aside-store:hover {
	border-color: color-mix(in srgb, var(--blog-accent) 35%, var(--blog-border));
	background: color-mix(in srgb, var(--blog-accent) 10%, var(--blog-surface));
}
.blog-aside-store__logo {
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 0.85rem;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--blog-border);
}
.blog-aside-store__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.blog-aside-store__logo-fallback {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--blog-accent-soft), transparent);
}
.blog-aside-store__body {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.blog-aside-store__name {
	font-size: 0.875rem;
	font-weight: 800;
	color: var(--blog-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.blog-aside-store__meta {
	font-size: 0.72rem;
	color: var(--blog-muted);
	font-weight: 600;
}
.blog-aside-store__go {
	flex-shrink: 0;
	font-size: 0.85rem;
	color: var(--blog-accent);
	font-weight: 800;
}

/* باکس تبلیغ — هم‌سبک بازارچه */
.blog-aside .home-feed-ad-slot {
	width: 100%;
	border-radius: 1.25rem;
	overflow: hidden;
	background: var(--blog-surface);
	border: 1px solid var(--blog-border);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.blog-aside .home-feed-ad-slot__link {
	display: block;
	line-height: 0;
}
.blog-aside .home-feed-ad-slot__img {
	display: block;
	width: 100%;
	height: auto;
}

.blog-hero {
	border-radius: 1.5rem;
	background: var(--blog-hero);
	border: 1px solid color-mix(in srgb, var(--blog-border) 80%, transparent);
	padding: 1.75rem 1.35rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}
@media (min-width: 640px) {
	.blog-hero { padding: 2.25rem 2rem; }
}
.blog-hero__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--blog-accent);
}
.blog-hero__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--blog-h1);
	letter-spacing: -0.02em;
	line-height: 1.35;
}
@media (min-width: 640px) {
	.blog-hero__title { font-size: 1.65rem; }
}
@media (min-width: 1024px) {
	.blog-hero__title { font-size: 1.85rem; }
}
.blog-hero__sub {
	margin: 0.5rem 0 0;
	color: var(--blog-muted);
	font-size: 0.875rem;
}
@media (min-width: 640px) {
	.blog-hero__sub { font-size: 0.95rem; }
}

.blog-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.35rem;
}
.blog-cats__chip {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0.4rem 0.95rem;
	border-radius: 999px;
	border: 1px solid var(--blog-border);
	background: var(--blog-surface);
	color: var(--blog-muted);
	font-size: 0.8125rem;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.blog-cats__chip:hover,
.blog-cats__chip.is-active {
	background: var(--blog-accent);
	border-color: transparent;
	color: #fff;
}

.blog-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.15rem;
}
@media (min-width: 640px) {
	.blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.blog-grid { grid-template-columns: repeat(3, 1fr); }
}
.blog-grid--compact {
	grid-template-columns: 1fr;
}
@media (min-width: 640px) {
	.blog-grid--compact { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
	display: flex;
	flex-direction: column;
	background: var(--blog-surface);
	border: 1px solid var(--blog-border);
	border-radius: 1.25rem;
	overflow: hidden;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.blog-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.blog-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: color-mix(in srgb, var(--blog-accent) 8%, var(--blog-surface));
	overflow: hidden;
}
.blog-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.blog-card__media-fallback {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--blog-accent-soft), transparent);
}
.blog-card__body {
	padding: 1rem 1.1rem 1.15rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	flex: 1;
}
.blog-card__cat {
	display: inline-flex;
	align-self: flex-start;
	font-size: 0.72rem;
	font-weight: 800;
	color: var(--blog-accent);
	background: var(--blog-accent-soft);
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	text-decoration: none;
}
.blog-card__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1.45;
	color: var(--blog-text);
}
@media (min-width: 640px) {
	.blog-card__title { font-size: 1.05rem; }
}
.blog-card__title a {
	color: inherit;
	text-decoration: none;
}
.blog-card__title a:hover { color: var(--blog-accent); }
.blog-card__excerpt {
	margin: 0;
	font-size: 0.875rem;
	color: var(--blog-muted);
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.blog-card__meta {
	margin-top: auto;
	padding-top: 0.65rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.75rem;
	color: var(--blog-muted);
}
.blog-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	font-weight: 800;
	font-size: 0.75rem;
	color: var(--blog-accent);
	text-decoration: none;
	background: color-mix(in srgb, var(--blog-accent) 10%, transparent);
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.blog-card__more::after {
	content: '←';
	font-size: 0.85em;
}
.blog-card__more:hover {
	background: color-mix(in srgb, var(--blog-accent) 18%, transparent);
	transform: translateX(-2px);
}

.blog-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 1rem;
	color: var(--blog-muted);
}
.blog-empty--page h1 {
	margin: 0 0 0.5rem;
	color: var(--blog-text);
	font-size: 1.5rem;
}

.blog-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin-top: 1.75rem;
}
.blog-pager__link {
	min-width: 2.35rem;
	height: 2.35rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.75rem;
	border: 1px solid var(--blog-border);
	background: var(--blog-surface);
	color: var(--blog-muted);
	font-weight: 700;
	text-decoration: none;
	font-size: 0.85rem;
}
.blog-pager__link.is-active,
.blog-pager__link:hover {
	background: var(--blog-accent);
	border-color: transparent;
	color: #fff;
}

.blog-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--blog-accent) 28%, var(--blog-border));
	background: linear-gradient(135deg, color-mix(in srgb, var(--blog-accent) 14%, #fff), var(--blog-surface));
	color: var(--blog-accent);
	font-weight: 800;
	font-size: 0.8125rem;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
	margin-inline-start: auto;
}
html[data-theme="dark"] .blog-back {
	background: linear-gradient(135deg, color-mix(in srgb, var(--blog-accent) 18%, var(--blog-surface)), var(--blog-surface));
	box-shadow: none;
}
.blog-back__icon {
	display: inline-flex;
	width: 1.15rem;
	height: 1.15rem;
	flex-shrink: 0;
}
.blog-back__icon svg {
	width: 100%;
	height: 100%;
}
.blog-article__nav {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.65rem;
	margin-bottom: 1.15rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--blog-border);
}
.blog-article__nav .blog-back {
	align-self: flex-end; /* سمت چپ در RTL */
	margin-inline-start: 0;
}
.blog-article__dates {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem 0.65rem;
	margin: 0;
	min-width: 0;
	width: 100%;
}
.blog-article__cat {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 0.7rem;
	font-weight: 800;
	line-height: 1.25;
	color: var(--blog-accent);
	background: color-mix(in srgb, var(--blog-accent) 8%, transparent);
	border: 1px solid color-mix(in srgb, var(--blog-accent) 22%, transparent);
	padding: 0.12rem 0.45rem;
	border-radius: 999px;
	text-decoration: none;
}
.blog-article__title {
	margin: 0.65rem 0 0;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--blog-h1);
	letter-spacing: -0.02em;
	line-height: 1.35;
}
@media (min-width: 640px) {
	.blog-article__title { font-size: 1.6rem; }
}
@media (min-width: 1024px) {
	.blog-article__title { font-size: 1.75rem; }
}
.blog-article__lead {
	margin: 0.85rem 0 0;
	font-size: 0.9rem;
	color: var(--blog-muted);
	line-height: 1.7;
}
@media (min-width: 640px) {
	.blog-article__lead { font-size: 1rem; }
}
.blog-article__date {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	font-size: 0.68rem;
	color: var(--blog-muted);
	font-weight: 600;
	white-space: nowrap;
}
@media (min-width: 640px) {
	.blog-article__date { font-size: 0.75rem; }
}
.blog-article__date time {
	font-variant-numeric: tabular-nums;
}
.blog-article__date-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.1rem 0.35rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--blog-accent) 10%, transparent);
	color: var(--blog-accent);
	font-size: 0.62rem;
	font-weight: 800;
	line-height: 1.2;
}
.blog-article__date--updated .blog-article__date-label {
	background: color-mix(in srgb, var(--blog-h45) 12%, transparent);
	color: var(--blog-h45);
}
.blog-article__cover {
	margin: 1.35rem 0;
	border-radius: 1.25rem;
	overflow: hidden;
	border: 1px solid var(--blog-border);
}
.blog-article__cover img {
	width: 100%;
	display: block;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.prose-blog {
	color: var(--blog-text);
	font-size: 0.9375rem;
	line-height: 2.05;
	overflow-wrap: anywhere;
	word-break: break-word;
}
@media (min-width: 640px) {
	.prose-blog {
		font-size: 1rem;
		line-height: 2.15;
	}
}
.prose-blog h1,
.prose-blog h2,
.prose-blog h3,
.prose-blog h4,
.prose-blog h5,
.prose-blog h6 {
	margin: 1.25rem 0 0.55rem;
	font-weight: 800;
	line-height: 1.35;
}
@media (min-width: 640px) {
	.prose-blog h1,
	.prose-blog h2,
	.prose-blog h3,
	.prose-blog h4,
	.prose-blog h5,
	.prose-blog h6 {
		margin: 1.5rem 0 0.65rem;
	}
}
.prose-blog h1 {
	font-size: 1.25rem;
	color: var(--blog-h1);
}
.prose-blog h2,
.prose-blog h3 {
	font-size: 1.1rem;
	color: var(--blog-h23);
}
.prose-blog h3 {
	font-size: 1.05rem;
}
.prose-blog h4,
.prose-blog h5,
.prose-blog h6 {
	font-size: 0.98rem;
	color: var(--blog-h45);
}
.prose-blog h5 {
	font-size: 0.95rem;
}
.prose-blog h6 {
	font-size: 0.9rem;
	opacity: 0.92;
}
@media (min-width: 640px) {
	.prose-blog h1 { font-size: 1.45rem; }
	.prose-blog h2 { font-size: 1.25rem; }
	.prose-blog h3 { font-size: 1.15rem; }
	.prose-blog h4 { font-size: 1.05rem; }
	.prose-blog h5 { font-size: 1rem; }
	.prose-blog h6 { font-size: 0.95rem; }
}
.prose-blog p { margin: 0 0 1rem; }
.prose-blog a { color: var(--blog-accent); }
.prose-blog ul,
.prose-blog ol {
	margin: 0 0 1rem;
	padding-inline-start: 1.35rem;
}
.prose-blog blockquote {
	margin: 1.25rem 0;
	padding: 0.85rem 1rem;
	border-inline-start: 3px solid var(--blog-accent);
	background: var(--blog-accent-soft);
	border-radius: 0 0.85rem 0.85rem 0;
	color: var(--blog-muted);
}
.prose-blog img,
.prose-blog video,
.prose-blog iframe {
	max-width: 100%;
	height: auto;
	border-radius: 0.85rem;
	margin: 1rem 0;
}
.prose-blog table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 0.9rem;
}
.prose-blog th,
.prose-blog td {
	border: 1px solid var(--blog-border);
	padding: 0.55rem 0.7rem;
}
.prose-blog pre,
.prose-blog code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	direction: ltr;
	unicode-bidi: plaintext;
}
.prose-blog pre {
	background: #0f172a;
	color: #e2e8f0;
	padding: 1rem;
	border-radius: 0.85rem;
	overflow-x: auto;
	margin: 1rem 0;
}
html[data-theme="dark"] .prose-blog pre {
	background: #020617;
}

.blog-related {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--blog-border);
}
.blog-related__title {
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 800;
	color: var(--blog-h23);
}
@media (min-width: 640px) {
	.blog-related__title { font-size: 1.1rem; }
}
