/**
 * Blog — archive, single, search
 */

/* ── Archive shell ── */
.ms-blog {
	padding: var(--ms-space-2xl) 0 var(--ms-space-4xl);
	background: linear-gradient(180deg, var(--ms-color-bg) 0%, var(--ms-color-surface) 45%, var(--ms-color-bg) 100%);
	min-height: 70vh;
}

.ms-blog__head {
	margin-bottom: var(--ms-space-xl);
	text-align: center;
	max-width: 42rem;
	margin-inline: auto;
}

.ms-blog__title {
	margin: 0.35rem 0 0.65rem;
	font-size: clamp(1.65rem, 4vw, 2.35rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--ms-color-text);
}

.ms-blog__desc {
	margin: 0;
	color: var(--ms-color-text-muted);
	font-size: 1rem;
	line-height: 1.75;
}

.ms-blog__back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 1rem;
	color: var(--ms-color-primary);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

.ms-blog__back:hover {
	text-decoration: underline;
}

/* ── Category pills ── */
.ms-blog__cats {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	margin-bottom: var(--ms-space-xl);
	padding-bottom: 0.25rem;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ms-blog__cats::-webkit-scrollbar {
	display: none;
}

.ms-blog__cat-pill {
	flex: 0 0 auto;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--ms-color-border);
	background: var(--ms-color-surface);
	color: var(--ms-color-text-muted);
	font-size: 0.82rem;
	font-weight: 700;
	text-decoration: none;
	transition: border-color var(--ms-transition), color var(--ms-transition), background var(--ms-transition);
}

.ms-blog__cat-pill:hover,
.ms-blog__cat-pill.is-active {
	border-color: var(--ms-color-primary);
	background: var(--ms-color-primary-light);
	color: var(--ms-color-primary);
}

/* ── Layout ── */
.ms-blog-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
	gap: var(--ms-space-xl);
	align-items: start;
}

.ms-blog-layout__main {
	min-width: 0;
}

.ms-blog__featured {
	margin-bottom: var(--ms-space-lg);
}

.ms-blog__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.ms-blog__empty {
	padding: var(--ms-space-3xl) var(--ms-space-lg);
	text-align: center;
	border-radius: var(--ms-radius-xl);
	border: 1px dashed var(--ms-color-border);
	background: var(--ms-color-surface);
	color: var(--ms-color-text-muted);
}

.ms-blog__empty .ms-btn {
	margin-top: 1rem;
}

/* ── Search ── */
.ms-blog-search {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	max-width: 36rem;
	margin: 0 auto var(--ms-space-xl);
}

.ms-blog-search input[type="search"] {
	flex: 1 1 220px;
	min-height: 2.85rem;
	padding: 0.55rem 1rem;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-surface);
	font: inherit;
}

.ms-blog-search input:focus {
	outline: none;
	border-color: var(--ms-color-primary);
	box-shadow: 0 0 0 3px var(--ms-color-primary-light);
}

/* ── Cards ── */
.ms-blog-card {
	height: 100%;
}

.ms-blog-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: var(--ms-color-surface);
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	overflow: hidden;
	box-shadow: var(--ms-shadow-sm);
	transition: box-shadow var(--ms-transition), transform var(--ms-transition), border-color var(--ms-transition);
}

.ms-blog-card__link:hover {
	box-shadow: var(--ms-shadow-md);
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--ms-color-primary) 25%, var(--ms-color-border));
}

.ms-blog-card--featured .ms-blog-card__link {
	display: grid;
}

@media (min-width: 768px) {
	.ms-blog-card--featured .ms-blog-card__link {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
		min-height: 320px;
	}
}

.ms-blog-card__media {
	position: relative;
	min-height: 220px;
	background: var(--ms-color-surface-alt);
	overflow: hidden;
}

.ms-blog-card--featured .ms-blog-card__media {
	min-height: 280px;
}

.ms-blog-card__media img,
.ms-blog-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.ms-blog-card__thumb {
	aspect-ratio: 16 / 10;
	background: var(--ms-color-surface-alt);
	overflow: hidden;
}

.ms-blog-card__link:hover img {
	transform: scale(1.04);
}

