/* ── TZ Posts Grid Widget ─────────────────────────────────────────── */

.tz-pg-wrapper {
	position: relative;
}

/* ── Filter Bar ──────────────────────────────────────────────────── */

.tz-pg-filterbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 32px;
}

.tz-pg-filter-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border-radius: 50px;
	border: none;
	background: #f0eeeb;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.tz-pg-filter-btn:hover {
	background: #e5e3e0;
}

.tz-pg-filter-btn.is-active {
	background: #1a1a1a;
	color: #ffffff;
}

/* ── Grid ────────────────────────────────────────────────────────── */

.tz-pg-grid--grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	row-gap: 24px;
	align-items: start;
}

.tz-pg-grid--list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ── Card ────────────────────────────────────────────────────────── */

.tz-pg-card {
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tz-pg-card:hover {
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* List view */
.tz-pg-card--list {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: stretch;
}

.tz-pg-card--list .tz-pg-card-header {
	width: 100%;
	order: 0;
}

.tz-pg-card--list .tz-pg-card-image {
	order: 1;
	width: 240px;
	flex-shrink: 0;
	min-height: 160px;
	height: auto !important;
	margin: 0 0 0 16px;
	align-self: stretch;
}

.tz-pg-card--list .tz-pg-card-image .tz-pg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tz-pg-card--list .tz-pg-card-body {
	order: 2;
	flex: 1;
	min-width: 0;
}

/* ── Card Header (Badge) ─────────────────────────────────────────── */

.tz-pg-card-header {
	padding: 16px 16px 0;
}

/* ── Badge ───────────────────────────────────────────────────────── */

.tz-pg-badge {
	display: inline-block;
	background: #f5c842;
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	border-radius: 50px;
	padding: 6px 14px;
	line-height: 1;
}

/* ── Card Image ──────────────────────────────────────────────────── */

.tz-pg-card-image {
	margin: 12px 16px 0;
	height: 200px;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	flex-shrink: 0;
}

.tz-pg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: inherit;
}

.tz-pg-img-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 100%;
	background: #f0f0f0;
	border: 1.5px dashed #d0d0d0;
	border-radius: inherit;
	color: #aaaaaa;
	font-size: 12px;
}

/* ── Card Body ───────────────────────────────────────────────────── */

.tz-pg-card-body {
	padding: 16px 20px 24px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* ── Meta ────────────────────────────────────────────────────────── */

.tz-pg-meta {
	font-size: 13px;
	color: #888888;
	margin-bottom: 8px;
	line-height: 1;
}

/* ── Title ───────────────────────────────────────────────────────── */

.tz-pg-title {
	font-size: 17px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 10px;
	line-height: 1.35;
	padding: 0;
}

.tz-pg-title a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.tz-pg-title a:hover {
	opacity: 0.7;
}

/* ── Excerpt ─────────────────────────────────────────────────────── */

.tz-pg-excerpt {
	font-size: 14px;
	color: #666666;
	line-height: 1.65;
	margin: 0 0 16px;
	flex-grow: 1;
}

/* ── CTA ─────────────────────────────────────────────────────────── */

.tz-pg-cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 700;
	font-size: 14px;
	color: #1a1a1a;
	text-decoration: none;
	margin-top: auto;
	transition: opacity 0.15s ease;
}

.tz-pg-cta:hover {
	opacity: 0.65;
	color: #1a1a1a;
}

.tz-pg-cta-icon {
	display: inline-flex;
	align-items: center;
	font-size: 0.9em;
}

/* ── No results ──────────────────────────────────────────────────── */

.tz-pg-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	color: #888888;
	font-style: italic;
}

/* ── Load More ───────────────────────────────────────────────────── */

.tz-pg-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.tz-pg-load-more-wrap[hidden] {
	display: none;
}

.tz-pg-load-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 32px;
	border-radius: 50px;
	border: 1px solid #1a1a1a;
	background: #ffffff;
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tz-pg-load-more:hover {
	background: #f0eeeb;
}

.tz-pg-load-more:disabled {
	opacity: 0.5;
	cursor: default;
}

/* ── Loading state ───────────────────────────────────────────────── */

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

.tz-pg-wrapper.is-loading .tz-pg-loading {
	display: flex;
}

.tz-pg-wrapper.is-loading .tz-pg-grid {
	pointer-events: none;
}

.tz-pg-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #1a1a1a;
	border-radius: 50%;
	animation: tz-pg-spin 0.65s linear infinite;
}

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

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.tz-pg-grid--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.tz-pg-grid--grid {
		grid-template-columns: 1fr;
	}

	.tz-pg-card--list {
		flex-direction: column;
	}

	.tz-pg-card--list .tz-pg-card-image {
		width: auto;
		margin: 0 16px;
		height: 180px !important;
		min-height: 0;
	}
}
