/* =====================================================
   Serenity Blog Posts Grid Widget
   ===================================================== */

/* ── Tabs ── */
.sbpg-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
	justify-content: flex-start;
}

.sbpg-tab-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	background: transparent;
	border: 1.5px solid #dddddd;
	border-radius: 40px;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	cursor: pointer;
	transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
	white-space: nowrap;
}

.sbpg-tab-btn:hover:not(.active) {
	border-color: #bbb;
	color: #333;
}

.sbpg-tab-btn.active {
	background: #c9a96e;
	border-color: #c9a96e;
	color: #fff;
}

.sbpg-tab-count {
	font-size: 11px;
	opacity: 0.7;
	font-weight: 400;
}

/* ── Grid ── */
.sbpg-grid {
	display: grid;
	gap: 28px;
	transition: opacity 250ms ease;
}

.sbpg-layout-grid {
	grid-template-columns: repeat(3, 1fr);
}

.sbpg-layout-list {
	grid-template-columns: 1fr;
}

.sbpg-grid.loading { opacity: 0.4; pointer-events: none; }

/* ── Card — shared ── */
.sbpg-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 280ms ease, box-shadow 280ms ease;
}

.sbpg-hover-lift:hover {
	transform: translateY(-5px);
	box-shadow: 0 14px 36px rgba(0,0,0,0.11);
}

/* ── Card — list layout ── */
.sbpg-card-list {
	flex-direction: row;
	align-items: stretch;
}

.sbpg-card-list .sbpg-card-image-link {
	flex: 0 0 260px;
	min-width: 0;
}

.sbpg-card-list .sbpg-card-image {
	height: 100% !important;
	min-height: 160px;
	border-radius: 12px 0 0 12px !important;
}

.sbpg-card-list .sbpg-card-body { flex: 1; }

/* ── Card image ── */
.sbpg-card-image-link { display: block; }

.sbpg-card-image {
	width: 100%;
	height: 200px;
	overflow: hidden;
	position: relative;
	border-radius: 12px 12px 0 0;
}

.sbpg-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 400ms ease;
}

.sbpg-hover-zoom:hover .sbpg-card-image img {
	transform: scale(1.06);
}

/* ── Badge ── */
.sbpg-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	background: #c9a96e;
	color: #fff;
	border-radius: 4px;
	line-height: 1.4;
}

.sbpg-card-image .sbpg-badge {
	position: absolute;
	top: 12px;
	left: 12px;
}

.sbpg-badge-inline { margin-bottom: 10px; }

/* ── Card body ── */
.sbpg-card-body {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ── Title ── */
.sbpg-card-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 10px;
}

.sbpg-card-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 200ms ease;
}

.sbpg-card-title a:hover { color: #c9a96e; }

/* ── Meta ── */
.sbpg-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 13px;
	color: #888;
	margin-bottom: 10px;
}

.sbpg-meta svg {
	width: 13px;
	height: 13px;
	display: inline-block;
	vertical-align: middle;
	margin-right: 3px;
}

.sbpg-meta-sep { opacity: 0.4; }

/* ── Excerpt ── */
.sbpg-excerpt {
	font-size: 14px;
	color: #555;
	line-height: 1.6;
	margin: 0 0 16px;
	flex: 1;
}

/* ── Read More ── */
.sbpg-read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #c9a96e;
	text-decoration: none;
	letter-spacing: 0.04em;
	margin-top: auto;
	transition: gap 200ms ease, color 200ms ease;
}

.sbpg-read-more:hover { gap: 10px; }

.sbpg-read-more svg { width: 14px; height: 14px; }

/* ── No posts ── */
.sbpg-no-posts {
	color: #888;
	font-style: italic;
	padding: 20px 0;
	grid-column: 1 / -1;
}

/* ── Pagination ── */
.sbpg-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 36px;
}

.sbpg-pag-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	background: transparent;
	border: 1.5px solid #555;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	cursor: pointer;
	transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.sbpg-pag-btn:hover:not(.active),
.sbpg-pag-btn.active {
	background: #c9a96e;
	border-color: #c9a96e;
	color: #fff;
}

.sbpg-pag-btn.disabled {
	opacity: 0.4;
	pointer-events: none;
}

/* ── Loading spinner ── */
.sbpg-loading {
	display: none;
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.7);
	z-index: 10;
	border-radius: 12px;
}

.sbpg-wrapper {
	position: relative;
}

.sbpg-wrapper.sbpg-is-loading .sbpg-loading {
	display: flex;
}

.sbpg-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(201,169,110,0.2);
	border-top-color: #c9a96e;
	border-radius: 50%;
	animation: sbpg-spin 600ms linear infinite;
}

@keyframes sbpg-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 1024px) {
	.sbpg-layout-grid { grid-template-columns: repeat(2, 1fr); }
	.sbpg-card-list .sbpg-card-image-link { flex: 0 0 200px; }
}

@media (max-width: 768px) {
	.sbpg-layout-grid { grid-template-columns: 1fr; }
	.sbpg-card-list { flex-direction: column; }
	.sbpg-card-list .sbpg-card-image { height: 180px !important; border-radius: 12px 12px 0 0 !important; }
	.sbpg-card-list .sbpg-card-image-link { flex: none; }
	.sbpg-tabs { gap: 6px; }
	.sbpg-tab-btn { padding: 6px 14px; font-size: 12px; }
}