.ms-blog-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(18, 30, 56, 0.55) 0%, transparent 55%);
	pointer-events: none;
}

.ms-blog-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 160px;
	color: var(--ms-color-text-muted);
	opacity: 0.35;
}

.ms-blog-card__placeholder svg {
	width: 42px;
}

.ms-blog-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1rem 1.1rem 1.15rem;
}

.ms-blog-card--featured .ms-blog-card__body {
	justify-content: flex-end;
}

.ms-blog-card--featured .ms-blog-card__media + .ms-blog-card__body {
	background: var(--ms-color-navy-deep);
	color: #fff;
}

.ms-blog-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.65rem;
	margin-bottom: 0.55rem;
	font-size: 0.72rem;
	color: var(--ms-color-text-muted);
}

.ms-blog-card--featured .ms-blog-card__media + .ms-blog-card__body .ms-blog-card__meta {
	color: rgba(255, 255, 255, 0.72);
}

.ms-blog-card__cat {
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: var(--ms-color-primary-light);
	color: var(--ms-color-primary);
	font-weight: 700;
}

.ms-blog-card--featured .ms-blog-card__media + .ms-blog-card__body .ms-blog-card__cat {
	background: rgba(255, 255, 255, 0.12);
	color: #FDBA74;
}

.ms-blog-card__read::before {
	content: "·";
	margin-inline-end: 0.35rem;
}

.ms-blog-card__title {
	margin: 0 0 0.45rem;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.45;
	letter-spacing: -0.02em;
}

.ms-blog-card--featured .ms-blog-card__title {
	font-size: clamp(1.2rem, 2.5vw, 1.55rem);
}

.ms-blog-card__excerpt {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.65;
	color: var(--ms-color-text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ms-blog-card--featured .ms-blog-card__media + .ms-blog-card__body .ms-blog-card__excerpt {
	color: rgba(255, 255, 255, 0.78);
	-webkit-line-clamp: 2;
}

.ms-blog-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: auto;
	padding-top: 0.85rem;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--ms-color-primary);
}

.ms-blog-card--featured .ms-blog-card__media + .ms-blog-card__body .ms-blog-card__more {
	color: #FDBA74;
}

/* ── Sidebar ── */
.ms-blog-sidebar {
	position: sticky;
	top: calc(var(--ms-header-h) + 1rem);
}

.ms-blog-sidebar__widget {
	margin-bottom: 1rem;
	padding: 1.15rem;
	background: var(--ms-color-surface);
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	box-shadow: var(--ms-shadow-sm);
}

.ms-blog-sidebar__title {
	margin: 0 0 0.85rem;
	font-size: 0.92rem;
	font-weight: 800;
}

.ms-blog-sidebar__cats,
.ms-blog-sidebar__recent {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-blog-sidebar__cats a,
.ms-blog-sidebar__recent a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--ms-color-border);
	color: var(--ms-color-text);
	text-decoration: none;
	font-size: 0.88rem;
	transition: color var(--ms-transition);
}

.ms-blog-sidebar__recent a {
	flex-direction: column;
	align-items: flex-start;
}

.ms-blog-sidebar__cats li:last-child a,
.ms-blog-sidebar__recent li:last-child a {
	border-bottom: none;
}

.ms-blog-sidebar__cats a:hover,
.ms-blog-sidebar__recent a:hover,
.ms-blog-sidebar__cats a.is-active {
	color: var(--ms-color-primary);
}

.ms-blog-sidebar__count {
	font-size: 0.75rem;
	color: var(--ms-color-text-muted);
}

.ms-blog-sidebar__recent strong {
	font-weight: 700;
	line-height: 1.45;
}

.ms-blog-sidebar__recent time {
	font-size: 0.75rem;
	color: var(--ms-color-text-muted);
}

.ms-blog-sidebar__cta {
	padding: 1.15rem;
	border-radius: var(--ms-radius-lg);
	background: linear-gradient(145deg, var(--ms-color-navy-deep), var(--ms-color-navy-mid));
	color: #fff;
}

.ms-blog-sidebar__cta p {
	margin: 0 0 0.85rem;
	font-size: 0.9rem;
	opacity: 0.9;
}

