/* «دانستنی‌ها» — articles page, topic archives, single article, homepage preview */
.sg-art-wrap,
.sg-home-articles {
	--art-ink: #2B2420;
	--art-muted: #6E655C;
	--art-line: #ECE6DB;
	--art-soft: #F8F7F4;
	--art-gold: #C9A227;
	--art-gold-d: #A88418;
	color: var(--art-ink);
}
.sg-art-wrap {
	max-width: 1160px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	box-sizing: border-box;
}
.sg-art-wrap *,
.sg-home-articles * { box-sizing: border-box; }

/* --- breadcrumbs --- */
.sg-art-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-bottom: 18px;
	font-size: 0.82rem;
	color: var(--art-muted);
}
.sg-art-crumbs a { color: var(--art-muted); text-decoration: none; }
.sg-art-crumbs a:hover { color: var(--art-gold-d); }

/* --- list header --- */
.sg-art-hero { max-width: 720px; margin: 8px 0 22px; }
.sg-art-hero__title {
	margin: 0 0 10px;
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	font-weight: 700;
	line-height: 1.5;
	color: var(--art-ink);
}
.sg-art-hero__intro,
.sg-art-hero__intro p {
	margin: 0;
	font-size: 1rem;
	line-height: 2;
	color: var(--art-muted);
}
.sg-art-hero__content { margin-top: 12px; line-height: 2; color: var(--art-muted); }

/* --- topic chips --- */
.sg-art-topics {
	display: flex;
	gap: 8px;
	margin: 0 -16px 24px;
	padding: 2px 16px 6px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.sg-art-topics::-webkit-scrollbar { display: none; }
.sg-art-chip {
	flex: none;
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--art-line);
	border-radius: 999px;
	background: #FFF;
	color: var(--art-ink);
	font-size: 0.9rem;
	text-decoration: none;
	transition: border-color 0.15s ease;
}
.sg-art-chip:hover { border-color: var(--art-gold); color: var(--art-ink); }
.sg-art-chip.is-current { background: var(--art-ink); border-color: var(--art-ink); color: #FFF; }

/* --- grid + card --- */
.sg-art-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}
.sg-art-card {
	display: flex;
	flex-direction: column;
	background: #FFF;
	border: 1px solid var(--art-line);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 0.2s ease;
}
.sg-art-card:hover { border-color: #DCCFB4; }
.sg-art-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--art-soft);
	overflow: hidden;
}
.sg-art-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.24s ease;
}
.sg-art-card:hover .sg-art-card__media img { transform: scale(1.02); }
.sg-art-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
}
.sg-art-card__placeholder img { width: 56px !important; height: 56px !important; opacity: 0.35; object-fit: contain; }
.sg-art-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	padding: 16px 18px 18px;
}
.sg-art-card__topic { font-size: 0.78rem; color: var(--art-gold-d); }
.sg-art-card__title {
	margin: 0;
	font-size: 1.06rem;
	font-weight: 700;
	line-height: 1.75;
}
.sg-art-card__title a { color: var(--art-ink); text-decoration: none; }
.sg-art-card__title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.sg-art-card { position: relative; }
.sg-art-card__title a:focus-visible { outline: 2px solid var(--art-gold); outline-offset: 2px; }
.sg-art-card__excerpt {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.95;
	color: var(--art-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sg-art-card__meta {
	margin: auto 0 0;
	padding-top: 6px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 0.78rem;
	color: var(--art-muted);
}

.sg-art-empty { padding: 48px 0; text-align: center; color: var(--art-muted); }

/* --- pagination --- */
.sg-art-pages {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 36px;
}
.sg-art-pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--art-line);
	border-radius: 8px;
	background: #FFF;
	color: var(--art-ink);
	text-decoration: none;
	font-size: 0.92rem;
}
.sg-art-pages .page-numbers.current { background: var(--art-ink); border-color: var(--art-ink); color: #FFF; }
.sg-art-pages .page-numbers.dots { border: 0; background: none; }

/* --- single article --- */
.sg-art-single { max-width: 820px; }
.sg-art { max-width: 720px; margin: 0 auto; }
.sg-art__head { margin-bottom: 20px; }
.sg-art__title {
	margin: 0 0 12px;
	font-size: clamp(1.55rem, 4.4vw, 2.2rem);
	font-weight: 700;
	line-height: 1.6;
	color: var(--art-ink);
}
.sg-art__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	font-size: 0.85rem;
	color: var(--art-muted);
}
.sg-art__cover {
	margin: 0 0 26px;
	aspect-ratio: 16 / 9; /* any photo, portrait or wide, sits in one calm frame */
	border-radius: 12px;
	overflow: hidden;
	background: var(--art-soft);
}
.sg-art__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sg-art-toc {
	margin: 0 0 28px;
	padding: 14px 18px;
	border: 1px solid var(--art-line);
	border-inline-start: 3px solid var(--art-gold);
	border-radius: 10px;
	background: #FFF;
}
.sg-art-toc summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; }
.sg-art-toc ol { margin: 10px 0 0; padding-inline-start: 22px; list-style: persian; }
.sg-art__content ol { list-style: persian; }
.sg-art-toc li { margin: 4px 0; line-height: 1.9; }
.sg-art-toc a { color: var(--art-ink); text-decoration: none; font-size: 0.93rem; }
.sg-art-toc a:hover { color: var(--art-gold-d); }

