/*
Theme Name: khabarJadid
Theme URI: https://example.com/khabarjadid
Author: Codex
Description: پوسته خبری سبک، راست چین و موبایل محور برای رسانه فارسی.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: khabarjadid
*/

:root {
	--kj-red: #b4000b;
	--kj-red-dark: #890009;
	--kj-ink: #111318;
	--kj-muted: #69707a;
	--kj-line: #e7e9ee;
	--kj-soft: #f5f6f8;
	--kj-card: #ffffff;
	--kj-shadow: 0 14px 30px rgba(18, 24, 38, .08);
	--kj-radius: 8px;
}

* { box-sizing: border-box; }

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	direction: rtl;
	background: #f0f2f5;
	color: var(--kj-ink);
	font-family: Vazirmatn, Tahoma, Arial, sans-serif;
	line-height: 1.9;
	text-align: justify;
	text-rendering: optimizeLegibility;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover { color: var(--kj-red); }

img {
	max-width: 100%;
	height: auto;
	display: block;
}

.kj-container {
	width: min(1180px, calc(100% - 28px));
	margin-inline: auto;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
}

.site-header,
.section-title,
.widget-title,
.headline-card h2,
.headline-card h3,
.post-card h3,
.single-title,
.footer-title {
	text-align: start;
}

.topbar {
	background: linear-gradient(180deg, var(--kj-red), var(--kj-red-dark));
	color: #fff;
}

.topbar-inner {
	min-height: 62px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 18px;
	align-items: center;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.brand-logo img {
	max-height: 48px;
	width: auto;
}

.brand-name {
	font-size: 2rem;
	font-weight: 900;
	letter-spacing: 0;
	white-space: nowrap;
}

.header-tools {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
}

.icon-button,
.menu-toggle {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	display: inline-grid;
	place-items: center;
	cursor: pointer;
}

.icon-button svg,
.menu-toggle svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.menu-toggle { display: none; }

.primary-nav {
	border-bottom: 1px solid var(--kj-line);
	background: #fff;
}

.primary-menu,
.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
}

.primary-menu a,
.primary-nav li a {
	display: block;
	padding: 11px 17px;
	font-size: .92rem;
	font-weight: 800;
	color: #2c3037;
	border-bottom: 3px solid transparent;
}

.primary-menu a:hover,
.primary-nav li a:hover,
.primary-nav .current-menu-item > a {
	color: var(--kj-red);
	border-color: var(--kj-red);
}

.site-main {
	padding: 22px 0 32px;
}

.layout-home {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 310px;
	gap: 20px;
	align-items: start;
}

.main-column,
.sidebar-column,
.single-content,
.single-sidebar {
	min-width: 0;
}

.headline-section {
	margin-top: 0;
	margin-bottom: 14px;
}

.headline-grid {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: 10px;
}

.headline-side {
	display: grid;
	gap: 10px;
}

.headline-card {
	position: relative;
	overflow: hidden;
	min-height: 172px;
	border-radius: var(--kj-radius);
	background: #17191f;
	color: #fff;
	box-shadow: var(--kj-shadow);
}

.headline-card.big { min-height: 316px; }

.headline-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: absolute;
	inset: 0;
	opacity: .78;
}

.headline-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 22%, rgba(0,0,0,.82));
}

.headline-body {
	position: absolute;
	inset-inline: 16px;
	bottom: 14px;
	z-index: 1;
}

.headline-card h2,
.headline-card h3 {
	margin: 0;
	line-height: 1.55;
	font-weight: 900;
}

.headline-card h2 { font-size: 1.55rem; }
.headline-card h3 { font-size: .98rem; }

.section-block,
.widget-box,
.archive-page,
.page-box,
.single-article {
	background: var(--kj-card);
	border: 1px solid var(--kj-line);
	border-radius: var(--kj-radius);
	box-shadow: 0 10px 24px rgba(16, 23, 34, .04);
}

.section-block {
	margin-top: 14px;
	padding: 12px;
}

.section-title {
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.12rem;
	line-height: 1.5;
	font-weight: 900;
}

.section-title::before {
	content: "";
	width: 5px;
	height: 22px;
	border-radius: 5px;
	background: var(--kj-red);
}

.news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.news-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.post-card {
	min-width: 0;
	border-radius: 7px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #eef0f3;
}

.post-card .thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #e3e6ea;
	overflow: hidden;
	border-radius: 7px 7px 0 0;
	display: grid;
	place-items: center;
}

.post-card .thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .25s ease;
}

.post-card:hover img { transform: scale(1.035); }

.post-card .no-thumb {
	color: #8a929e;
	font-size: .9rem;
	font-weight: 800;
}

.post-card-body {
	padding: 8px 9px 10px;
	background: #fff;
}

.post-card h3 {
	margin: 0;
	font-size: .93rem;
	line-height: 1.75;
	font-weight: 850;
}

.post-meta {
	color: var(--kj-muted);
	font-size: .78rem;
	margin-top: 3px;
}

.widget-box {
	padding: 12px;
	margin-bottom: 14px;
}

.widget-title {
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--kj-red);
	font-size: 1.03rem;
	font-weight: 900;
}

.latest-list,
.popular-list,
.related-list,
.others-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.latest-list li,
.popular-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--kj-line);
}

.latest-list li:last-child,
.popular-list li:last-child { border-bottom: 0; }

.latest-list a,
.popular-list a {
	display: block;
	font-size: .91rem;
	font-weight: 750;
	line-height: 1.75;
}

.popular-list li {
	position: relative;
	padding-right: 14px;
}

.popular-list li::before {
	content: "";
	position: absolute;
	right: 0;
	top: 18px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--kj-red);
}