/* ── Pagination ── */
.ms-blog-pagination {
	margin-top: var(--ms-space-xl);
}

.ms-blog-pagination__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.45rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-blog-pagination__item a,
.ms-blog-pagination__item span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0 0.75rem;
	border-radius: var(--ms-radius-sm);
	border: 1px solid var(--ms-color-border);
	background: var(--ms-color-surface);
	color: var(--ms-color-text);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
	transition: border-color var(--ms-transition), color var(--ms-transition), background var(--ms-transition);
}

.ms-blog-pagination__item a:hover,
.ms-blog-pagination__item span.current {
	border-color: var(--ms-color-primary);
	background: var(--ms-color-primary-light);
	color: var(--ms-color-primary);
}

/* ── Single post (editorial) ── */
.ms-post {
	padding-bottom: var(--ms-space-4xl);
	background: var(--ms-color-bg);
}

.ms-post__progress {
	position: fixed;
	top: var(--ms-header-h);
	inset-inline: 0;
	height: 3px;
	z-index: 90;
	background: color-mix(in srgb, var(--ms-color-border) 70%, transparent);
	pointer-events: none;
}

.ms-post__progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--ms-color-primary), #f97316);
	transition: width 0.12s ease-out;
}

/* Hero */
.ms-post-hero {
	padding: var(--ms-space-xl) 0 0;
	background: linear-gradient(180deg, var(--ms-color-surface) 0%, var(--ms-color-bg) 100%);
	border-bottom: 1px solid var(--ms-color-border);
}

.ms-post-hero__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.85rem;
}

.ms-post-hero__cat {
	padding: 0.22rem 0.7rem;
	border-radius: 999px;
	background: var(--ms-color-primary-light);
	color: var(--ms-color-primary);
	font-size: 0.75rem;
	font-weight: 700;
	text-decoration: none;
}

.ms-post-hero__title {
	margin: 0 0 0.85rem;
	font-size: clamp(1.75rem, 4.5vw, 2.65rem);
	font-weight: 800;
	line-height: 1.28;
	letter-spacing: -0.035em;
	color: var(--ms-color-text);
}

.ms-post-hero__lead {
	margin: 0 0 1.25rem;
	max-width: 52rem;
	font-size: clamp(1rem, 2.2vw, 1.15rem);
	line-height: 1.85;
	color: var(--ms-color-text-muted);
}

.ms-post-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0 1.25rem;
	border-top: 1px solid var(--ms-color-border);
}

.ms-post-hero__author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.ms-post-hero__author img {
	width: 48px;
	height: 48px;
	border-radius: 999px;
	border: 2px solid var(--ms-color-surface);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-hero__author strong {
	display: block;
	font-size: 0.92rem;
	font-weight: 800;
}

.ms-post-hero__author span {
	font-size: 0.75rem;
	color: var(--ms-color-text-muted);
}

.ms-post-hero__stats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.85rem;
	font-size: 0.82rem;
	color: var(--ms-color-text-muted);
}

.ms-post-hero__stats > span:not(:last-child)::after {
	content: "·";
	margin-inline-start: 0.85rem;
	opacity: 0.5;
}

.ms-post-hero__figure {
	margin: 0;
	padding: 0 0 var(--ms-space-xl);
}

.ms-post-hero__media {
	overflow: hidden;
	border-radius: var(--ms-radius-xl);
	border: 1px solid var(--ms-color-border);
	box-shadow: var(--ms-shadow-md);
	background: var(--ms-color-surface-alt);
}

.ms-post-hero__img {
	display: block;
	width: 100%;
	max-height: 520px;
	object-fit: cover;
}

.ms-post-hero__caption {
	margin-top: 0.65rem;
	font-size: 0.8rem;
	color: var(--ms-color-text-muted);
	text-align: center;
}

/* Layout */
.ms-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
	gap: var(--ms-space-xl);
	align-items: start;
	padding-top: var(--ms-space-xl);
}

.ms-post-layout__main {
	min-width: 0;
}

.ms-post-sidebar {
	position: sticky;
	top: calc(var(--ms-header-h) + 1.25rem);
}

