/* NaijaScore9 Blog responsive hardening v2.3.48.170.
 * Scoped only to the Blog landing/archive family and standard blog posts.
 */

/* Shared containment: prevent long titles, widgets, media, tables or embeds from widening the viewport. */
.n9-blog-page,
.single-post .n9-blog-single-layout,
.single-post .n9-blog-single-layout * {
	box-sizing: border-box;
}
.n9-blog-page,
.single-post .n9-blog-single-layout {
	max-width: 100%;
}
.n9-blog-page :where(h1,h2,h3,h4,p,a,span,strong,small),
.single-post .n9-blog-single-layout :where(h1,h2,h3,h4,p,a,span,strong,small) {
	overflow-wrap: break-word;
	word-break: normal;
}
.n9-blog-page :where(img,video,svg,canvas,iframe),
.single-post .n9-blog-single-layout :where(img,video,svg,canvas,iframe) {
	max-width: 100%;
}

/* Landing/archive width and grid guards. */
.n9-blog-page > .n9-container,
.n9-blog-page .n9-blog-hero-inner,
.n9-blog-page .n9-blog-category-strip,
.n9-blog-page .n9-blog-layout {
	min-width: 0;
}
.n9-blog-main,
.n9-blog-sidebar,
.n9-blog-featured-card,
.n9-blog-featured-copy,
.n9-blog-card,
.n9-blog-card-body,
.n9-blog-side-card,
.n9-blog-newsletter {
	min-width: 0;
	max-width: 100%;
}
.n9-blog-search,
.n9-blog-newsletter form,
.n9-blog-newsletter input,
.n9-blog-newsletter button {
	max-width: 100%;
}

/* Standard post: stable desktop reading column plus a contained sidebar. */
body.single-post .n9-blog-single-layout {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(270px, 320px) !important;
	align-items: start;
	gap: 26px !important;
	width: min(1180px, calc(100% - 32px));
	padding-block: 38px 78px;
}
body.single-post .n9-blog-single-main,
body.single-post .n9-blog-single-layout > .n9-sidebar {
	min-width: 0;
	width: 100%;
	max-width: 100%;
}
body.single-post .n9-blog-single-article {
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	padding: clamp(28px, 4vw, 50px);
}
body.single-post .n9-blog-single-header {
	min-width: 0;
}
body.single-post .n9-blog-single-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	color: #7c8da1;
	font-size: 12px;
	font-weight: 800;
}
body.single-post .n9-blog-single-breadcrumb a {
	color: #0f9f70;
	text-decoration: none;
}
body.single-post .n9-blog-single-header .n9-blog-category-label {
	margin-bottom: 11px;
}
body.single-post .n9-blog-single-header h1 {
	max-width: 100%;
	margin: 0;
	font-size: clamp(34px, 4.4vw, 58px);
	line-height: 1.04;
	letter-spacing: -.045em;
	text-wrap: balance;
}
body.single-post .n9-blog-single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 17px;
	line-height: 1.5;
}
body.single-post .n9-featured-image {
	max-width: 100%;
	margin: 30px 0;
}
body.single-post .n9-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 620px;
	object-fit: cover;
}
body.single-post .n9-entry-content {
	min-width: 0;
	max-width: 100%;
	font-size: clamp(16px, 1.45vw, 18px);
	line-height: 1.82;
}
body.single-post .n9-entry-content > * {
	max-width: 100%;
}
body.single-post .n9-entry-content h2 {
	font-size: clamp(26px, 3.2vw, 36px);
	line-height: 1.16;
	text-wrap: balance;
}
body.single-post .n9-entry-content h3 {
	font-size: clamp(22px, 2.5vw, 28px);
	line-height: 1.2;
}
body.single-post .n9-entry-content :where(ul,ol) {
	padding-inline-start: 1.35em;
}
body.single-post .n9-entry-content :where(table,.wp-block-table) {
	max-width: 100%;
}
body.single-post .n9-entry-content .wp-block-table,
body.single-post .n9-entry-content > table {
	display: block;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-inline: contain;
}
body.single-post .n9-entry-content table {
	min-width: 560px;
}
body.single-post .n9-entry-content :where(pre,code) {
	max-width: 100%;
}
body.single-post .n9-entry-content pre {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
body.single-post .n9-entry-content :where(.wp-block-embed,.wp-block-video,.wp-block-image,.wp-block-gallery,.alignwide,.alignfull) {
	width: 100%;
	max-width: 100%;
	margin-inline: 0;
}
body.single-post .n9-entry-content iframe {
	width: 100%;
}

/* Sidebar must never float over the article. */
body.single-post .n9-blog-single-layout > .n9-sidebar {
	position: sticky !important;
	top: 24px;
	display: flex !important;
	flex-direction: column;
	gap: 18px;
	align-self: start;
	inset-inline: auto !important;
	transform: none !important;
	z-index: 1;
}
body.admin-bar.single-post .n9-blog-single-layout > .n9-sidebar {
	top: 58px;
}
body.single-post .n9-sidebar > *,
body.single-post .n9-widget {
	min-width: 0;
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	overflow: hidden;
}
body.single-post .n9-sidebar .n9-search-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	gap: 9px;
	width: 100%;
	max-width: 100%;
}
body.single-post .n9-sidebar .n9-search-form label,
body.single-post .n9-sidebar .n9-search-input-wrap {
	display: block;
	min-width: 0;
	width: 100%;
	max-width: 100%;
}
body.single-post .n9-sidebar .n9-search-form input[type="search"] {
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
}
body.single-post .n9-sidebar .n9-search-form > button[type="submit"] {
	white-space: nowrap;
}
body.single-post .post-navigation,
body.single-post .navigation.post-navigation {
	min-width: 0;
	max-width: 100%;
	margin-top: 22px;
}
body.single-post .post-navigation .nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
body.single-post .post-navigation a {
	display: block;
	min-width: 0;
	padding: 16px;
	border: 1px solid var(--n9-border);
	border-radius: 15px;
	text-decoration: none;
}

