/**
 * Blog templates: hero banner, card grid, and single post layout.
 */

/* Hero banner */
.sp-blog-hero {
	position: relative;
	width: 100%;
	min-height: 250px;
	max-height: 450px;
	overflow: hidden;
	background: #25a2db center/cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sp-blog-hero-img {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-blog-hero--has-image::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	background: rgba(37, 162, 219, 0.4);
	pointer-events: none;
}

.sp-blog-hero-overlay {
	position: relative;
	z-index: 2;
	background: rgba(0, 0, 0, 0.45);
	width: 100%;
	min-height: 250px;
	max-height: 450px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	box-sizing: border-box;
}

.sp-blog-hero--has-image .sp-blog-hero-overlay {
	background: transparent;
}

.sp-blog-hero-title {
	color: #fff;
	font-size: 3em;
	text-align: center;
	margin: 0;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	line-height: 1.2;
}

/* Blog grid */
.sp-blog-content-wrap {
	padding: 0 20px 40px;
}

.sp-blog-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 220px;
	gap: 40px;
	align-items: start;
}

.sp-blog-main {
	width: 100%;
}

.sp-blog-sidebar {
	width: 100%;
}

.sp-blog-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 30px;
	padding: 40px 0;
}

.sp-blog-no-posts {
	padding: 40px 0;
	text-align: center;
}

/* Blog cards */
.sp-blog-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.sp-card-badges {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	max-width: calc(100% - 20px);
	text-align: right;
	pointer-events: none;
}

.sp-card-badge {
	display: block;
	margin-bottom: 6px;
	padding: 4px 8px;
	font-size: 0.75rem;
	line-height: 1.3;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 3px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	pointer-events: auto;
}

.sp-card-badge a {
	color: #333;
	text-decoration: none;
}

.sp-card-badge a:hover {
	color: #25a2db;
}

.sp-card-badge-categories {
	border-left: 3px solid #25a2db;
}

.sp-card-badge-tags {
	border-left: 3px solid #e5554e;
}

.sp-blog-card.entry {
	padding: 0;
}

.sp-blog-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sp-card-image-link {
	display: block;
	text-decoration: none;
	line-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.sp-card-image-wrap {
	position: relative;
	padding-top: 56.25%;
	overflow: hidden;
	background: #f3f3f3;
	flex-shrink: 0;
	margin: 0;
	border: 0;
}

.sp-card-image-wrap--has-image {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.sp-card-image-wrap img:not(.sp-card-placeholder-logo),
.sp-card-image {
	display: block;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	padding: 0;
	border: 0;
}

.sp-card-image-wrap--has-image img,
.sp-card-image-wrap--has-image .sp-card-image {
	display: none;
}

.sp-card-image-wrap--placeholder {
	background: #25a2db;
}

.sp-card-placeholder {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #25a2db;
}

.sp-card-placeholder-bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	filter: blur(3px);
	transform: scale(1.08);
}

.sp-card-placeholder-tint {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	background: rgba(37, 162, 219, 0.4);
	pointer-events: none;
}

.sp-card-placeholder-logo {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 0;
	width: auto;
	height: auto;
	max-width: 55%;
	max-height: 55%;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: contain;
	transform: translate(-50%, -50%);
	opacity: 1;
	pointer-events: none;
}

.sp-card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 20px;
}

.sp-card-title {
	font-size: 1.3rem;
	margin: 0 0 10px;
	line-height: 1.3;
}

.sp-card-title a {
	color: #333;
	text-decoration: none;
}

.sp-card-title a:hover {
	color: #25a2db;
}

.sp-card-date {
	margin: 0 0 8px;
	font-size: 0.85rem;
	color: #666;
}

.sp-card-excerpt {
	font-size: 0.9em;
	color: #666;
	margin: 0;
	flex: 1;
}

/* Single post: centered content column below hero */
.sp-single-content-wrap {
	padding: 0 20px 50px;
}

.sp-single-main {
	width: 100%;
	margin: 40px 0 0;
}

.sp-single-article {
	background: #fff;
}

.sp-single-article.entry {
	padding: 0;
}

.sp-single-entry-content {
	padding: 0;
}

.sp-single-meta {
	font-size: 0.95rem;
	color: #666;
}

.sp-single-meta-top {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
}

.sp-single-meta-top .sp-single-meta-sep {
	margin: 0 10px;
	color: #ccc;
}

.sp-single-meta-top a,
.sp-single-meta-footer a {
	color: #25a2db;
	text-decoration: none;
}

.sp-single-meta-top a:hover,
.sp-single-meta-footer a:hover {
	color: #e5554e;
}

.sp-single-meta-footer {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #e0e0e0;
}

.sp-single-meta-row {
	margin: 0 0 12px;
	line-height: 1.5;
}

.sp-single-meta-row:last-child {
	margin-bottom: 0;
}

.sp-single-meta-row strong {
	color: #333;
	margin-right: 6px;
}

/* Block editor images/tables: remove normalize figure side margins inside posts */
.sp-single-entry-content figure {
	margin-left: 0;
	margin-right: 0;
}

.sp-single-entry-content .wp-block-image,
.sp-single-entry-content .wp-block-table,
.sp-single-entry-content table {
	max-width: 100%;
}

/* Pagination within blog grid context */
.sp-blog-pagination {
	display: block !important;
	visibility: visible !important;
	margin-top: 20px;
	padding-bottom: 10px;
	clear: both;
}

.sp-blog-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sp-blog-pagination .pagination,
.sp-blog-pagination nav {
	display: block !important;
}

.sp-blog-pagination a,
.sp-blog-pagination span {
	background-color: #333;
	color: #fff;
	display: inline-block;
	padding: 8px 12px;
	text-decoration: none;
}

.sp-blog-pagination a:hover,
.sp-blog-pagination .current {
	background-color: #25a2db;
}
.widget-title .widgettitle {
	color: #333 !important;
}

/* Responsive grid */
@media only screen and (max-width: 900px) {
	.sp-blog-layout {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.sp-blog-sidebar {
		order: 2;
	}

	.sp-blog-hero-title {
		font-size: 2.25em;
	}
}

@media only screen and (max-width: 600px) {
	.sp-blog-content-wrap,
	.sp-single-content-wrap {
		padding-left: 15px;
		padding-right: 15px;
	}

	.sp-blog-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 30px 0;
	}

	.sp-blog-hero {
		min-height: 200px;
		max-height: 350px;
	}

	.sp-blog-hero-overlay {
		min-height: 200px;
		max-height: 350px;
		padding: 30px 15px;
	}

	.sp-blog-hero-title {
		font-size: 1.75em;
	}

	.sp-single-main {
		margin-top: 30px;
	}
}