.ms-post-sidebar__widget {
	margin-bottom: 0.85rem;
	padding: 1rem 1.1rem;
	background: var(--ms-color-surface);
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-sidebar__title {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
	font-weight: 800;
}

.ms-post-sidebar__recent {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-post-sidebar__recent a {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--ms-color-border);
	text-decoration: none;
	color: inherit;
	font-size: 0.85rem;
}

.ms-post-sidebar__recent li:last-child a {
	border-bottom: none;
}

.ms-post-sidebar__recent a:hover span {
	color: var(--ms-color-primary);
}

.ms-post-sidebar__recent time {
	font-size: 0.72rem;
	color: var(--ms-color-text-muted);
}

.ms-post-share {
	display: flex;
	gap: 0.45rem;
}

.ms-post-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	color: var(--ms-color-text);
	cursor: pointer;
	transition: border-color var(--ms-transition), color var(--ms-transition), background var(--ms-transition);
}

.ms-post-share__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ms-post-share__btn--telegram {
	color: #229ed9;
}

.ms-post-share__btn--whatsapp {
	color: #25d366;
}

.ms-post-share__btn--copy {
	color: var(--ms-color-navy);
}

.ms-post-share__btn:hover,
.ms-post-share__btn.is-copied {
	border-color: currentColor;
	background: color-mix(in srgb, currentColor 12%, var(--ms-color-bg));
	color: inherit;
}

.ms-post-share__btn--telegram:hover,
.ms-post-share__btn--telegram.is-copied {
	color: #229ed9;
}

.ms-post-share__btn--whatsapp:hover,
.ms-post-share__btn--whatsapp.is-copied {
	color: #25d366;
}

.ms-post-sidebar__cta {
	padding: 1.15rem;
	border-radius: var(--ms-radius-lg);
	background: linear-gradient(145deg, var(--ms-color-navy-deep), var(--ms-color-navy-mid));
	color: #fff;
}

.ms-post-sidebar__cta-label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.78rem;
	font-weight: 700;
	opacity: 0.75;
}

.ms-post-sidebar__cta p {
	margin: 0 0 0.85rem;
	font-size: 0.92rem;
	line-height: 1.6;
}

.ms-post-sidebar__cta .ms-btn--ghost {
	margin-top: 0.5rem;
	color: #fff;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.45);
}

.ms-post-sidebar__cta .ms-btn--ghost:hover {
	color: var(--ms-color-navy);
	background: #fff;
	border-color: #fff;
}

/* TOC */
.ms-post-toc {
	margin-bottom: 1.25rem;
	padding: 1rem 1.1rem;
	background: var(--ms-color-surface);
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-toc--sidebar {
	margin-bottom: 0.85rem;
}

.ms-post-toc--mobile {
	display: none;
}

.ms-post-toc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.ms-post-toc__head strong {
	font-size: 0.9rem;
	font-weight: 800;
}

.ms-post-toc__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: none;
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	color: var(--ms-color-text);
	cursor: pointer;
}

.ms-post-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ms-toc;
}

.ms-post-toc__item {
	counter-increment: ms-toc;
}

.ms-post-toc__item a {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	padding: 0.45rem 0;
	border-bottom: 1px dashed color-mix(in srgb, var(--ms-color-border) 80%, transparent);
	color: var(--ms-color-text-muted);
	font-size: 0.84rem;
	line-height: 1.5;
	text-decoration: none;
	transition: color var(--ms-transition);
}

.ms-post-toc__item:last-child a {
	border-bottom: none;
}

.ms-post-toc__item a::before {
	content: counter(ms-toc, decimal-leading-zero);
	flex: 0 0 auto;
	min-width: 1.5rem;
	color: var(--ms-color-primary);
	font-size: 0.72rem;
	font-weight: 800;
}

.ms-post-toc__item--h3 a {
	padding-inline-start: 1rem;
	font-size: 0.8rem;
}

.ms-post-toc__item a:hover,
.ms-post-toc__item a.is-active {
	color: var(--ms-color-primary);
}

/* Prose */
.ms-post-prose {
	padding: 0.25rem 0 1rem;
}

