/**
 * Single post layout and article styling.
 *
 * Reclaimed from Elementor (PLAN_POSTS.md).
 * Loaded after directory-single.css, which supplies the shared shell
 * (breadcrumb, banners, TOC, comments, responsive variables).
 * Every selector here is scoped under `.post-single-main`.
 *
 * @package RayTheme
 */

/* Container Root
   ========================================================================== */

.post-single-main {
	direction: rtl;
	font-family: 'IRANYekanXFaNum', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Post Header & Meta Bar
   ========================================================================== */

.post-single-main .post-single-header {
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px 16px 20px 16px;
}

.post-single-main .post-single-title {
	color: #0d1329;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.6;
	margin: 0 0 16px 0;
}

.post-single-main .badge[data-label],
.badge[data-label] {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 8px;
}

.post-single-main .badge[data-label]::before,
.badge[data-label]::before {
	content: attr(data-label);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--yellow-500, #ffd305);
	color: var(--ink-900, #080f1d);
	font-size: 12px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 6px;
	line-height: 1.4;
}

.post-single-main .post-single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #eaeef5;
	font-size: 13px;
	color: #717684;
}

.post-single-main .post-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.post-single-main .post-meta-icon {
	color: #94a3b8;
	flex-shrink: 0;
}

.post-single-main .post-meta-author-wrap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.post-single-main .post-meta-avatar-wrap {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	overflow: hidden;
	background-color: #e2e8f0;
	flex-shrink: 0;
}

.post-single-main .post-meta-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.post-single-main .post-meta-author-name {
	color: #0d1329;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease;
}

.post-single-main .post-meta-author-name:hover {
	color: var(--ink-900, #080f1d);
}

.post-single-main .post-meta-category-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background-color: var(--blue-gray-50, #f1f4f9);
	color: var(--navy-700, #262d44);
	font-weight: 600;
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 9999px;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.post-single-main .post-meta-category-badge:hover {
	background-color: var(--ink-900, #080f1d);
	color: var(--yellow-500, #ffd305);
}

.post-single-main .post-meta-comments-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #717684;
	text-decoration: none;
	transition: color 0.15s ease;
}

.post-single-main .post-meta-comments-link:hover {
	color: #0d1329;
}

/* Two-Column Layout Grid
   ========================================================================== */

.post-single-main .post-single-layout {
	display: grid;
	grid-template-columns: 326px minmax(0, 1fr);
	align-items: start;
	gap: 24px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 16px 16px 0 16px;
}

/* Right Sidebar
   ========================================================================== */

.post-single-main .post-single-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
	align-self: stretch;
	min-width: 0;
}

.post-single-main .post-single-toc-sticky {
	position: -webkit-sticky;
	position: sticky;
	top: calc(var(--header-height, 82px) + var(--single-sticky-admin-offset, 0px) + 8px);
	z-index: 20;
}

.post-single-main .post-single-sidebar .banner-aside {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.post-single-main .post-single-sidebar .banner-aside a {
	display: block;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-single-main .post-single-sidebar .banner-aside a:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.post-single-main .post-single-sidebar .banner-aside img {
	width: 100%;
	height: auto;
	display: block;
}

/* Sidebar Latest Posts Widget (Hidden) */

.post-single-main .post-sidebar-widget {
	display: none !important;
	background-color: #ffffff;
	border: 1px solid #eaeef5;
	border-radius: 14px;
	padding: 18px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.post-single-main .post-sidebar-widget-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	color: #0d1329;
	margin: 0 0 14px 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #f1f5f9;
}

.post-single-main .post-sidebar-widget-title svg {
	color: #ffd305;
}

.post-single-main .post-sidebar-widget-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.post-single-main .post-sidebar-widget-item {
	margin: 0;
}

.post-single-main .post-sidebar-widget-link {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	padding: 6px;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.post-single-main .post-sidebar-widget-link:hover {
	background-color: #f8fafc;
}

.post-single-main .post-sidebar-widget-thumb {
	width: 64px;
	height: 48px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background-color: #f1f5f9;
}

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

.post-single-main .post-sidebar-widget-info {
	flex: 1;
	min-width: 0;
}

.post-single-main .post-sidebar-widget-post-title {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: #1e293b;
	margin: 0 0 4px 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.15s ease;
}

.post-single-main .post-sidebar-widget-link:hover .post-sidebar-widget-post-title {
	color: var(--ink-900, #080f1d);
}

.post-single-main .post-sidebar-widget-date {
	font-size: 11px;
	color: #94a3b8;
}

/* Left Main Content Area
   ========================================================================== */

.post-single-main .post-single-content-area {
	background-color: #ffffff;
	border: 1px solid #eaeef5;
	border-radius: 16px;
	padding: 28px 32px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
	min-width: 0;
}

/* Featured Image */

.post-single-main .post-single-featured-image {
	margin: 0 0 24px 0;
	border-radius: 14px;
	overflow: hidden;
	background-color: #f8fafc;
}

.post-single-main .post-single-thumb-img {
	width: 100%;
	height: auto;
	max-height: 480px;
	object-fit: cover;
	display: block;
}

.post-single-main .post-single-thumb-caption {
	padding: 8px 12px;
	font-size: 12px;
	color: #64748b;
	text-align: center;
	background-color: #f8fafc;
	border-top: 1px solid #f1f5f9;
}

/* Excerpt Lead Box */

.post-single-main .post-single-lead-excerpt {
	background-color: #f8fafc;
	border-right: 4px solid #ffd305;
	border-radius: 0 8px 8px 0;
	padding: 16px 20px;
	margin-bottom: 24px;
	color: #334155;
	font-size: 15px;
	line-height: 1.9;
	font-weight: 500;
}

.post-single-main .post-single-lead-excerpt p:last-child {
	margin-bottom: 0;
}

/* Main Article Content (Unified card-body-of-content)
   ========================================================================== */

.post-single-main .post-single-content-area .card-body-of-content {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

.post-single-main :is(h1, h2, h3, h4, h5, h6)[id] {
	scroll-margin-top: 100px;
}

/* Tags Cloud */

.post-single-main .post-single-tags-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid #edf2f7;
}

.post-single-main .post-tags-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #717684;
}

.post-single-main .post-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.post-single-main .post-tag-item {
	display: inline-block;
	background-color: #f1f5f9;
	color: #475569;
	font-size: 12px;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: 6px;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.post-single-main .post-tag-item:hover {
	background-color: #e2e8f0;
	color: #0f172a;
}

/* Social Share Bar */

.post-single-main .post-single-share-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 24px;
	padding: 16px 20px;
	background-color: #f8fafc;
	border: 1px solid #eaeef5;
	border-radius: 12px;
}

.post-single-main .post-share-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}

.post-single-main .post-share-buttons {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.post-single-main .post-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background-color: #ffffff;
	color: #64748b;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.15s ease;
}

.post-single-main .post-share-btn:hover {
	transform: translateY(-2px);
}

.post-single-main .post-share-btn.share-telegram:hover {
	background-color: #0088cc;
	border-color: #0088cc;
	color: #ffffff;
}

.post-single-main .post-share-btn.share-whatsapp:hover {
	background-color: #25d366;
	border-color: #25d366;
	color: #ffffff;
}

.post-single-main .post-share-btn.share-x:hover {
	background-color: #000000;
	border-color: #000000;
	color: #ffffff;
}

.post-single-main .post-share-btn.share-linkedin:hover {
	background-color: #0077b5;
	border-color: #0077b5;
	color: #ffffff;
}

.post-single-main .post-share-copy {
	width: auto;
	padding: 0 12px;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	color: #475569;
}

.post-single-main .post-share-copy:hover {
	background-color: #0d1329;
	border-color: #0d1329;
	color: #ffd305;
}

.post-single-main .post-share-copy.is-copied {
	background-color: #16a34a;
	border-color: #16a34a;
	color: #ffffff;
}

/* Related Articles Section
   ========================================================================== */

.post-single-main .post-single-related-section {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid #edf0f4;
}

.post-single-main .post-related-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 22px;
}

.post-single-main .post-related-title-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.post-single-main .post-related-accent-bar {
	width: 4px;
	height: 22px;
	background-color: var(--yellow-400, #ffd305);
	border-radius: 4px;
	display: inline-block;
	flex-shrink: 0;
}

.post-single-main .post-related-title {
	font-size: 19px;
	font-weight: 800;
	color: var(--ink-900, #080f1d);
	margin: 0;
	line-height: 1.35;
}

.post-single-main .post-related-more-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--gray-600, #6b6f77);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
}

.post-single-main .post-related-more-link:hover {
	color: var(--ink-900, #080f1d);
}

.post-single-main .post-related-more-icon {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.post-single-main .post-related-more-link:hover .post-related-more-icon {
	transform: translateX(-3px);
}

.post-single-main .post-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
}

.post-single-main .post-related-card {
	background-color: #ffffff;
	border: 1px solid #edf0f4;
	border-radius: 16px;
	padding: 0px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.02);
	display: flex;
	flex-direction: column;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
	position: relative;
	box-sizing: border-box;
}

.post-single-main .post-related-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(8, 15, 29, 0.08);
	border-color: var(--yellow-400, #ffd305);
}

.post-single-main .post-related-card-thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9.5;
	border-radius: 10px 10px 0px 0px;
	overflow: hidden;
	background-color: #f1f5f9;
}

.post-single-main .post-related-card-thumb-link {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	text-decoration: none;
}

.post-single-main .post-related-card-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.post-single-main .post-related-card:hover .post-related-card-thumb-img {
	transform: scale(1.05);
}

.post-single-main .post-related-card-no-thumb {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	color: #94a3b8;
}

.post-single-main .post-related-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	margin: 18px 14px 14px 14px;
	padding: 0;
}

.post-single-main .post-related-card-cat-wrap {
	margin-bottom: 8px;
}

.post-single-main .post-related-card-cat {
	display: inline-flex;
	align-items: center;
	background-color: var(--blue-gray-50, #f1f4f9);
	color: var(--navy-700, #262d44);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0;
	padding: 2.5px 8px;
	border-radius: 5px;
	text-decoration: none;
	width: fit-content;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.post-single-main .post-related-card-cat:hover {
	background-color: var(--ink-900, #080f1d);
	color: var(--yellow-500, #ffd305);
}

.post-single-main .post-related-card-title {
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.6;
	color: #17181b;
	margin: 0 0 12px 0;
	min-height: 46px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: right;
}

.post-single-main .post-related-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.post-single-main .post-related-card:hover .post-related-card-title a {
	color: var(--ink-900, #080f1d);
}

.post-single-main .post-related-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
	padding-top: 11px;
	border-top: 1px solid #f1f5f9;
	font-size: 11.5px;
	color: #64748b;
}

.post-single-main .post-related-card-date,
.post-single-main .post-related-card-reading {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.post-single-main .post-related-card-meta .meta-icon {
	color: #94a3b8;
	flex-shrink: 0;
	margin-bottom: 2px;
}

.post-single-main .post-related-read-more {
	margin-top: 12px;
	height: 38px;
	border-radius: 9px;
	background-color: var(--blue-gray-50, #f1f4f9);
	border: 1px solid #e2e8f0;
	color: var(--ink-900, #080f1d);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.post-single-main .post-related-card:hover .post-related-read-more {
	background-color: var(--ink-900, #080f1d);
	border-color: var(--ink-900, #080f1d);
	color: var(--yellow-500, #ffd305);
	box-shadow: 0 4px 14px rgba(8, 15, 29, 0.15);
}

.post-single-main .post-related-read-more .arrow-icon {
	transition: transform 0.2s ease;
}

.post-single-main .post-related-card:hover .post-related-read-more .arrow-icon {
	transform: translateX(-4px);
}

/* Comments Section Shell
   ========================================================================== */

.post-single-main .post-single-comments {
	max-width: 1400px;
	margin: 36px auto 0 auto;
	padding: 0 16px;
}

/* Discussion / Article Mode in comments-directory */

.comments-section-discussion-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 20px 16px;
	gap: 12px;
}

.comments-section-discussion-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: #f0f4fa;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1d2542;
}

/* Responsive Media Queries
   ========================================================================== */

@media screen and (max-width: 1100px) {
	.post-single-main .post-single-layout {
		grid-template-columns: 1fr;
	}

	.post-single-main .post-single-sidebar {
		order: 2;
	}

	.post-single-main .post-single-content-area {
		order: 1;
	}

	.post-single-main .post-single-sidebar .post-single-toc,
	.post-single-main .post-single-toc-sticky {
		display: none; /* Mobile TOC trigger & drawer take over */
	}
}

@media screen and (max-width: 768px) {
	.post-single-main .post-single-featured-image {
		display: none !important;
	}

	.post-single-main .post-single-title {
		font-size: 20px;
		line-height: 1.6;
	}

	.post-single-main .post-single-meta {
		gap: 10px 14px;
		font-size: 12px;
	}

	.post-single-main .post-single-content-area {
	    border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
	}

	.post-single-main .post-single-body-content {
		font-size: 15px;
		line-height: 2.0;
	}

	.post-single-main .post-single-share-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.post-single-main .post-share-buttons {
		justify-content: space-between;
	}

	.post-single-main .post-single-related-section {
		margin-top: 36px;
		padding-top: 24px;
	}

	.post-single-main .post-related-header {
		margin-bottom: 18px;
	}

	.post-single-main .post-related-title {
		font-size: 17px;
	}

	.post-single-main .post-related-more-link {
		font-size: 12px;
	}

	.post-single-main .post-related-card-title {
		min-height: auto;
		font-size: 14px;
	}

	.post-single-main .post-related-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.post-single-main .post-related-card {
		padding: 12px;
	}
}
