﻿/* Single Post Page (.sp-*) */
/* SINGLE POST PAGE  (sp-*) */

.single-post-wrap {
	width: 100%;
}

/* 2-Column Layout: Main + Sidebar */
.sp-layout {
	display: flex;
	gap: 40px;
	padding-top: 0;
	padding-bottom: 40px;
	max-width: 800px;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.sp-layout {
		max-width: 1200px;
	}
}

.sp-main {
	flex: 1;
	min-width: 0;
}

.sp-sidebar {
	max-width: 400px;
	flex: 0 1 400px;
	display: none;
	background: #ffffff;
}

@media (min-width: 1024px) {
	.sp-sidebar {
		display: block;
	}
}

.sp-sidebar__sticky {
	position: sticky;
	top: calc(var(--nav-h) + 20px);
}

/* BREADCRUMB */
.sp-breadcrumb {
	padding: 14px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	max-width: 800px;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.sp-breadcrumb {
		max-width: 1200px;
	}
}

.sp-breadcrumb__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #6b7280;
}

.sp-breadcrumb__nav a {
	color: #123e8a;
	text-decoration: none;
}

.sp-breadcrumb__nav a:hover {
	text-decoration: underline;
}

.sp-breadcrumb__sep {
	color: #d1d5db;
}

.sp-breadcrumb__current {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ARTICLE HEADER */
.sp-header {
	padding: 36px 0 28px;
}

.sp-header__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.sp-badge {
	display: inline-block;
	padding: 3px 11px;
	background: #eef2ff;
	color: #123e8a;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.2s;
}

.sp-badge:hover {
	background: #dbeafe;
}

.sp-header__title {
	font-size: clamp(22px, 4vw, 36px);
	font-weight: 800;
	line-height: 1.25;
	color: #111827;
	letter-spacing: -0.02em;
	margin-bottom: 16px;
}

.sp-header__excerpt {
	font-size: 17px;
	line-height: 1.7;
	color: #4b5563;
	font-style: italic;
	border-left: 3px solid #123e8a;
	padding-left: 14px;
	margin-bottom: 24px;
}

/* Meta bar */
.sp-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding-top: 18px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sp-meta__author {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sp-meta__avatar {
	width: 38px !important;
	height: 38px !important;
	border-radius: 50%;
	object-fit: cover;
}

.sp-meta__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sp-meta__name {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
}

.sp-meta__sub {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: #6b7280;
}

.sp-meta__dot {
	opacity: 0.4;
}

.sp-meta__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sp-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	color: #374151;
	transition:
		background 0.2s,
		border-color 0.2s;
}

.sp-action-btn:hover {
	background: var(--bg-gray-100);
	border-color: rgba(0, 0, 0, 0.22);
}

/* FEATURED IMAGE */
.sp-featured-img {
	margin-bottom: 4px;
}

.sp-featured-img__img {
	width: 100%;
	max-height: 500px;
	object-fit: cover;
	border-radius: 12px;
	display: block;
}

.sp-featured-img__caption {
	text-align: center;
	font-size: 13px;
	color: #9ca3af;
	font-style: italic;
	margin-top: 8px;
}

/* BODY GRID  (TOC sidebar + entry content) */
.sp-body {
	padding: 40px 0;
}

.sp-body__grid {
	position: relative;
}

/* TOC sidebar — hidden by default, shown on very wide screens */
.sp-toc {
	display: none;
}

@media (min-width: 1400px) {
	.sp-toc {
		display: block;
		position: absolute;
		left: -240px;
		top: 0;
		width: 210px;
	}

	.sp-toc__sticky {
		position: sticky;
		top: calc(var(--nav-h) + 20px);
	}
}

.sp-toc__label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #9ca3af;
	margin-bottom: 10px;
}

