/**
 * صفحة المقال الواحد — typography، مشاركة، FAQ، TOC، تعليقات، متجاوب.
 */

:root {
	--fnh-s-forest: #1b4332;
	--fnh-s-mid: #2d6a4f;
	--fnh-s-soft: #40916c;
	--fnh-s-bg: #f8faf8;
	--fnh-s-paper: #ffffff;
	--fnh-s-muted: #4a5568;
	--fnh-s-border: rgba(27, 67, 50, 0.12);
	--fnh-s-prose: clamp(320px, 100%, 720px);
}

.fnh-single {
	font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	background: var(--fnh-s-bg);
	color: #1a1a1a;
	padding-bottom: 3rem;
}

.fnh-single a:focus-visible,
.fnh-single button:focus-visible {
	outline: 3px solid var(--fnh-s-soft);
	outline-offset: 2px;
}

.fnh-single__breadcrumb {
	max-width: min(900px, 100% - 2rem);
	margin: 0 auto;
	padding: 1rem 1rem 0;
	font-size: 0.875rem;
	color: var(--fnh-s-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.fnh-single__breadcrumb a {
	color: var(--fnh-s-mid);
	text-decoration: none;
	font-weight: 500;
}

.fnh-single__breadcrumb a:hover {
	text-decoration: underline;
}

.fnh-single__breadcrumb-sep {
	opacity: 0.5;
	user-select: none;
}

.fnh-single__breadcrumb-current {
	color: var(--fnh-s-forest);
	font-weight: 600;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.fnh-single__breadcrumb-current {
		white-space: normal;
	}
}

.fnh-single .post-wrapper {
	max-width: min(900px, 100% - 2rem);
	margin: 0 auto;
	padding: 1.25rem 1rem 3rem;
	line-height: 1.75;
}

.fnh-single__media {
	margin: 0 0 1.5rem;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(27, 67, 50, 0.12);
	background: linear-gradient(135deg, #e9ecef, #dee2e6);
	aspect-ratio: 16 / 9;
}

.fnh-single__media img,
.fnh-single__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fnh-single__article-header {
	margin-bottom: 1.5rem;
}

.fnh-single .post-title {
	font-size: clamp(1.75rem, 4.5vw, 2.5rem);
	font-weight: 700;
	color: var(--fnh-s-forest);
	margin: 0 0 0.75rem;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.fnh-single .post-meta {
	font-size: 0.9375rem;
	color: var(--fnh-s-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.fnh-single .post-meta a {
	color: var(--fnh-s-mid);
	font-weight: 600;
	text-decoration: none;
}

.fnh-single .post-meta a:hover {
	text-decoration: underline;
}

.fnh-single .post-meta time {
	font-variant-numeric: tabular-nums;
}

.fnh-single .post-categories {
	font-size: 0.875rem;
	margin-bottom: 1.5rem;
}

.fnh-single .post-categories a {
	color: var(--fnh-s-mid);
	font-weight: 600;
	text-decoration: none;
	margin-right: 0.35rem;
}

.fnh-single .post-categories a:hover {
	text-decoration: underline;
}

.fnh-single .post-content.fnh-prose,
.fnh-single .post-content {
	font-size: clamp(1rem, 2.2vw, 1.125rem);
	max-width: var(--fnh-s-prose);
	color: #2d3748;
}

.fnh-single .post-content.fnh-prose > *:first-child,
.fnh-single .post-content > *:first-child {
	margin-top: 0;
}

.fnh-single .post-content h2,
.fnh-single .post-content h3,
.fnh-single .post-content h4 {
	color: var(--fnh-s-forest);
	margin-top: 1.75em;
	margin-bottom: 0.5em;
	line-height: 1.25;
}

.fnh-single .post-content h2 {
	font-size: 1.5rem;
}

.fnh-single .post-content h3 {
	font-size: 1.25rem;
}

.fnh-single .post-content p {
	margin-bottom: 1.15em;
}

.fnh-single .post-content a {
	color: var(--fnh-s-mid);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fnh-single .post-content a:hover {
	color: var(--fnh-s-forest);
}

.fnh-single .post-content img,
.fnh-single .post-content video {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.fnh-single .post-content blockquote {
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--fnh-s-soft);
	background: rgba(64, 145, 108, 0.08);
	border-radius: 0 10px 10px 0;
	font-style: italic;
	color: var(--fnh-s-muted);
}

.fnh-single .post-content ul,
.fnh-single .post-content ol {
	padding-left: 1.35rem;
	margin-bottom: 1.15em;
}

.fnh-single .post-content li {
	margin-bottom: 0.35em;
}

.fnh-single .post-tags {
	margin-top: 2.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--fnh-s-border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.fnh-single .post-tags > strong,
.fnh-single .post-tags__label {
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fnh-s-muted);
	margin-right: 0.25rem;
}

.fnh-single .post-tags__link,
.fnh-single .post-tags a {
	display: inline-flex;
	padding: 0.4rem 0.85rem;
	background: rgba(64, 145, 108, 0.12);
	color: var(--fnh-s-forest);
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.fnh-single .post-tags__link:hover,
.fnh-single .post-tags a:hover {
	background: var(--fnh-s-mid);
	color: #fff;
}

.fnh-single .share-buttons {
	margin-top: 1.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.fnh-single .share-buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--fnh-s-mid), var(--fnh-s-forest));
	color: #fff;
	font-size: 1rem;
	text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s;
}

.fnh-single .share-buttons a:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(45, 106, 79, 0.35);
	color: #fff;
}

.fnh-single .related-posts {
	margin-top: 3rem;
	padding-top: 2.5rem;
	border-top: 1px solid var(--fnh-s-border);
}

.fnh-single .related-posts h2 {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--fnh-s-forest);
	margin: 0 0 1.25rem;
}

.fnh-single .related-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 600px) {
	.fnh-single .related-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 860px) {
	.fnh-single .related-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.fnh-single .related-item {
	background: var(--fnh-s-paper);
	border: 1px solid var(--fnh-s-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(27, 67, 50, 0.06);
	transition: transform 0.2s, box-shadow 0.2s;
}

.fnh-single .related-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(27, 67, 50, 0.1);
}

.fnh-single .related-item a {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.fnh-single .related-item__thumb {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #e9ecef;
}

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

.fnh-single .related-item__thumb--empty {
	min-height: 140px;
	background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.fnh-single .fnh-single__no-related {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--fnh-s-muted);
	margin: 0;
}

.fnh-single .related-item__title {
	padding: 1rem 1.1rem 1.15rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fnh-s-forest);
	line-height: 1.35;
}

.fnh-single .faq-section {
	margin-top: 2.5rem;
	padding: 1.5rem 1.25rem;
	background: var(--fnh-s-paper);
	border: 1px solid var(--fnh-s-border);
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(27, 67, 50, 0.06);
}

.fnh-single .faq-section h2 {
	color: var(--fnh-s-forest);
	margin-bottom: 1rem;
	font-size: 1.25rem;
}

.fnh-single .faq-item {
	margin-bottom: 0.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px dashed rgba(64, 145, 108, 0.35);
	cursor: pointer;
}

.fnh-single .faq-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.fnh-single .faq-item h3 {
	margin: 0;
	font-size: 1rem;
	color: var(--fnh-s-mid);
	font-weight: 700;
	position: relative;
	padding-right: 1.5rem;
}

.fnh-single .faq-item h3::after {
	content: "+";
	position: absolute;
	right: 0;
	font-weight: bold;
	color: var(--fnh-s-soft);
}

.fnh-single .faq-item.open h3::after {
	content: "−";
}

.fnh-single .faq-item p {
	display: none;
	margin: 0.75rem 0 0;
	color: #2d3748;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.fnh-single .faq-item.open p {
	display: block;
}

.fnh-single .table-of-contents {
	border: 1px solid var(--fnh-s-border);
	border-radius: 14px;
	padding: 1.25rem 1.35rem;
	background: linear-gradient(135deg, rgba(64, 145, 108, 0.08), rgba(233, 236, 239, 0.5));
	margin-bottom: 1.75rem;
}

.fnh-single .table-of-contents h3 {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
	color: var(--fnh-s-forest);
	font-weight: 700;
}

.fnh-single .table-of-contents ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fnh-single .table-of-contents li {
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px dashed rgba(64, 145, 108, 0.25);
}

.fnh-single .table-of-contents li:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.fnh-single .table-of-contents a {
	color: var(--fnh-s-mid);
	font-weight: 600;
	text-decoration: none;
	font-size: 0.9375rem;
}

.fnh-single .table-of-contents a:hover {
	text-decoration: underline;
}

.fnh-single .modal {
	display: none;
	position: fixed;
	z-index: 10050;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	padding: 2rem 1rem;
	background: rgba(0, 0, 0, 0.55);
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
}

.fnh-single .modal[style*="block"] {
	display: flex;
}

.fnh-single .modal-content {
	background: #fdfcf9;
	margin: auto;
	padding: 1.75rem;
	border-radius: 16px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	text-align: center;
	position: relative;
}

.fnh-single .modal-content input[type="email"] {
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
	border: 1px solid var(--fnh-s-border);
	border-radius: 10px;
	font-size: 1rem;
	box-sizing: border-box;
}

.fnh-single .modal-content button {
	background: var(--fnh-s-mid);
	color: #fff;
	padding: 0.65rem 1.5rem;
	border: none;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
	font-size: 1rem;
}

.fnh-single .modal .close {
	position: absolute;
	right: 12px;
	top: 8px;
	color: var(--fnh-s-mid);
	font-size: 1.5rem;
	font-weight: bold;
	cursor: pointer;
	line-height: 1;
	background: none;
	border: none;
	padding: 4px 8px;
}

.single-post .custom-comments-wrapper {
	max-width: min(700px, 100% - 2rem);
	margin: 3rem auto 0;
	padding: 1.5rem 1.25rem;
	background: var(--fnh-s-paper);
	border: 1px solid var(--fnh-s-border);
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(27, 67, 50, 0.05);
}

.single-post .custom-comments-wrapper h2 {
	text-align: center;
	font-size: 1.25rem;
	color: var(--fnh-s-forest);
	margin: 0 0 1.25rem;
}

.single-post #custom-comment-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.single-post #custom-comment-form input[type="text"],
.single-post #custom-comment-form textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	border: 1px solid var(--fnh-s-border);
	border-radius: 10px;
	background: #fff;
	box-sizing: border-box;
	font-family: inherit;
}

.single-post #custom-comment-form textarea {
	min-height: 120px;
	resize: vertical;
}

.single-post #custom-comment-form button {
	align-self: flex-start;
	padding: 0.75rem 1.5rem;
	background: var(--fnh-s-mid);
	color: #fff;
	border: none;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.single-post #custom-comment-form button:hover {
	background: var(--fnh-s-forest);
}

.single-post #loading-dots {
	display: inline-block;
	margin-left: 8px;
	visibility: hidden;
}

.single-post #loading-dots span {
	animation: fnh-blink 1s infinite;
	font-size: 1.25rem;
	line-height: 0;
}

.single-post #loading-dots span:nth-child(2) {
	animation-delay: 0.2s;
}

.single-post #loading-dots span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes fnh-blink {
	0%,
	20% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.single-post #loading-dots span {
		animation: none;
	}
}

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

.single-post .comment-list li {
	margin-bottom: 1rem;
	padding: 1rem;
	border: 1px dashed rgba(64, 145, 108, 0.35);
	border-radius: 12px;
	background: rgba(248, 250, 248, 0.8);
}

.single-post .comment-author {
	font-weight: 700;
	color: var(--fnh-s-forest);
}

.single-post .comment-meta {
	font-size: 0.8125rem;
	color: var(--fnh-s-muted);
	margin-bottom: 0.35rem;
}

.single-post .comment-content {
	font-size: 0.9375rem;
	color: #2d3748;
	line-height: 1.55;
}

@media (max-width: 600px) {
	.single-post .custom-comments-wrapper {
		margin-top: 2rem;
		padding: 1.25rem 1rem;
	}

	.single-post #custom-comment-form button {
		width: 100%;
		text-align: center;
	}
}
