/* ==============================================================
 * BLOG — single post & category archives
 * ============================================================== */

/* --------------------------------------------------------------
 * Shared: breadcrumb (already in style.css but tightened here)
 * ------------------------------------------------------------ */
.sg-single .sg-breadcrumbs,
.sg-archive .sg-breadcrumbs {
	padding: 18px 0 0;
	margin-bottom: 24px;
}

/* ==============================================================
 * SINGLE POST
 * ============================================================== */

.sg-single__header {
	background:
		radial-gradient(800px 400px at 90% -20%, rgba(14,165,233,.08), transparent 60%),
		radial-gradient(800px 400px at 0% 0%, rgba(79,70,229,.08), transparent 60%),
		#f8fafc;
	padding-bottom: 0;
}

.sg-single__header-inner {
	padding: 8px 20px 40px;
	max-width: 780px;
	margin: 0 auto;
}

.sg-single__category {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sg-primary);
	background: #eef2ff;
	padding: 5px 12px;
	border-radius: 999px;
	text-decoration: none;
	margin-bottom: 16px;
}
.sg-single__category:hover { background: #e0e7ff; }

.sg-single__title {
	font-size: clamp(28px, 4.6vw, 46px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 18px;
}

.sg-single__lede {
	font-size: 18px;
	color: var(--sg-muted);
	line-height: 1.6;
	margin: 0 0 24px;
}

.sg-single__meta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.sg-single__author {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sg-single__avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(15,23,42,.1);
}

.sg-single__author-text {
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}
.sg-single__author-name {
	font-weight: 600;
	font-size: 14.5px;
	color: var(--sg-text);
}
.sg-single__dates {
	font-size: 13px;
	color: var(--sg-muted);
	display: flex;
	align-items: center;
	gap: 6px;
}

.sg-single__hero {
	margin: 0;
	padding: 0 20px;
	max-width: 1000px;
	margin-left: auto;
	margin-right: auto;
}
.sg-single__hero img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--sg-radius) var(--sg-radius) 0 0;
	box-shadow: 0 24px 60px -32px rgba(15,23,42,.4);
}

/* ---- Body ---- */
.sg-single__body {
	max-width: 780px;
	margin: 0 auto;
	padding-top: 48px;
	padding-bottom: 64px;
}

.sg-single__content {
	font-size: 17px;
	line-height: 1.75;
	color: var(--sg-text);
}
.sg-single__content > *:first-child { margin-top: 0; }

.sg-single__content h2 {
	font-size: 26px;
	margin: 2em 0 .8em;
	line-height: 1.3;
}
.sg-single__content h3 {
	font-size: 21px;
	margin: 1.6em 0 .6em;
	line-height: 1.35;
}
.sg-single__content h4 {
	font-size: 18px;
	margin: 1.4em 0 .5em;
}
.sg-single__content p {
	margin: 0 0 1.2em;
}
.sg-single__content ul,
.sg-single__content ol {
	margin: 0 0 1.4em 1.4em;
	padding: 0;
}
.sg-single__content li { margin-bottom: .4em; }

.sg-single__content a {
	color: var(--sg-primary);
	text-decoration: none;
	border-bottom: 1px solid rgba(79,70,229,.35);
}
.sg-single__content a:hover {
	border-bottom-color: var(--sg-primary);
}

.sg-single__content blockquote {
	border-left: 4px solid var(--sg-primary);
	background: var(--sg-surface);
	margin: 1.6em 0;
	padding: 20px 24px;
	border-radius: var(--sg-radius-sm);
	font-size: 18px;
	font-style: italic;
	color: var(--sg-text);
}
.sg-single__content blockquote p:last-child { margin-bottom: 0; }

.sg-single__content code {
	background: #f1f5f9;
	border-radius: 6px;
	padding: 2px 6px;
	font-size: .9em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.sg-single__content pre {
	background: #0f172a;
	color: #e2e8f0;
	padding: 20px 22px;
	border-radius: var(--sg-radius-sm);
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
	margin: 1.4em 0;
}
.sg-single__content pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: 14px;
}

.sg-single__content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--sg-radius-sm);
	margin: 1em 0;
}

