/* خوش‌کده — main stylesheet */

:root {
	--khosh-purple: #2b1650;
	--khosh-purple-mid: #3d2270;
	--khosh-purple-soft: #5b3a9a;
	--khosh-orange: #f15a24;
	--khosh-orange-hot: #ff7a3d;
	--khosh-yellow: #ffc94a;
	--khosh-blue: #4eb6ff;
	--khosh-ink: #1a1230;
	--khosh-muted: #6b6280;
	--khosh-line: rgba(43, 22, 80, 0.1);
	--khosh-bg: #f6f2fb;
	--khosh-bg-warm: #faf7fc;
	--khosh-surface: #ffffff;
	--khosh-radius: 18px;
	--khosh-radius-sm: 12px;
	--khosh-shadow: 0 12px 40px rgba(43, 22, 80, 0.08);
	--khosh-shadow-sm: 0 4px 18px rgba(43, 22, 80, 0.06);
	--khosh-container: 1120px;
	--khosh-font: "Vazirmatn", Tahoma, sans-serif;
	--khosh-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--khosh-font);
	font-size: 1rem;
	line-height: 1.75;
	color: var(--khosh-ink);
	background:
		radial-gradient(1200px 500px at 100% -10%, rgba(241, 90, 36, 0.08), transparent 55%),
		radial-gradient(900px 420px at 0% 0%, rgba(78, 182, 255, 0.07), transparent 50%),
		linear-gradient(180deg, var(--khosh-bg-warm), var(--khosh-bg) 40%, #f3eef9);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--khosh-purple-mid);
	text-decoration: none;
	transition: color 0.2s var(--khosh-ease);
}

a:hover {
	color: var(--khosh-orange);
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.35;
	font-weight: 750;
	color: var(--khosh-purple);
	margin: 0 0 0.6em;
}

p {
	margin: 0 0 1em;
}

.container {
	width: min(100% - 2rem, var(--khosh-container));
	margin-inline: auto;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	background: var(--khosh-orange);
	color: #fff;
	padding: 0.75rem 1rem;
	z-index: 100000;
	inset-inline-start: 1rem;
	top: 1rem;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: linear-gradient(180deg, var(--khosh-purple) 0%, #241245 100%);
	color: #fff;
	box-shadow: 0 8px 28px rgba(43, 22, 80, 0.28);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
	min-height: 76px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}

.brand .custom-logo-link,
.site-logo-link,
.brand .custom-logo-link img,
.site-logo {
	display: block;
}

.brand .custom-logo-link img,
.site-logo {
	width: auto;
	height: 56px;
	object-fit: contain;
	background: #fff;
	border-radius: 14px;
	padding: 4px 8px;
}

.brand-text {
	min-width: 0;
}

.site-title {
	margin: 0;
	font-size: clamp(1.15rem, 2.4vw, 1.55rem);
	font-weight: 800;
	letter-spacing: -0.02em;
}

.site-title a {
	color: #fff;
}

.site-title a:hover {
	color: var(--khosh-yellow);
}

.site-tagline {
	margin: 0.15rem 0 0;
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.72);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 280px;
}

.primary-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav .menu > li > a {
	display: block;
	padding: 0.55rem 0.85rem;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 999px;
	position: relative;
}

.primary-nav .menu > li > a::after {
	content: "";
	position: absolute;
	inset-inline: 0.85rem;
	bottom: 0.35rem;
	height: 2px;
	background: var(--khosh-orange);
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform 0.25s var(--khosh-ease);
}

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

.primary-nav .menu > li > a:hover::after,
.primary-nav .menu > li.current-menu-item > a::after {
	transform: scaleX(1);
}

.primary-nav .sub-menu {
	display: none;
}

.header-search {
	display: flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	overflow: hidden;
	min-width: 170px;
}

.header-search input {
	border: 0;
	background: transparent;
	color: #fff;
	padding: 0.55rem 0.9rem;
	width: 100%;
	font: inherit;
	outline: none;
}