.sp-toc__links {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sp-toc__link {
	display: block;
	font-size: 13px;
	line-height: 1.45;
	color: #6b7280;
	text-decoration: none;
	padding: 5px 10px;
	border-left: 2px solid transparent;
	border-radius: 0 4px 4px 0;
	transition:
		color 0.18s,
		border-color 0.18s,
		background 0.18s;
}

.sp-toc__link--sub {
	padding-left: 20px;
	font-size: 12px;
}

.sp-toc__link:hover,
.sp-toc__link.is-active {
	color: #123e8a;
	border-left-color: #123e8a;
	background: #eef2ff;
}

/* ENTRY CONTENT TYPOGRAPHY */
.sp-entry {
	font-size: 17px;
	line-height: 1.85;
	color: #1f2937;
	min-width: 0;
}

.sp-entry h2 {
	font-size: 23px;
	font-weight: 800;
	color: #111827;
	margin: 2em 0 0.6em;
	padding-bottom: 10px;
	border-bottom: 2px solid #e5e7eb;
	letter-spacing: -0.01em;
}

.sp-entry h3 {
	font-size: 19px;
	font-weight: 700;
	color: #1f2937;
	margin: 1.6em 0 0.5em;
}

.sp-entry h4 {
	font-size: 17px;
	font-weight: 700;
	color: #374151;
	margin: 1.4em 0 0.4em;
}

.sp-entry p {
	margin-bottom: 1.4em;
}

.sp-entry a {
	color: #123e8a;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sp-entry a:hover {
	opacity: 0.75;
}

.sp-entry img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 1.4em auto;
	display: block;
}

.sp-entry figure {
	margin: 1.8em auto;
	text-align: center;
}

.sp-entry figcaption {
	text-align: center;
	font-size: 13px;
	font-style: italic;
	color: #9ca3af;
	margin-top: 6px;
}

.sp-entry blockquote {
	margin: 2em 0;
	padding: 18px 22px;
	background: #f0f4ff;
	border-left: 4px solid #123e8a;
	border-radius: 0 8px 8px 0;
	font-style: italic;
	font-size: 18px;
	color: #374151;
}

.sp-entry blockquote p {
	margin-bottom: 0;
}

.sp-entry ul,
.sp-entry ol {
	margin: 0.8em 0 1.4em 1.8em;
}

.sp-entry li {
	margin-bottom: 0.5em;
}

.sp-entry hr {
	border: none;
	border-top: 2px solid #e5e7eb;
	margin: 2.5em 0;
}

.sp-entry code {
	background: #f3f4f6;
	color: #be185d;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 14px;
}

.sp-entry pre {
	background: #1e2330;
	color: #e2e8f0;
	padding: 18px 22px;
	border-radius: 8px;
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.7;
	margin: 1.6em 0;
}

.sp-entry pre code {
	background: none;
	color: inherit;
	padding: 0;
}

.sp-entry table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.6em 0;
	font-size: 15px;
}

.sp-entry th {
	background: #f9fafb;
	font-weight: 700;
	text-align: left;
	padding: 10px 14px;
	border: 1px solid #e5e7eb;
}

.sp-entry td {
	padding: 10px 14px;
	border: 1px solid #e5e7eb;
}

.sp-entry tr:nth-child(even) td {
	background: #f9fafb;
}

/* Gutenberg alignment helpers */
.sp-entry .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.sp-entry .alignwide {
	margin-left: -60px;
	margin-right: -60px;
	max-width: calc(100% + 120px);
}

@media (max-width: 900px) {
	.sp-entry .alignwide {
		margin-left: 0;
		margin-right: 0;
		max-width: 100%;
	}
}

/* TAGS */
.sp-tags {
	padding: 24px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.sp-tags__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.sp-tags__label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9ca3af;
}

.sp-tags__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sp-tag {
	display: inline-block;
	padding: 4px 13px;
	background: #f3f4f6;
	color: #374151;
	border-radius: 20px;
	font-size: 13px;
	text-decoration: none;
	border: 1px solid transparent;
	transition:
		background 0.2s,
		color 0.2s,
		border-color 0.2s;
}

.sp-tag:hover {
	background: #eef2ff;
	color: #123e8a;
	border-color: rgba(18, 62, 138, 0.18);
}