.sg-single__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.4em 0;
	font-size: 15px;
}
.sg-single__content th,
.sg-single__content td {
	border: 1px solid var(--sg-border);
	padding: 12px 14px;
	text-align: left;
}
.sg-single__content th {
	background: var(--sg-surface);
	font-weight: 600;
}

/* ---- Tags ---- */
.sg-single__tags {
	margin: 32px 0 0;
	padding-top: 24px;
	border-top: 1px solid var(--sg-border);
	font-size: 14px;
	color: var(--sg-muted);
}
.sg-single__tags-label {
	font-weight: 600;
	color: var(--sg-text);
	margin-right: 6px;
}
.sg-single__tags a {
	display: inline-block;
	padding: 4px 12px;
	background: var(--sg-surface);
	border-radius: 999px;
	color: var(--sg-text);
	text-decoration: none;
	margin: 4px 4px 4px 0;
	font-size: 13px;
}
.sg-single__tags a:hover {
	background: #eef2ff;
	color: var(--sg-primary);
}

/* ---- Prev/Next navigation ---- */
.sg-single__nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 40px 0 0;
}
@media (max-width: 600px) {
	.sg-single__nav { grid-template-columns: 1fr; }
}

.sg-single__nav-item {
	display: block;
	padding: 20px 22px;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius);
	background: #fff;
	text-decoration: none;
	color: var(--sg-text);
	transition: border-color .15s ease, transform .15s ease;
}
.sg-single__nav-item:hover {
	border-color: rgba(79,70,229,.4);
	transform: translateY(-2px);
	color: var(--sg-primary);
}
.sg-single__nav-item--next { text-align: right; }

.sg-single__nav-label {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 700;
	color: var(--sg-muted);
	margin-bottom: 6px;
}
.sg-single__nav-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

/* ---- Author box ---- */
.sg-single__author-box {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin: 40px 0 0;
	padding: 26px;
	background: var(--sg-surface);
	border-radius: var(--sg-radius);
	border: 1px solid var(--sg-border);
}
.sg-single__author-box-avatar img {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: block;
}
.sg-single__author-box-label {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--sg-muted);
	font-weight: 700;
	margin-bottom: 4px;
}
.sg-single__author-box-name {
	margin: 0 0 6px;
	font-size: 17px;
}
.sg-single__author-box-bio {
	margin: 0;
	color: var(--sg-muted);
	font-size: 14.5px;
	line-height: 1.6;
}
@media (max-width: 560px) {
	.sg-single__author-box { flex-direction: column; align-items: flex-start; }
}

/* ---- Related reading ---- */
.sg-single__related {
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid var(--sg-border);
}
.sg-single__related h2 {
	font-size: 22px;
	margin: 0 0 24px;
}

/* ---- Comments ---- */
.sg-single__comments {
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid var(--sg-border);
}
.sg-single__comments .comment-list { list-style: none; padding: 0; }
.sg-single__comments .comment { margin-bottom: 24px; }
.sg-single__comments .comment-body {
	background: #fff;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius-sm);
	padding: 18px 20px;
}
.sg-single__comments .children { list-style: none; padding-left: 40px; margin-top: 16px; }
.sg-single__comments .comment-author img { border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.sg-single__comments .comment-meta { font-size: 13px; color: var(--sg-muted); margin-bottom: 10px; }
.sg-single__comments .comment-reply-link { font-size: 13px; font-weight: 600; }

.sg-single__comments .comment-respond {
	background: #fff;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius);
	padding: 24px;
	margin-top: 32px;
}
.sg-single__comments .comment-respond h3 { margin: 0 0 16px; font-size: 18px; }
.sg-single__comments .comment-form label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}
.sg-single__comments .comment-form input[type="text"],
.sg-single__comments .comment-form input[type="email"],
.sg-single__comments .comment-form input[type="url"],
.sg-single__comments .comment-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius-sm);
	font-size: 15px;
	font-family: inherit;
	background: #fff;
	box-sizing: border-box;
}
.sg-single__comments .comment-form input:focus,
.sg-single__comments .comment-form textarea:focus {
	outline: none;
	border-color: var(--sg-primary);
	box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.sg-single__comments .comment-form .submit {
	background: var(--sg-primary);
	color: #fff;
	border: 0;
	padding: 12px 26px;
	border-radius: var(--sg-radius-sm);
	font-weight: 700;
	cursor: pointer;
	font-size: 15px;
}

/* ==============================================================
 * CATEGORY / ARCHIVE
 * ============================================================== */

.sg-archive {
	padding-top: 8px;
	padding-bottom: 72px;
}

.sg-archive__header {
	max-width: 720px;
	margin: 0 0 40px;
}

.sg-archive__eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--sg-primary);
	background: #eef2ff;
	padding: 5px 12px;
	border-radius: 999px;
	margin-bottom: 14px;
}