.ms-blog-prose {
	font-size: 1.0625rem;
	line-height: 2;
	color: var(--ms-color-text);
}

.ms-blog-prose > *:first-child {
	margin-top: 0;
}

.ms-blog-prose > *:last-child {
	margin-bottom: 0;
}

.ms-post-heading {
	position: relative;
	scroll-margin-top: calc(var(--ms-header-h) + 1.5rem);
}

.ms-post-heading__anchor {
	position: absolute;
	inset-inline-end: 100%;
	padding-inline-end: 0.35rem;
	opacity: 0;
	color: var(--ms-color-primary);
	text-decoration: none;
	font-weight: 700;
	transition: opacity var(--ms-transition);
}

.ms-post-heading:hover .ms-post-heading__anchor {
	opacity: 0.65;
}

.ms-blog-prose h2,
.ms-blog-prose h3,
.ms-blog-prose h4 {
	margin: 2.5rem 0 1rem;
	color: var(--ms-color-text);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.35;
}

.ms-blog-prose h2 { font-size: clamp(1.35rem, 2.8vw, 1.65rem); }
.ms-blog-prose h3 { font-size: clamp(1.15rem, 2.2vw, 1.3rem); }
.ms-blog-prose h4 { font-size: 1.05rem; }

.ms-blog-prose p {
	margin: 0 0 1.25rem;
	color: var(--ms-color-text-muted);
}

.ms-blog-prose > p:first-of-type {
	font-size: 1.08rem;
	color: var(--ms-color-text);
}

.ms-blog-prose a {
	color: var(--ms-color-primary);
	font-weight: 600;
	text-underline-offset: 3px;
}

.ms-blog-prose ul,
.ms-blog-prose ol {
	margin: 0 0 1.25rem;
	padding-inline-start: 1.35rem;
	color: var(--ms-color-text-muted);
}

.ms-blog-prose li {
	margin-bottom: 0.45rem;
}

.ms-blog-prose li::marker {
	color: var(--ms-color-primary);
}

.ms-blog-prose blockquote {
	margin: 1.75rem 0;
	padding: 1rem 1.2rem;
	border-inline-start: 4px solid var(--ms-color-primary);
	border-radius: 0 var(--ms-radius-md) var(--ms-radius-md) 0;
	background: var(--ms-color-orange-tint);
	color: var(--ms-color-text);
	font-weight: 600;
}

.ms-blog-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ms-radius-md);
	margin: 1.5rem 0;
	border: 1px solid var(--ms-color-border);
}

.ms-blog-prose figure {
	margin: 1.75rem 0;
}

.ms-blog-prose figcaption {
	margin-top: 0.55rem;
	font-size: 0.82rem;
	color: var(--ms-color-text-muted);
	text-align: center;
}

.ms-blog-prose pre,
.ms-blog-prose code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ms-blog-prose pre {
	overflow-x: auto;
	padding: 1rem;
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-navy-deep);
	color: #e2e8f0;
	font-size: 0.85rem;
}

.ms-blog-prose :not(pre) > code {
	padding: 0.12rem 0.4rem;
	border-radius: 6px;
	background: var(--ms-color-surface-alt);
	font-size: 0.88em;
}

.ms-blog-prose table {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
	font-size: 0.9rem;
	overflow: hidden;
	border-radius: var(--ms-radius-md);
	border: 1px solid var(--ms-color-border);
}

.ms-blog-prose th,
.ms-blog-prose td {
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid var(--ms-color-border);
}

.ms-blog-prose th {
	background: var(--ms-color-surface-alt);
	font-weight: 800;
	text-align: start;
}

.ms-blog-prose tr:last-child td {
	border-bottom: none;
}

.ms-blog-prose .wp-block-image,
.ms-blog-prose .wp-block-gallery {
	margin: 1.5rem 0;
}

/* Tags, author, nav */
.ms-post-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	margin-top: var(--ms-space-xl);
	padding-top: var(--ms-space-lg);
	border-top: 1px solid var(--ms-color-border);
}

.ms-post-tags__label {
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--ms-color-text-muted);
}