/* AUTHOR BOX */
.sp-author {
	padding: 32px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.sp-author__card {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 24px;
}

.sp-author__avatar {
	width: 72px !important;
	height: 72px !important;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.sp-author__body {
	flex: 1;
	min-width: 0;
}

.sp-author__label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #9ca3af;
	margin-bottom: 4px;
}

.sp-author__name {
	font-size: 16px;
	font-weight: 800;
	color: #111827;
	margin-bottom: 6px;
}

.sp-author__bio {
	font-size: 14px;
	line-height: 1.65;
	color: #4b5563;
}

/* SIDEBAR RELATED POSTS */
.sp-section-title {
	font-size: 16px;
	font-weight: 800;
	color: #111827;
	display: inline-block;
	padding-bottom: 10px;
	border-bottom: 2px solid #123e8a;
	margin-bottom: 20px;
}

.sp-sidebar__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sp-sidebar__card {
	display: flex;
	gap: 12px;
	text-decoration: none;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	padding: 10px;
}

.sp-sidebar__card:hover {
	border-color: #123e8a;
}

.sp-sidebar__card-img {
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
}

.sp-sidebar__card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-sidebar__card-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.sp-sidebar__card-cat {
	display: block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #123e8a;
	margin-bottom: 4px;
}

.sp-sidebar__card-title {
	font-size: 13px;
	font-weight: 700;
	color: #111827;
	line-height: 1.4;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sp-sidebar__card-date {
	font-size: 11px;
	color: #9ca3af;
}

/* Mobile: sidebar as horizontal scroll below content */
@media (max-width: 1023px) {
	.sp-layout {
		flex-direction: column;
	}

	.sp-sidebar {
		display: block;
		width: 100%;
		padding-top: 24px;
		border-top: 1px solid rgba(0, 0, 0, 0.06);
	}

	.sp-sidebar__sticky {
		position: static;
	}

	.sp-sidebar__list {
		flex-direction: row;
		overflow-x: auto;
		gap: 14px;
		padding-bottom: 8px;
	}

	.sp-sidebar__card {
		flex-direction: column;
		min-width: 200px;
		max-width: 220px;
		padding: 0;
	}

	.sp-sidebar__card-img {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
		border-radius: 10px 10px 0 0;
	}

	.sp-sidebar__card-body {
		padding: 10px;
	}
}

/* COMMENTS */
.sp-comments {
	padding: 40px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.sp-comments .comments-title {
	font-size: 20px;
	font-weight: 800;
	margin-bottom: 24px;
}

.sp-comments .comment-list {
	list-style: none;
	padding: 0;
}

.sp-comments .comment {
	padding: 20px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sp-comments .comment-body {
	display: flex;
	gap: 14px;
}

.sp-comments .comment-body img.avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	flex-shrink: 0;
}

.sp-comments .comment-author b {
	font-size: 14px;
}

.sp-comments .comment-metadata {
	font-size: 12px;
	color: #9ca3af;
}

.sp-comments .comment-content p {
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.7;
}

.sp-comments .comment-reply-link {
	font-size: 13px;
	color: #123e8a;
	text-decoration: none;
	font-weight: 600;
}

.sp-comments #respond {
	margin-top: 36px;
}

.sp-comments #respond h3 {
	font-size: 18px;
	font-weight: 800;
	margin-bottom: 20px;
}

.sp-comments .comment-form input[type="text"],
.sp-comments .comment-form input[type="email"],
.sp-comments .comment-form input[type="url"],
.sp-comments .comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	background: #fff;
	transition: border-color 0.2s;
	margin-bottom: 14px;
}

.sp-comments .comment-form input:focus,
.sp-comments .comment-form textarea:focus {
	outline: none;
	border-color: #123e8a;
}

.sp-comments .comment-form textarea {
	min-height: 130px;
	resize: vertical;
}

.sp-comments .comment-form .submit {
	background: #123e8a;
	color: #fff;
	padding: 11px 28px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.2s;
}

.sp-comments .comment-form .submit:hover {
	opacity: 0.85;
}

/* RESPONSIVE – SINGLE POST */
@media (max-width: 600px) {
	.sp-header__title {
		font-size: 21px;
	}

	.sp-entry {
		font-size: 16px;
	}

	.sp-author__card {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}

.sp-action-btn.is-bookmarked {
	background: #eef2ff;
	border-color: rgba(18, 62, 138, 0.3);
	color: var(--primary);
}

.sp-action-btn.is-bookmarked svg {
	fill: currentColor;
}

body.dark-mode .sp-action-btn.is-bookmarked {
	background: rgba(18, 62, 138, 0.25);
	border-color: rgba(96, 165, 250, 0.35);
	color: var(--primary);
}