.sg-archive__title {
	font-size: clamp(28px, 4.4vw, 44px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
}

.sg-archive__description {
	font-size: 17px;
	line-height: 1.6;
	color: var(--sg-muted);
	margin: 0 0 16px;
}

.sg-archive__count {
	font-size: 14px;
	color: var(--sg-muted);
	margin: 0;
}

.sg-archive__empty {
	max-width: 480px;
	margin: 40px auto 0;
	text-align: center;
	padding: 40px 24px;
	background: #fff;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius);
	box-shadow: var(--sg-shadow);
}
.sg-archive__empty h2 { margin: 0 0 10px; font-size: 20px; }
.sg-archive__empty p { color: var(--sg-muted); margin: 0 0 20px; }

/* ==============================================================
 * PAGINATION
 * ============================================================== */

.sg-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 48px 0 0;
}
.sg-pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 14px;
	border: 1px solid var(--sg-border);
	border-radius: 8px;
	background: #fff;
	color: var(--sg-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	transition: border-color .15s ease, background .15s ease;
}
.sg-pagination .page-numbers:hover {
	border-color: var(--sg-primary);
	color: var(--sg-primary);
}
.sg-pagination .page-numbers.current {
	background: var(--sg-primary);
	color: #fff;
	border-color: var(--sg-primary);
}
.sg-pagination .page-numbers.dots {
	border: 0;
	background: transparent;
}
/* ==============================================================
 * POST CARD GRID
 * --------------------------------------------------------------
 * Used by the homepage "Latest articles" section, the category
 * archive, generic archives, and any related-reading list.
 * ============================================================== */

.sg-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin-bottom: 8px;
}

@media (max-width: 980px) {
	.sg-blog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.sg-blog__grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------
 * Individual post card
 * ------------------------------------------------------------ */

.sg-post-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius);
	overflow: hidden;
	box-shadow: var(--sg-shadow);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.sg-post-card:hover {
	transform: translateY(-3px);
	border-color: rgba(79,70,229,.3);
	box-shadow: 0 18px 40px -22px rgba(15,23,42,.3);
}

/* Media / featured image */
.sg-post-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: #eef2ff;
	overflow: hidden;
	text-decoration: none;
}

.sg-post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.sg-post-card:hover .sg-post-card__media img {
	transform: scale(1.04);
}

/* Fallback gradient when a post has no featured image */
.sg-post-card__placeholder {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(400px 200px at 20% 20%, rgba(14,165,233,.35), transparent 60%),
		radial-gradient(400px 200px at 80% 80%, rgba(79,70,229,.35), transparent 60%),
		#eef2ff;
}

/* Category badge floating on the image */
.sg-post-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(255,255,255,.92);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--sg-text);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 999px;
	z-index: 2;
}

/* Body */
.sg-post-card__body {
	padding: 20px 22px 22px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.sg-post-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: var(--sg-muted);
	margin-bottom: 10px;
}

.sg-post-card__dot {
	opacity: .5;
}

.sg-post-card__title {
	font-size: 17px;
	line-height: 1.35;
	margin: 0 0 10px;
}

.sg-post-card__title a {
	color: var(--sg-text);
	text-decoration: none;
}

.sg-post-card__title a:hover {
	color: var(--sg-primary);
}

.sg-post-card__excerpt {
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--sg-muted);
	margin: 0 0 18px;
	flex: 1 1 auto;
}

.sg-post-card__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sg-primary);
	text-decoration: none;
	margin-top: auto;
}

.sg-post-card__more span {
	transition: transform .15s ease;
}

.sg-post-card__more:hover span {
	transform: translateX(3px);
}