/*
Theme Name: Faraamatn
Theme URI: https://AtlasUi.net
Author: AtlasUi
Author URI: https://AtlasUi.net
Description: پوسته خبری راست چین، واکنش‌گرا و قابل سفارشی‌سازی برای رسانه فرامتن.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: faraamatn
*/

:root {
	--kj-navy: #12365f;
	--kj-navy-dark: #081f38;
	--kj-sky: #21a6d8;
	--kj-sky-soft: #dff5ff;
	--kj-ice: #f5fbff;
	--kj-ink: #17202d;
	--kj-muted: #667489;
	--kj-line: #dce8f2;
	--kj-page: #f3f5f7;
	--kj-card: #ffffff;
	--kj-shadow: 0 18px 38px rgba(9, 31, 56, .1);
	--kj-radius: 8px;
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	direction: rtl;
	background: linear-gradient(180deg, #f7f9fb, var(--kj-page) 420px);
	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;
	transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

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

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

.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;
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: blur(14px);
	box-shadow: 0 10px 26px rgba(7, 28, 52, .08);
}

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

.topbar {
	color: #fff;
	background:
		linear-gradient(90deg, rgba(33, 166, 216, .24), transparent 38%),
		linear-gradient(180deg, var(--kj-navy), var(--kj-navy-dark));
}

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

.header-date {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	width: max-content;
	max-width: 100%;
	min-height: 36px;
	padding: 5px 12px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 7px;
	background: rgba(255, 255, 255, .1);
	color: #ecf9ff;
	font-size: .86rem;
	font-weight: 700;
	white-space: nowrap;
}

.brand {
	justify-self: start;
	display: inline-grid;
	justify-items: center;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

.brand-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.brand-logo .custom-logo-link {
	display: inline-flex;
	align-items: center;
}

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

.brand-logo-placeholder {
	width: 74px;
	height: 58px;
	display: inline-grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 8px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 1.35rem;
	font-weight: 900;
}

.brand-name {
	color: #fff;
	font-size: .84rem;
	font-weight: 400;
	letter-spacing: 0;
	white-space: nowrap;
	line-height: 1.5;
	opacity: .88;
}

.menu-toggle {
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 7px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	display: none;
	place-items: center;
	cursor: pointer;
}

.menu-toggle svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.primary-nav {
	border-bottom: 1px solid rgba(18, 54, 95, .12);
	background: #fff;
}

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

.primary-menu a,
.primary-nav li a {
	display: block;
	padding: 12px 17px;
	border-bottom: 3px solid transparent;
	color: #27374b;
	font-size: .92rem;
	font-weight: 850;
}

.primary-menu a:hover,
.primary-nav li a:hover,
.primary-nav .current-menu-item > a {
	color: var(--kj-navy);
	border-color: var(--kj-sky);
	background: linear-gradient(180deg, #ffffff, var(--kj-ice));
}

.site-main { padding: 24px 0 34px; }

.layout-home {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 310px;
	gap: 22px;
	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: 12px;
}

.headline-grid.single-headline {
	grid-template-columns: 1fr;
}

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

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

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

.headline-card a {
	display: block;
	width: 100%;
	height: 100%;
	color: #fff;
}

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

.headline-card:hover img {
	transform: scale(1.045);
	opacity: .92;
}

.headline-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 31, 56, .04) 12%, rgba(8, 31, 56, .88));
	z-index: 0;
}

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

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

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

.headline-kicker,
.post-kicker,
.single-kicker {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	color: var(--kj-sky);
	font-size: .76rem;
	font-weight: 900;
	line-height: 1.7;
}

.headline-kicker {
	padding: 1px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .14);
	color: #dff7ff;
}

.post-kicker { margin-bottom: 3px; }

.single-kicker {
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: 7px;
	background: var(--kj-sky-soft);
	color: var(--kj-navy);
}

.section-block,
.widget-box,
.archive-page,
.page-box,
.single-article {
	background: rgba(255, 255, 255, .96);
	border: 1px solid var(--kj-line);
	border-radius: var(--kj-radius);
	box-shadow: 0 12px 28px rgba(9, 31, 56, .05);
}

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

.section-title {
	margin: 0 0 13px;
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--kj-navy);
	font-size: 1.12rem;
	line-height: 1.5;
	font-weight: 900;
}