.header-search input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

.header-search button {
	border: 0;
	background: transparent;
	color: #fff;
	padding: 0.45rem 0.8rem;
	cursor: pointer;
}

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	padding: 0;
}

.nav-toggle-bar {
	display: block;
	width: 18px;
	height: 2px;
	margin-inline: auto;
	background: #fff;
	border-radius: 2px;
	transition: transform 0.25s var(--khosh-ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
	opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Buttons & chips */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.7rem 1.25rem;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	border: 0;
	cursor: pointer;
	transition: transform 0.2s var(--khosh-ease), background 0.2s, box-shadow 0.2s;
}

.btn-accent {
	background: linear-gradient(135deg, var(--khosh-orange), var(--khosh-orange-hot));
	color: #fff !important;
	box-shadow: 0 8px 22px rgba(241, 90, 36, 0.28);
}

.btn-accent:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(241, 90, 36, 0.36);
	color: #fff !important;
}

.chip {
	display: inline-flex;
	align-items: center;
	padding: 0.28rem 0.75rem;
	border-radius: 999px;
	background: rgba(241, 90, 36, 0.12);
	color: var(--khosh-orange);
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: 0.65rem;
}

.chip:hover {
	background: rgba(241, 90, 36, 0.2);
	color: var(--khosh-orange);
}

.chip-sm {
	font-size: 0.75rem;
	padding: 0.2rem 0.65rem;
}

.meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	color: var(--khosh-muted);
	font-size: 0.85rem;
}

.meta .dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--khosh-muted);
	opacity: 0.5;
}

/* Hero */
.home-magazine {
	padding-bottom: 3rem;
}

.hero-section {
	padding: 1.75rem 0 0.5rem;
}

.hero-card {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: 0;
	overflow: hidden;
	border-radius: calc(var(--khosh-radius) + 4px);
	background: var(--khosh-surface);
	box-shadow: var(--khosh-shadow);
	min-height: 360px;
}

.hero-media {
	position: relative;
	display: block;
	overflow: hidden;
	min-height: 360px;
	aspect-ratio: 1200 / 640;
	background: linear-gradient(135deg, var(--khosh-purple), var(--khosh-purple-soft));
}

.hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s var(--khosh-ease);
}

.hero-card:hover .hero-media img {
	transform: scale(1.04);
}

.hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 55%, rgba(43, 22, 80, 0.15));
	pointer-events: none;
}

.hero-body {
	padding: clamp(1.25rem, 3vw, 2.25rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.hero-title {
	font-size: clamp(1.35rem, 2.8vw, 2rem);
	margin: 0 0 0.75rem;
}

.hero-title a {
	color: var(--khosh-purple);
}

.hero-title a:hover {
	color: var(--khosh-orange);
}

.hero-excerpt {
	color: var(--khosh-muted);
	margin-bottom: 1rem;
}

.hero-body .meta {
	margin-bottom: 1.25rem;
}

.hero-body .btn {
	align-self: flex-start;
}

.media-placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 201, 74, 0.35), transparent 40%),
		radial-gradient(circle at 70% 40%, rgba(78, 182, 255, 0.3), transparent 42%),
		linear-gradient(145deg, var(--khosh-purple-mid), var(--khosh-purple));
}

.hero-placeholder {
	aspect-ratio: auto;
	height: 100%;
	min-height: 360px;
}

/* Sections */
.category-section,
.latest-section {
	padding: 2rem 0 0.5rem;
}

.section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.15rem;
}

.section-title {
	margin: 0;
	font-size: clamp(1.2rem, 2vw, 1.5rem);
	position: relative;
	padding-inline-start: 0.85rem;
}

.section-title::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.25em;
	bottom: 0.25em;
	width: 4px;
	border-radius: 4px;
	background: linear-gradient(180deg, var(--khosh-orange), var(--khosh-yellow));
}

.section-more {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--khosh-purple-soft);
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	white-space: nowrap;
}

.section-more:hover {
	color: var(--khosh-orange);
}