.ms-post-tags__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.ms-post-tags__item {
	padding: 0.32rem 0.8rem;
	border-radius: 999px;
	border: 1px solid var(--ms-color-border);
	background: var(--ms-color-surface);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--ms-color-text);
	transition: border-color var(--ms-transition), color var(--ms-transition);
}

.ms-post-tags__item:hover {
	border-color: var(--ms-color-primary);
	color: var(--ms-color-primary);
}

.ms-post-author {
	display: flex;
	gap: 1rem;
	margin-top: var(--ms-space-xl);
	padding: 1.25rem;
	border-radius: var(--ms-radius-lg);
	border: 1px solid var(--ms-color-border);
	background: var(--ms-color-surface);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-author__avatar {
	width: 72px !important;
	height: 72px !important;
	border-radius: 999px;
	flex-shrink: 0;
}

.ms-post-author__name {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 1rem;
	font-weight: 800;
}

.ms-post-author__body p {
	margin: 0 0 0.65rem;
	font-size: 0.9rem;
	line-height: 1.7;
	color: var(--ms-color-text-muted);
}

.ms-post-author__more {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--ms-color-primary);
	text-decoration: none;
}

.ms-post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
	margin-top: var(--ms-space-xl);
}

.ms-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem 1.1rem;
	border-radius: var(--ms-radius-md);
	border: 1px solid var(--ms-color-border);
	background: var(--ms-color-surface);
	text-decoration: none;
	color: inherit;
	transition: border-color var(--ms-transition), box-shadow var(--ms-transition);
}

.ms-post-nav__link:hover {
	border-color: var(--ms-color-primary);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-nav__link span {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--ms-color-text-muted);
}

.ms-post-nav__link strong {
	font-size: 0.92rem;
	line-height: 1.45;
}

.ms-post-nav__link--next {
	text-align: end;
}

.ms-post-related {
	margin-top: 0;
}

/* ── Post comments ── */
.ms-post-comments {
	margin-top: var(--ms-space-2xl);
	padding: 1.35rem 1.25rem;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-xl);
	background: linear-gradient(180deg, var(--ms-color-surface) 0%, color-mix(in srgb, var(--ms-color-surface) 88%, var(--ms-color-primary-light)) 100%);
	box-shadow: var(--ms-shadow-sm);
}

.ms-post-comments.is-loading [data-comments-list-wrap] {
	opacity: 0.55;
	pointer-events: none;
}

.ms-post-comments__head {
	margin-bottom: 1.15rem;
}

.ms-post-comments__title {
	margin: 0.35rem 0 0.25rem;
	font-size: clamp(1.15rem, 2.5vw, 1.45rem);
	font-weight: 800;
}

.ms-post-comments__count {
	margin: 0;
	font-size: 0.82rem;
	color: var(--ms-color-text-muted);
}

.ms-post-comments__panel {
	display: grid;
	gap: 1.25rem;
}

.ms-post-comments__list-wrap {
	display: grid;
	gap: 0.85rem;
}

.ms-post-comments__items {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.75rem;
}

.ms-post-comments__empty {
	display: grid;
	justify-items: center;
	gap: 0.45rem;
	padding: 1.5rem 1rem;
	border: 1px dashed var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	text-align: center;
	color: var(--ms-color-text-muted);
	background: var(--ms-color-bg);
}

.ms-post-comments__empty p {
	margin: 0;
	font-size: 0.9rem;
}

.ms-post-comment {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 0.75rem;
	padding: 0.95rem 1rem;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-lg);
	background: var(--ms-color-bg);
}

.ms-post-comment__avatar-img {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
}

.ms-post-comment__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.65rem;
	margin-bottom: 0.45rem;
}

.ms-post-comment__author {
	font-size: 0.92rem;
	font-weight: 800;
	color: var(--ms-color-navy);
}

.ms-post-comment__date {
	font-size: 0.74rem;
	color: var(--ms-color-text-muted);
}

.ms-post-comment__moderation {
	margin: 0 0 0.45rem;
	font-size: 0.78rem;
	color: var(--ms-color-primary);
}

.ms-post-comment__content {
	font-size: 0.92rem;
	line-height: 1.75;
	color: var(--ms-color-text);
}

