/*
Theme Name: خبرکده
Theme URI: https://khabarkadeh.com
Author: AtlasUi
Author URI: https://AtlasUi.net
Description: پوسته خبری سبک، راست‌چین، واکنش‌گرا و خودکار برای پایگاه خبری خبرکده.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: khabarkadeh
*/

:root {
	--kk-primary: #6d52d9;
	--kk-primary-dark: #4b2ca6;
	--kk-accent: #f04438;
	--kk-ink: #151821;
	--kk-muted: #6b7280;
	--kk-border: #e7e5f2;
	--kk-page: #f3f3f5;
	--kk-card: #ffffff;
	--kk-footer: #06191f;
	--kk-footer-soft: #10242b;
	--kk-radius: 8px;
	--kk-shadow: 0 14px 34px rgba(34, 28, 75, .08);
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	direction: rtl;
	background-color: var(--kk-page);
	background-image: url("assets/images/page-texture.png");
	background-repeat: repeat;
	background-size: 338px 600px;
	color: var(--kk-ink);
	line-height: 1.9;
	text-align: start;
	text-rendering: optimizeLegibility;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

a:hover { color: var(--kk-primary-dark); }

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

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 30;
	color: #fff;
	box-shadow: 0 12px 28px rgba(40, 28, 96, .14);
}

.topbar {
	background: var(--kk-primary-dark);
	font-size: .78rem;
}

.topbar-inner {
	min-height: 30px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	color: rgba(255, 255, 255, .86);
}

.topbar-links {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.topbar-links a {
	color: rgba(255, 255, 255, .88);
}

.topbar-links a:hover {
	color: #fff;
}

.header-main {
	background: var(--kk-primary);
}

.header-main-inner {
	min-height: 88px;
	display: flex;
	align-items: center;
	gap: 24px;
}

.brand {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	flex: 0 0 210px;
	width: 210px;
	height: 76px;
	overflow: hidden;
}

.brand-logo,
.footer-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.brand-logo .custom-logo-link,
.brand-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.brand-logo img,
.brand-logo .custom-logo {
	display: block;
	width: auto !important;
	max-width: 205px !important;
	max-height: 72px !important;
	height: auto !important;
	object-fit: contain;
}

.brand-placeholder {
	display: inline-grid;
	place-items: center;
	min-width: 94px;
	height: 38px;
	color: #fff;
	font-size: 1.45rem;
	font-weight: 900;
	text-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}

.primary-nav {
	min-width: 0;
	flex: 1 1 auto;
	align-self: stretch;
	display: flex;
	align-items: center;
}

.primary-menu,
.primary-nav ul,
.footer-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-menu,
.primary-nav ul {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 2px;
	height: 100%;
}

.primary-menu a,
.primary-nav li a {
	display: flex;
	align-items: center;
	min-height: 88px;
	padding: 0 14px;
	color: #fff;
	font-size: .88rem;
	font-weight: 800;
	border-bottom: 3px solid transparent;
	white-space: nowrap;
}

.primary-menu a:hover,
.primary-nav li a:hover,
.primary-nav .current-menu-item > a {
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border-color: rgba(255, 255, 255, .76);
}

.header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex: 0 0 auto;
	margin-right: auto;
	align-self: center;
}

.icon-button,
.menu-toggle,
.back-top {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 7px;
	display: inline-grid;
	place-items: center;
	cursor: pointer;
}

.icon-button,
.menu-toggle {
	background: rgba(255, 255, 255, .12);
	color: #fff;
}

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

.menu-toggle { display: none; }

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

.home-shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 295px;
	gap: 18px;
	align-items: start;
}

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

.panel,
.widget,
.archive-box,
.page-box,
.single-article {
	background: var(--kk-card);
	border: 1px solid var(--kk-border);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
}

.panel {
	margin-bottom: 16px;
	padding: 13px;
}