/* Cards grid */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.15rem;
}

.posts-grid-3 {
	grid-template-columns: repeat(3, 1fr);
}

.post-card {
	background: var(--khosh-surface);
	border-radius: var(--khosh-radius);
	overflow: hidden;
	box-shadow: var(--khosh-shadow-sm);
	border: 1px solid var(--khosh-line);
	display: flex;
	flex-direction: column;
	transition: transform 0.3s var(--khosh-ease), box-shadow 0.3s var(--khosh-ease);
}

.post-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--khosh-shadow);
}

.card-media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--khosh-purple);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--khosh-ease);
}

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

.card-body {
	padding: 1rem 1.05rem 1.15rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-title {
	font-size: 1.02rem;
	margin: 0 0 0.5rem;
}

.card-title a {
	color: var(--khosh-purple);
}

.card-title a:hover {
	color: var(--khosh-orange);
}

.card-excerpt {
	color: var(--khosh-muted);
	font-size: 0.9rem;
	margin: 0 0 0.85rem;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Layout with sidebar */
.site-main {
	padding: 1.5rem 0 3rem;
}

.home .site-main,
.home-magazine {
	padding-top: 0;
}

.home .site-main {
	padding: 0 0 1rem;
}

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

.page-header {
	margin-bottom: 1.5rem;
}

.page-title {
	font-size: clamp(1.4rem, 2.5vw, 1.9rem);
	margin: 0;
}

.page-title span {
	color: var(--khosh-orange);
}

.archive-description {
	color: var(--khosh-muted);
	margin-top: 0.5rem;
}

/* Single */
.single-article {
	background: var(--khosh-surface);
	border-radius: var(--khosh-radius);
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: var(--khosh-shadow-sm);
	border: 1px solid var(--khosh-line);
}

.single-title {
	font-size: clamp(1.5rem, 3vw, 2.15rem);
	margin: 0.35rem 0 0.85rem;
}

.single-thumb {
	margin: 1.25rem 0 1.5rem;
	border-radius: var(--khosh-radius-sm);
	overflow: hidden;
	aspect-ratio: 1200 / 640;
	background: var(--khosh-purple);
}

.single-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.entry-content {
	font-size: 1.05rem;
	line-height: 1.9;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 1.6em;
}

.entry-content img {
	border-radius: var(--khosh-radius-sm);
}

.entry-content a {
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 100% 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition: background-size 0.25s var(--khosh-ease), color 0.2s;
}

.entry-content a:hover {
	background-size: 100% 1px;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--khosh-line);
}

.tag {
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: var(--khosh-bg);
	color: var(--khosh-purple-soft);
	font-size: 0.85rem;
	font-weight: 600;
}

.tag:hover {
	background: rgba(241, 90, 36, 0.12);
	color: var(--khosh-orange);
}

.related-posts {
	margin-top: 2.5rem;
}

.related-posts .section-title {
	margin-bottom: 1rem;
}

/* Sidebar */
.sidebar .widget {
	background: var(--khosh-surface);
	border: 1px solid var(--khosh-line);
	border-radius: var(--khosh-radius);
	padding: 1.15rem 1.2rem;
	margin-bottom: 1.15rem;
	box-shadow: var(--khosh-shadow-sm);
}

.widget-title {
	font-size: 1rem;
	margin: 0 0 0.85rem;
	padding-bottom: 0.55rem;
	border-bottom: 2px solid rgba(241, 90, 36, 0.25);
}

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

.sidebar li {
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--khosh-line);
}

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

/* Search form */
.search-form {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.search-field {
	flex: 1;
	min-width: 180px;
	padding: 0.7rem 1rem;
	border: 1px solid var(--khosh-line);
	border-radius: 999px;
	font: inherit;
	background: #fff;
	outline: none;
}

.search-field:focus {
	border-color: var(--khosh-orange);
	box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.15);
}

/* Pagination */
.pagination {
	margin-top: 2rem;
}