.ms-post-comment__content p {
	margin: 0 0 0.65rem;
}

.ms-post-comment__content p:last-child {
	margin-bottom: 0;
}

.ms-post-comments__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
}

.ms-post-comments__page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.5rem;
	padding: 0 0.85rem;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	font-size: 0.84rem;
	font-weight: 700;
	color: var(--ms-color-text);
	cursor: pointer;
	transition: border-color var(--ms-transition), color var(--ms-transition), background var(--ms-transition);
}

.ms-post-comments__page-btn:hover:not(:disabled) {
	border-color: var(--ms-color-primary);
	background: var(--ms-color-primary-light);
	color: var(--ms-color-primary);
}

.ms-post-comments__page-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.ms-post-comments__page-status {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ms-color-text-muted);
}

.ms-post-comments__form-wrap {
	padding-top: 0.35rem;
	border-top: 1px solid var(--ms-color-border);
}

.ms-post-comments__form .comment-reply-title {
	margin: 0 0 0.85rem;
	font-size: 1rem;
	font-weight: 800;
}

.ms-post-comments__form .comment-form {
	display: grid;
	gap: 0.65rem;
	margin: 0;
}

.ms-post-comments__field {
	margin: 0;
}

.ms-post-comments__field label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ms-color-navy);
}

.ms-post-comments__field input,
.ms-post-comments__field textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	font: inherit;
	color: var(--ms-color-text);
	transition: border-color var(--ms-transition), box-shadow var(--ms-transition);
}

.ms-post-comments__field input:focus,
.ms-post-comments__field textarea:focus {
	outline: none;
	border-color: var(--ms-color-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ms-color-primary) 18%, transparent);
}

.ms-post-comments__field textarea {
	min-height: 7rem;
	resize: vertical;
}

.ms-post-comments__submit {
	margin: 0;
}

.ms-post-comments__closed {
	margin: 0;
	padding: 0.85rem 1rem;
	border-radius: var(--ms-radius-sm);
	background: var(--ms-color-bg);
	font-size: 0.88rem;
	color: var(--ms-color-text-muted);
	text-align: center;
}

/* ── Related ── */
.ms-blog-related {
	padding: var(--ms-space-3xl) 0;
	background: var(--ms-color-surface);
	border-top: 1px solid var(--ms-color-border);
}

.ms-blog-related__head {
	margin-bottom: var(--ms-space-lg);
	text-align: center;
}

.ms-blog-related__head h2 {
	margin: 0.35rem 0 0;
	font-size: clamp(1.25rem, 3vw, 1.65rem);
	font-weight: 800;
}

.ms-blog-related__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

/* ── Mobile ── */
@media (max-width: 1023px) {
	.ms-blog-layout,
	.ms-post-layout {
		grid-template-columns: 1fr;
	}

	.ms-blog-sidebar,
	.ms-post-sidebar {
		position: static;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}

	.ms-blog-sidebar__cta,
	.ms-post-sidebar__cta {
		grid-column: 1 / -1;
	}

	.ms-post-toc--sidebar {
		display: none;
	}

	.ms-post-toc--mobile {
		display: block;
	}
}

@media (max-width: 767px) {
	.ms-blog__grid,
	.ms-blog-related__grid {
		grid-template-columns: 1fr;
	}

	.ms-blog-sidebar {
		grid-template-columns: 1fr;
	}

	.ms-blog-card--featured .ms-blog-card__link {
		display: flex;
		flex-direction: column;
	}

	.ms-blog-single__nav,
	.ms-post-nav {
		grid-template-columns: 1fr;
	}

	.ms-blog-single__nav-link--next,
	.ms-post-nav__link--next {
		text-align: start;
	}

	.ms-post-hero__meta {
		flex-direction: column;
		align-items: flex-start;
	}

	.ms-post-hero__stats > span:not(:last-child)::after {
		display: none;
	}

	.ms-post-sidebar {
		grid-template-columns: 1fr;
	}

	.ms-post-hero__img {
		max-height: 280px;
	}
}

@media (min-width: 900px) {
	.ms-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.ms-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