.panel-heading,
.widget-title {
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--kk-primary-dark);
	font-size: 1.04rem;
	line-height: 1.5;
	font-weight: 900;
}

.latest-posts-heading {
	margin-top: 14px;
}

.panel-heading::after,
.widget-title::after {
	content: "";
	height: 2px;
	flex: 1 1 auto;
	background: linear-gradient(90deg, transparent, var(--kk-primary));
	opacity: .65;
}

.headline-card {
	position: relative;
	overflow: hidden;
	min-height: 310px;
	border-radius: var(--kk-radius);
	background: #201844;
	color: #fff;
	isolation: isolate;
}

.headline-card a {
	display: block;
	min-height: inherit;
	color: #fff;
}

.headline-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: .9;
	transition: transform .28s ease, opacity .28s ease;
}

.headline-card:hover img {
	transform: scale(1.035);
	opacity: 1;
}

.headline-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(180deg, rgba(31, 24, 68, .04), rgba(31, 24, 68, .86));
}

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

.headline-label,
.post-category,
.single-category {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	font-size: .76rem;
	font-weight: 850;
	line-height: 1.7;
}

.headline-label {
	margin-bottom: 7px;
	padding: 2px 9px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.headline-title {
	margin: 0;
	font-size: clamp(1.45rem, 3vw, 2.15rem);
	line-height: 1.55;
	font-weight: 950;
	text-wrap: balance;
}

.latest-under-headline {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 12px;
}

.compact-card {
	display: grid;
	grid-template-columns: 116px minmax(0, 1fr);
	gap: 10px;
	padding: 9px;
	border: 1px solid var(--kk-border);
	border-radius: 7px;
	background: #fff;
	min-width: 0;
}

.compact-card .thumb {
	aspect-ratio: 4 / 3;
	border-radius: 6px;
	overflow: hidden;
	background: #efedf8;
}

.compact-card .thumb img,
.post-card .thumb img,
.mini-card .thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.compact-card h3,
.mini-card h3,
.post-card h3 {
	margin: 0;
	color: #222636;
	font-size: .9rem;
	line-height: 1.72;
	font-weight: 850;
}

.meta {
	margin-top: 5px;
	color: var(--kk-muted);
	font-size: .76rem;
	line-height: 1.6;
}

.service-grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 12px;
}

.service-feature,
.post-card {
	overflow: hidden;
	border: 1px solid var(--kk-border);
	border-radius: 7px;
	background: #fff;
}

.service-feature .thumb,
.post-card .thumb {
	display: block;
	aspect-ratio: 16 / 10;
	background: #efedf8;
	overflow: hidden;
}

.service-feature-body,
.post-card-body {
	padding: 10px 11px 13px;
}

.service-feature h3 {
	margin: 0;
	color: #1d2030;
	font-size: 1.08rem;
	line-height: 1.72;
	font-weight: 900;
}

.service-feature p {
	margin: 7px 0 0;
	color: #4b5563;
	font-size: .88rem;
	line-height: 1.9;
}

.mini-card p {
	margin: 5px 0 0;
	color: #535b69;
	font-size: .8rem;
	line-height: 1.8;
}

.mini-list {
	display: grid;
	gap: 9px;
}

.mini-card {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 9px;
	padding-bottom: 9px;
	border-bottom: 1px solid var(--kk-border);
}

.mini-card:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

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

.post-category,
.single-category {
	margin-bottom: 4px;
	color: var(--kk-primary-dark);
}

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

.latest-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.latest-list li {
	position: relative;
	padding: 9px 13px 9px 0;
	border-bottom: 1px solid var(--kk-border);
}

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

.latest-list li::before {
	content: "";
	position: absolute;
	right: 0;
	top: 21px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--kk-primary);
}

.latest-list a {
	display: block;
	font-size: .9rem;
	font-weight: 760;
	line-height: 1.78;
}