.pagination .page-numbers {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	justify-content: center;
}

.pagination .page-numbers a,
.pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.65rem;
	border-radius: 12px;
	background: var(--khosh-surface);
	border: 1px solid var(--khosh-line);
	color: var(--khosh-purple);
	font-weight: 700;
}

.pagination .page-numbers .current,
.pagination .page-numbers a:hover {
	background: var(--khosh-purple);
	border-color: var(--khosh-purple);
	color: #fff;
}

/* Comments */
.comments-area {
	margin-top: 2.5rem;
	background: var(--khosh-surface);
	border-radius: var(--khosh-radius);
	padding: 1.5rem;
	border: 1px solid var(--khosh-line);
}

.comment-list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}

.comment-body {
	padding: 1rem 0;
	border-bottom: 1px solid var(--khosh-line);
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid var(--khosh-line);
	border-radius: var(--khosh-radius-sm);
	font: inherit;
	margin-bottom: 0.75rem;
}

/* Empty / 404 */
.no-results,
.error-404 {
	text-align: center;
	padding: 3rem 1rem;
	max-width: 560px;
	margin-inline: auto;
}

.error-code {
	font-size: clamp(4rem, 12vw, 7rem);
	font-weight: 900;
	line-height: 1;
	margin: 0;
	background: linear-gradient(135deg, var(--khosh-purple), var(--khosh-orange));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.no-results-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

/* Footer */
.site-footer {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #241245, var(--khosh-purple));
	color: rgba(255, 255, 255, 0.85);
	padding: 2.75rem 0 2rem;
	margin-top: 1rem;
}

.footer-glow {
	position: absolute;
	width: 420px;
	height: 420px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(241, 90, 36, 0.22), transparent 65%);
	inset-inline-end: -80px;
	top: -120px;
	pointer-events: none;
}

.footer-inner {
	position: relative;
	display: grid;
	gap: 1.5rem;
	text-align: center;
	justify-items: center;
}

.footer-logo-link img {
	width: 96px;
	height: auto;
	background: #fff;
	border-radius: 16px;
	padding: 6px 10px;
	margin-inline: auto;
}

.footer-title {
	margin: 0.65rem 0 0.2rem;
	font-size: 1.25rem;
	font-weight: 800;
	color: #fff;
}

.footer-tagline {
	margin: 0;
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.92rem;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-menu a {
	color: rgba(255, 255, 255, 0.8);
	font-weight: 600;
}

.footer-menu a:hover {
	color: var(--khosh-yellow);
}

.copyright {
	margin: 0;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.55);
}

.copyright a {
	color: #fff;
}

/* Reveal motion */
.reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.55s var(--khosh-ease), transform 0.55s var(--khosh-ease);
}

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	html {
		scroll-behavior: auto;
	}

	.hero-media img,
	.card-media img,
	.post-card {
		transition: none;
	}
}

/* Responsive */
@media (max-width: 1024px) {
	.posts-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.posts-grid-3 {
		grid-template-columns: repeat(2, 1fr);
	}

	.hero-card {
		grid-template-columns: 1fr;
	}

	.hero-media,
	.hero-placeholder {
		min-height: 240px;
	}

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

@media (max-width: 768px) {
	.site-tagline {
		display: none;
	}

	.nav-toggle {
		display: flex;
	}

	.primary-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
		padding: 1rem 1rem 1.25rem;
		background: #241245;
		border-top: 1px solid rgba(255, 255, 255, 0.08);
		box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
	}

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

	.primary-nav .menu {
		flex-direction: column;
		align-items: stretch;
	}

	.primary-nav .menu > li > a {
		border-radius: 12px;
	}

	.header-search {
		width: 100%;
	}

	.site-header {
		position: relative;
	}

	.header-inner {
		position: relative;
	}
}

@media (max-width: 560px) {
	.posts-grid,
	.posts-grid-3 {
		grid-template-columns: 1fr;
	}

	.brand .custom-logo-link img,
	.site-logo {
		height: 48px;
	}
}