.section-title-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
	flex: 0 0 24px;
}

.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 #e4edf5;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.post-card:hover {
	transform: translateY(-2px);
	border-color: rgba(33, 166, 216, .42);
	box-shadow: 0 12px 24px rgba(9, 31, 56, .08);
}

.post-card .thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: linear-gradient(135deg, var(--kj-ice), #e6f2fb);
	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: var(--kj-muted);
	font-size: .9rem;
	font-weight: 800;
}

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

.post-card h3 {
	margin: 0;
	color: #1c2a3a;
	font-size: .94rem;
	line-height: 1.76;
	font-weight: 850;
}

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

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

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

.latest-list li,
.popular-list li {
	padding: 9px 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;
	color: #223247;
	font-size: .91rem;
	font-weight: 750;
	line-height: 1.78;
}

.latest-list li,
.popular-list li {
	position: relative;
	padding-right: 15px;
}

.latest-list li::before,
.popular-list li::before {
	content: "";
	position: absolute;
	right: 0;
	top: 21px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--kj-sky);
}

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

.single-article { padding: 26px; }

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

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

.single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	color: var(--kj-muted);
	font-size: .87rem;
	font-weight: 700;
	padding-bottom: 15px;
	border-bottom: 1px solid var(--kj-line);
}

.single-meta-icon {
	width: 30px;
	height: 25px;
	object-fit: contain;
	margin-left: 2px;
}

.meta-separator { color: #a4b1c0; }

.news-code {
	color: var(--kj-navy);
	font-weight: 850;
}

.single-lead {
	margin: 18px 0;
	padding: 17px 19px;
	border-right: 5px solid var(--kj-sky);
	border-radius: 7px;
	background: linear-gradient(180deg, var(--kj-ice), #ffffff);
	color: #1f3148;
	font-size: 1.04rem;
	font-weight: 750;
	line-height: 2.05;
}

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

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

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

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

.faraamatn-content-prefix {
	color: var(--kj-navy);
	font-weight: 900;
}

.entry-content h2,
.entry-content h3 {
	color: var(--kj-navy);
	line-height: 1.7;
	margin: 1.5em 0 .55em;
}

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

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

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

.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-sky);
	box-shadow: 0 0 0 rgba(33, 166, 216, .45);
	animation: kjPulse 1.35s infinite;
}

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

.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-navy);
	color: #fff;
	border-color: var(--kj-navy);
}

.site-footer {
	margin-top: 28px;
	padding: 26px 0;
	background:
		linear-gradient(90deg, rgba(33, 166, 216, .16), transparent 42%),
		var(--kj-navy-dark);
	color: #f5fbff;
}

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

.footer-logo {
	display: inline-flex;
	align-items: center;
	margin-bottom: 8px;
	color: #fff;
}

.footer-logo-img {
	max-width: 180px;
	max-height: 70px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.footer-logo-text {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	padding: 5px 14px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 8px;
	background: rgba(255, 255, 255, .08);
	font-size: 1.35rem;
	font-weight: 900;
}

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

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

.footer-credit {
	margin-top: 4px;
	font-weight: 800;
}

.footer-credit a {
	color: #e7faff;
	border-bottom: 1px solid rgba(231, 250, 255, .45);
}

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

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

.search-form {
	display: flex;
	gap: 8px;
	margin: 16px 0;
}

.search-field {
	min-width: 0;
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--kj-line);
	border-radius: 7px;
	font: inherit;
}

.search-submit {
	border: 0;
	border-radius: 7px;
	padding: 10px 16px;
	background: var(--kj-navy);
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

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

	.header-date {
		order: 3;
		grid-column: 1 / -1;
		justify-self: stretch;
		justify-content: center;
		min-height: 32px;
		margin-bottom: 10px;
	}

	.brand {
		justify-self: start;
	}

	.brand-logo img { max-height: 66px; }

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

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

	.primary-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		box-shadow: 0 16px 28px rgba(9, 31, 56, .14);
	}

	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 16px 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-logo img { max-height: 58px; }

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

	.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: 11px; }

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

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

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

	.single-meta {
		gap: 6px;
		font-size: .82rem;
	}

	.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; }

}