.empty-note {
	margin: 0;
	padding: 18px;
	border: 1px dashed var(--kk-border);
	border-radius: 7px;
	background: #fbfaff;
	color: var(--kk-muted);
	font-size: .92rem;
}

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

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

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

.single-title,
.page-title,
.archive-title {
	margin: 0 0 13px;
	color: #141725;
	font-size: clamp(1.55rem, 3vw, 2.35rem);
	line-height: 1.55;
	font-weight: 950;
	text-align: start;
}

.single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-bottom: 16px;
	color: var(--kk-muted);
	font-size: .84rem;
}

.single-lead {
	margin: 0 0 18px;
	padding: 13px 15px;
	border-right: 3px solid var(--kk-primary);
	border-radius: 7px;
	background: #f8f6ff;
	color: #35364a;
	font-size: 1rem;
	line-height: 2;
}

.featured-image {
	margin-bottom: 20px;
	overflow: hidden;
	border-radius: var(--kk-radius);
}

.featured-image img {
	width: 100%;
	max-height: 520px;
	object-fit: cover;
}

.entry-content {
	color: #202431;
	font-size: 1rem;
	line-height: 2.15;
	text-align: justify;
}

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

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

.entry-content img { border-radius: 7px; }

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

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

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

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

.site-footer {
	background: var(--kk-footer);
	color: rgba(255, 255, 255, .78);
}

.footer-search {
	padding: 30px 0;
	background: #05151a;
}

.footer-search form {
	width: min(360px, 100%);
	margin-inline: auto;
	position: relative;
}

.footer-search input[type="search"] {
	width: 100%;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 6px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	padding: 0 42px 0 12px;
}

.footer-search button {
	position: absolute;
	right: 0;
	top: 0;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: rgba(255, 255, 255, .82);
	cursor: pointer;
}

.footer-bottom {
	background: var(--kk-footer-soft);
}

.footer-inner {
	min-height: 76px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 18px 0;
}

.footer-title {
	margin: 0;
	color: #fff;
	font-weight: 900;
}

.footer-text {
	margin: 3px 0 0;
	font-size: .83rem;
}

.back-top {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 22;
	background: var(--kk-primary);
	color: #fff;
	box-shadow: 0 12px 26px rgba(17, 12, 47, .22);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 980px) {
	.home-shell,
	.single-layout {
		grid-template-columns: 1fr;
	}

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

	.widget { margin-bottom: 0; }
	.archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
	.topbar { display: none; }

	.header-main-inner {
		min-height: 64px;
		gap: 12px;
	}

	.brand {
		flex-basis: 150px;
		width: 150px;
		height: 54px;
	}

	.brand-logo img,
	.brand-logo .custom-logo {
		max-width: 146px !important;
		max-height: 52px !important;
	}

	.primary-nav {
		position: absolute;
		inset-inline: 0;
		top: 64px;
		display: none;
		background: var(--kk-primary-dark);
		border-top: 1px solid rgba(255, 255, 255, .15);
	}

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

	.primary-menu,
	.primary-nav ul {
		display: grid;
		justify-content: stretch;
		gap: 0;
	}

	.primary-menu a,
	.primary-nav li a {
		min-height: 0;
		padding: 12px 14px;
		border-bottom: 1px solid rgba(255, 255, 255, .12);
	}

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

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

	.latest-under-headline,
	.service-grid,
	.sidebar-column,
	.single-sidebar {
		grid-template-columns: 1fr;
	}

	.headline-card { min-height: 270px; }
	.archive-grid { grid-template-columns: 1fr; }

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

@media (max-width: 520px) {
	.kk-container {
		width: min(100% - 18px, 1130px);
	}

	.panel,
	.widget {
		padding: 10px;
	}

	.compact-card,
	.mini-card {
		grid-template-columns: 92px minmax(0, 1fr);
	}

	.footer-inner {
		align-items: flex-start;
		flex-direction: column;
	}
}