.sg-art__content {
	font-size: 1.06rem;
	line-height: 2.15;
	color: #3A322C;
	overflow-wrap: break-word;
}
.sg-art__content > * { margin-top: 0; margin-bottom: 1.15em; }
.sg-art__content h2 {
	margin: 1.9em 0 0.6em;
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.7;
	color: var(--art-ink);
	scroll-margin-top: 96px; /* sticky header */
}
.sg-art__content h3 {
	margin: 1.5em 0 0.5em;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.8;
	color: var(--art-ink);
	scroll-margin-top: 96px;
}
.sg-art__content a { color: var(--art-gold-d); text-decoration: underline; text-underline-offset: 3px; }
.sg-art__content img { max-width: 100%; height: auto; border-radius: 10px; }
.sg-art__content figure { margin: 1.6em 0; }
.sg-art__content figcaption { font-size: 0.85rem; color: var(--art-muted); text-align: center; margin-top: 6px; }
.sg-art__content ul,
.sg-art__content ol { padding-inline-start: 1.4em; }
.sg-art__content li { margin-bottom: 0.4em; }
.sg-art__content blockquote {
	margin: 1.6em 0;
	padding: 4px 18px;
	border-inline-start: 3px solid var(--art-gold);
	color: var(--art-ink);
	font-size: 1.04rem;
}
/* tables: styled in article-blocks.css (header, zebra rows, sideways scroll on phones) */
.sg-art__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.sg-art__tags a { color: var(--art-muted); font-size: 0.85rem; text-decoration: none; }
.sg-art__tags a:hover { color: var(--art-gold-d); }

/* --- sections after the article --- */
.sg-art-products,
.sg-art-related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--art-line); }
.sg-art-single .sg-art-products,
.sg-art-single .sg-art-related { max-width: none; }
.sg-art-section-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 18px;
}
.sg-art-section-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--art-ink); }
.sg-art-section-head a { color: var(--art-gold-d); font-size: 0.9rem; text-decoration: none; white-space: nowrap; }
.sg-art-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- homepage preview --- */
.sg-home-articles__rail {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

/* --- responsive --- */
@media (max-width: 990px) {
	.sg-art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 600px) {
	.sg-art-wrap { padding: 16px 16px 48px; }
	.sg-art-grid,
	.sg-art-grid--3 { grid-template-columns: minmax(0, 1fr); }
	.sg-art__content { font-size: 1.02rem; line-height: 2.1; }
	.sg-art__content h2 { font-size: 1.25rem; }
	.sg-art-section-head h2 { font-size: 1.08rem; }
	/* homepage: swipe row, next card peeks in */
	.sg-home-articles__rail {
		display: flex;
		gap: 12px;
		margin: 0 -16px;
		padding: 0 16px 6px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.sg-home-articles__rail::-webkit-scrollbar { display: none; }
	.sg-home-articles__rail .sg-art-card { flex: 0 0 82%; scroll-snap-align: start; }
	.sg-home-articles .sg-art-card__excerpt { -webkit-line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) {
	.sg-art-card__media img,
	.sg-art-card,
	.sg-art-chip { transition: none !important; }
}

/* --- dated topics (e.g. بازار طلا) --- */
.sg-art__dated {
	display: inline-block;
	margin: 0 0 10px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #2B2420;
	color: #F4EFE6;
	font-size: 0.82rem;
}
.sg-art__dated-note {
	margin: 14px 0 0;
	padding: 10px 14px;
	border-radius: 10px;
	background: #FBF6E9;
	color: #5C4A1E;
	font-size: 0.88rem;
	line-height: 1.9;
}
.sg-art__dated-note a { color: #A88418; font-weight: 700; }
.sg-art-card__topic--dated {
	align-self: flex-start;
	padding: 2px 10px;
	border-radius: 999px;
	background: #2B2420;
	color: #F4EFE6;
}
.sg-art__dated-note.is-stale {
	background: #FDF1E4;
	border-inline-start: 3px solid #C9A227;
	color: #4A3A16;
}
/* separator: a thin bar, never a dot — a dot next to Persian digits reads as zero (۳ · → «۳۰») */
.sg-art-sep { display: inline-block; width: 1px; height: 0.9em; background: currentColor; opacity: 0.35; vertical-align: middle; margin: 0 2px; }
.sg-art__updated { flex-basis: 100%; }