.single-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 22px;
	align-items: start;
}

.single-article {
	padding: 24px;
}

.breadcrumbs {
	margin-bottom: 8px;
	font-size: .82rem;
	color: var(--kj-muted);
}

.single-title {
	margin: 0 0 12px;
	font-size: clamp(1.6rem, 3vw, 2.45rem);
	line-height: 1.55;
	font-weight: 950;
}

.single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	color: var(--kj-muted);
	font-size: .86rem;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--kj-line);
}

.single-lead {
	margin: 18px 0;
	padding: 16px 18px;
	border-right: 5px solid var(--kj-red);
	border-radius: 7px;
	background: #fff3f3;
	color: #292d33;
	font-size: 1.03rem;
	font-weight: 700;
	line-height: 2;
}

.featured-image {
	margin: 18px 0;
	border-radius: var(--kj-radius);
	overflow: hidden;
}

.entry-content {
	font-size: 1.02rem;
	line-height: 2.25;
	color: #22262c;
}

.entry-content p { margin: 0 0 1.15em; }

.entry-content h2,
.entry-content h3 {
	line-height: 1.7;
	margin: 1.5em 0 .55em;
}

.others-inline {
	margin: 18px 0;
	padding: 14px 16px;
	border: 1px solid #ffd7d7;
	border-radius: var(--kj-radius);
	background: linear-gradient(180deg, #fff8f8, #fff);
}

.others-inline h3 {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 900;
	color: var(--kj-red-dark);
}

.others-list li {
	position: relative;
	padding: 7px 18px 7px 0;
	border-bottom: 1px dashed #ead1d1;
}

.others-list li:last-child { border-bottom: 0; }

.others-list li::before {
	content: "";
	position: absolute;
	right: 0;
	top: 18px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--kj-red);
	box-shadow: 0 0 0 rgba(180,0,11,.45);
	animation: kjPulse 1.35s infinite;
}

@keyframes kjPulse {
	70% { box-shadow: 0 0 0 8px rgba(180,0,11,0); }
	100% { box-shadow: 0 0 0 0 rgba(180,0,11,0); }
}

.related-list li {
	display: grid;
	grid-template-columns: 86px 1fr;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px solid var(--kj-line);
}

.related-list li:last-child { border-bottom: 0; }

.related-list .mini-thumb {
	aspect-ratio: 4 / 3;
	border-radius: 6px;
	overflow: hidden;
	background: #e4e7ec;
}

.related-list img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.related-list a {
	font-size: .88rem;
	font-weight: 800;
	line-height: 1.65;
}

.archive-page,
.page-box {
	padding: 20px;
}

.archive-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.pagination {
	margin-top: 20px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.pagination .page-numbers {
	min-width: 38px;
	height: 38px;
	display: inline-grid;
	place-items: center;
	border: 1px solid var(--kj-line);
	border-radius: 6px;
	background: #fff;
}

.pagination .current {
	background: var(--kj-red);
	color: #fff;
	border-color: var(--kj-red);
}

.site-footer {
	margin-top: 28px;
	padding: 24px 0;
	background: #15171d;
	color: #f5f6f8;
}

.footer-inner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px;
	align-items: center;
}

.footer-title {
	margin: 0 0 5px;
	font-size: 1.15rem;
	font-weight: 900;
}

.footer-text {
	margin: 0;
	color: #c8ced8;
	font-size: .92rem;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: .9rem;
}

.empty-note {
	margin: 0;
	padding: 16px;
	border-radius: 7px;
	background: var(--kj-soft);
	color: var(--kj-muted);
}

@media (max-width: 920px) {
	.topbar-inner {
		grid-template-columns: auto 1fr auto;
		min-height: 58px;
	}

	.brand-name { font-size: 1.55rem; }

	.menu-toggle { display: inline-grid; }

	.header-tools .icon-button { display: none; }

	.primary-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 58px;
		box-shadow: 0 16px 28px rgba(0,0,0,.13);
	}

	body.nav-open .primary-nav { display: block; }

	.primary-menu,
	.primary-nav ul {
		align-items: stretch;
		justify-content: flex-start;
		flex-direction: column;
		gap: 0;
		padding: 6px 14px 12px;
	}

	.primary-menu a,
	.primary-nav li a {
		padding: 13px 4px;
		border-bottom: 1px solid var(--kj-line);
	}

	.layout-home,
	.single-layout {
		grid-template-columns: 1fr;
	}

	.sidebar-column {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.widget-box { margin-bottom: 0; }
}

@media (max-width: 680px) {
	.kj-container { width: min(100% - 20px, 1180px); }

	.site-main { padding-top: 12px; }

	.brand-name { font-size: 1.35rem; }

	.headline-grid {
		grid-template-columns: 1fr;
		gap: 9px;
	}

	.headline-side {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.headline-card.big { min-height: 270px; }
	.headline-card { min-height: 150px; }

	.headline-card h2 { font-size: 1.22rem; }
	.headline-card h3 { font-size: .86rem; }

	.news-grid,
	.news-grid.three,
	.archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.section-block { padding: 10px; }

	.post-card h3 {
		font-size: .86rem;
		line-height: 1.65;
	}

	.sidebar-column {
		grid-template-columns: 1fr;
	}

	.single-article,
	.archive-page,
	.page-box {
		padding: 16px;
	}

	.entry-content {
		font-size: .98rem;
		line-height: 2.15;
	}

	.footer-inner {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.headline-side,
	.news-grid,
	.news-grid.three,
	.archive-grid {
		grid-template-columns: 1fr;
	}

	.headline-card.big,
	.headline-card {
		min-height: 226px;
	}

	.related-list li {
		grid-template-columns: 74px 1fr;
	}
}
