/*
Theme Name: Khabarkhan
Description: قالب سبک و راست‌چین برای رسانه و خبرخوان تخصصی (نسخه ۲)
Version: 2.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: khabarkhan
*/

/* فونت راوی (نسخه‌ی متغیر با ارقام فارسی). فایل داخل assets/fonts است. */
@font-face {
	font-family: "Ravi";
	src: url("assets/fonts/RaviFaNum-VF.woff2") format("woff2");
	font-weight: 100 950;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg: #f8f9fc;
	--card: #ffffff;
	--text: #101828;
	--text-soft: #475467;
	--muted: #667085;
	--line: #e9ebf1;
	--chip: #f2f3f5;
	--accent: #d8232a;
	--accent-ink: #ffffff;
	--good: #0a9f7a;
	--mint: #d3e3dc;
	--pink: #f7e1e1;
	--teal: #479f8b;
	--radius: 22px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e1116;
		--card: #171b22;
		--text: #eef0f4;
		--text-soft: #b6bdca;
		--muted: #8f98a8;
		--line: #262c36;
		--chip: #222833;
		--accent: #ff5a60;
		--accent-ink: #14171c;
		--good: #3ed1aa;
		--mint: #1f332c;
		--pink: #3a2428;
		--teal: #2f7a6a;
	}
}

* { box-sizing: border-box; }
html { direction: rtl; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.9 Ravi, Tahoma, "Segoe UI", system-ui, sans-serif;
	-webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 14px; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* نوار پیشرفت مطالعه */
#progress {
	position: fixed; top: 0; right: 0; height: 3px; width: 0; z-index: 50;
	background: var(--accent);
}

/* هدر */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 800; font-size: 22px; color: var(--accent); white-space: nowrap; }
.brand img { height: 46px; width: auto; max-width: 100%; }
.brand { display: inline-flex; align-items: center; }
.search { flex: 1; max-width: 360px; margin-inline-start: auto; }
.search input {
	width: 100%; padding: 8px 16px; border: 1px solid var(--line); border-radius: 14px;
	background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.chips { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-list { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0 0 10px; white-space: nowrap; }
.chip-list a { display: block; padding: 2px 16px; border-radius: 12px; font-size: 14px; background: var(--chip); color: var(--text-soft); }
.chip-list .current-menu-item a,
.chip-list .current-cat a { background: var(--accent); color: var(--accent-ink); }

main { padding: 18px 0 30px; }
.sec-title { font-size: 19px; font-weight: 800; margin: 6px 0 12px; padding-right: 10px; border-right: 4px solid var(--accent); line-height: 1.6; }

/* لیست شماره‌دار برترین خبرها */
.top-news { margin-bottom: 26px; }
.top-list { list-style: none; margin: 0; padding: 4px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.top-list li + li { border-top: 1px solid var(--line); }
.top-list a { display: flex; gap: 12px; padding: 12px 0; align-items: baseline; }
.top-list .n { color: var(--accent); font-weight: 800; min-width: 28px; }
.top-list .t { font-weight: 600; font-size: 15.5px; line-height: 1.75; }

/* کارت خبر */
.list { display: grid; gap: 14px; }
.card {
	background: var(--card); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 18px;
}
.card-title { font-size: 19px; line-height: 1.6; font-weight: 800; margin: 0 0 10px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.meta-row .sep { width: 1px; height: 14px; background: var(--line); }
.meta-row .source { font-weight: 700; color: var(--text-soft); }
.meta-row .score { color: var(--good); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.meta-row .score::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--good); border-top-color: transparent; }
.share {
	margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
	background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: 13px;
}
.share svg { width: 18px; height: 18px; }
.share:hover { color: var(--accent); }
.card-img { display: block; margin: 0 0 14px; }
.card-img img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 18px; }
.points { list-style: none; margin: 0 0 14px; padding: 0; font-size: 14.5px; line-height: 1.95; color: var(--text-soft); }
.points li + li { margin-top: 4px; }
.card-excerpt { margin: 0 0 14px; color: var(--text-soft); font-size: 14.5px; }
.card-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.btn-more {
	display: inline-block; padding: 8px 22px; border-radius: 12px;
	background: var(--chip); color: var(--text-soft); font-size: 14px;
}
.btn-more:hover { background: var(--accent); color: var(--accent-ink); }

/* صفحه خبر */
.single-title { font-size: 26px; line-height: 1.6; font-weight: 800; margin: 4px 0 12px; }
.single .card-img img { max-height: 420px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 16px; }
.panel-head { padding: 12px 18px; font-weight: 800; font-size: 15px; }
.panel-head.mint { background: var(--mint); }
.panel-head.pink { background: var(--pink); }
.panel-head.teal { background: var(--teal); color: #fff; }
.panel-body { padding: 16px 18px 18px; }
.entry-content { font-size: 16.5px; line-height: 2.1; }
.id-list { margin: 0 0 14px; padding: 0; }
.id-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.id-list dt { color: var(--muted); }
.id-list dd { margin: 0; font-weight: 700; }
.btn-source {
	display: block; text-align: center; padding: 12px 20px; border-radius: 14px;
	background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
.btn-source:hover { color: var(--accent-ink); opacity: .9; }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.related { margin-top: 26px; }

/* صفحه‌های ساده */
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.entry h1 { font-size: 24px; line-height: 1.7; margin: 0 0 10px; }

/* صفحه‌بندی */
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.page-numbers { padding: 2px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.page-numbers.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* فوتر */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 10px 0 40px; color: var(--muted); font-size: 14px; }
.foot-title { text-align: center; font-weight: 800; color: var(--text); font-size: 16px; margin: 24px 0 12px; }
.foot-links, .footer-menu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.footer-menu li::before { content: "•"; margin-inline-end: 8px; color: var(--muted); }
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.social-grid a { padding: 2px 0; }
.about { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 20px; text-align: center; }
.about strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.about p { margin: 0 0 6px; }