/* Tablet: put the sidebar below content, never beside or above it. */
@media (max-width: 980px) {
	body.single-post .n9-blog-single-layout {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 22px !important;
	}
	body.single-post .n9-blog-single-layout > .n9-sidebar {
		position: static !important;
		top: auto !important;
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		align-items: start;
		order: 2;
	}
	body.single-post .n9-blog-single-main {
		order: 1;
	}
	body.single-post .n9-sidebar .n9-sticky-widget-stack {
		grid-column: 1 / -1;
	}

	.n9-blog-page .n9-blog-layout {
		grid-template-columns: minmax(0, 1fr) !important;
	}
	.n9-blog-page .n9-blog-sidebar {
		position: static !important;
		top: auto !important;
		width: 100%;
		max-height: none !important;
		overflow: visible !important;
		padding-right: 0 !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile landing/archive. */
@media (max-width: 640px) {
	.n9-blog-page {
		width: 100%;
		overflow-x: clip;
	}
	.n9-blog-page .n9-container,
	.n9-blog-page .n9-blog-hero-inner,
	.n9-blog-page .n9-blog-category-strip,
	.n9-blog-page .n9-blog-layout {
		width: min(100% - 22px, 1440px);
		max-width: calc(100% - 22px);
		margin-inline: auto;
	}
	.n9-blog-page .n9-blog-hero-inner {
		display: flex;
		flex-direction: column;
	}
	.n9-blog-page .n9-blog-hero-copy {
		width: 100%;
		padding: 26px 0 22px;
	}
	.n9-blog-page .n9-blog-hero h1 {
		font-size: clamp(36px, 11vw, 46px);
		line-height: 1;
	}
	.n9-blog-page .n9-blog-search {
		width: 100%;
		height: 50px;
	}
	.n9-blog-page .n9-blog-hero-art {
		width: 100%;
		min-height: 190px;
		margin: 0 0 8px;
		border-radius: 20px;
		clip-path: none;
	}
	.n9-blog-page .n9-blog-hero-art:after {
		background: linear-gradient(180deg, rgba(247,250,249,.25), transparent 55%);
	}
	html[data-n9-theme="dark"] .n9-blog-page .n9-blog-hero-art:after {
		background: linear-gradient(180deg, rgba(7,17,14,.28), transparent 55%);
	}
	.n9-blog-page .n9-blog-category-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0;
		padding: 7px;
	}
	.n9-blog-page .n9-blog-category-tab {
		min-width: 0;
		min-height: 74px;
		padding: 8px 5px;
	}
	.n9-blog-page .n9-blog-category-tab strong {
		font-size: 10px;
	}
	.n9-blog-page .n9-blog-layout {
		padding-top: 18px;
	}
	.n9-blog-page .n9-blog-featured-card {
		grid-template-columns: minmax(0, 1fr);
	}
	.n9-blog-page .n9-blog-featured-image {
		min-height: 205px;
	}
	.n9-blog-page .n9-blog-featured-copy {
		padding: 20px;
	}
	.n9-blog-page .n9-blog-featured-copy h2 {
		font-size: clamp(24px, 7.4vw, 30px);
	}
	.n9-blog-page .n9-blog-card-grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.n9-blog-page .n9-blog-card {
		display: grid;
		grid-template-columns: 128px minmax(0, 1fr);
		width: 100%;
	}
	.n9-blog-page .n9-blog-card-image {
		min-width: 0;
		height: 100%;
		min-height: 166px;
	}
	.n9-blog-page .n9-blog-card-body {
		min-width: 0;
		padding: 13px;
	}
	.n9-blog-page .n9-blog-card h3 {
		font-size: 15px;
	}
	.n9-blog-page .n9-blog-card p {
		display: -webkit-box;
		overflow: hidden;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
	}
	.n9-blog-page .n9-blog-sidebar {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 14px;
	}
	.n9-blog-page .n9-blog-side-card,
	.n9-blog-page .n9-blog-newsletter {
		width: 100%;
		max-width: 100%;
	}

	body.single-post .n9-blog-single-layout {
		width: calc(100% - 22px);
		max-width: calc(100% - 22px);
		gap: 16px !important;
		padding-block: 22px 118px;
	}
	body.single-post .n9-blog-single-article {
		width: 100%;
		max-width: 100%;
		padding: 20px;
		border-radius: 22px;
	}
	body.single-post .n9-blog-single-breadcrumb {
		margin-bottom: 14px;
		font-size: 11px;
	}
	body.single-post .n9-blog-single-header h1 {
		font-size: clamp(30px, 9.4vw, 42px);
		line-height: 1.06;
		letter-spacing: -.038em;
	}
	body.single-post .n9-blog-single-meta {
		font-size: 10px;
	}
	body.single-post .n9-featured-image {
		margin: 22px 0;
		border-radius: 15px;
	}
	body.single-post .n9-entry-content {
		font-size: 16px;
		line-height: 1.75;
	}
	body.single-post .n9-entry-content h2 {
		margin-top: 1.65em;
		font-size: 27px;
	}
	body.single-post .n9-entry-content h3 {
		margin-top: 1.45em;
		font-size: 22px;
	}
	body.single-post .n9-entry-content blockquote {
		margin: 24px 0;
		padding-left: 17px;
		font-size: 18px;
	}
	body.single-post .n9-blog-single-layout > .n9-sidebar {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 14px;
	}
	body.single-post .n9-sidebar .n9-search-form {
		grid-template-columns: minmax(0, 1fr) auto;
	}
	body.single-post .n9-widget {
		padding: 18px;
		border-radius: 16px;
	}
	body.single-post .post-navigation .nav-links {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Very narrow phones: stack article cards and the sidebar search button safely. */
@media (max-width: 420px) {
	.n9-blog-page .n9-blog-card {
		display: flex;
		flex-direction: column;
	}
	.n9-blog-page .n9-blog-card-image {
		min-height: 190px;
		aspect-ratio: 1.65 / 1;
	}
	body.single-post .n9-blog-single-article {
		padding: 17px;
	}
	body.single-post .n9-sidebar .n9-search-form {
		grid-template-columns: minmax(0, 1fr);
	}
	body.single-post .n9-sidebar .n9-search-form > button[type="submit"] {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.n9-blog-page *,
	.single-post .n9-blog-single-layout * {
		scroll-behavior: auto !important;
	}
}
