/**
 * PSS Facebook Page — frontend grid and cards.
 */

.fbtp-container {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}

.fbtp-columns-1 {
	grid-template-columns: 1fr;
}

.fbtp-columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fbtp-columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fbtp-columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
	.fbtp-columns-4 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.fbtp-columns-3,
	.fbtp-columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.fbtp-columns-2,
	.fbtp-columns-3,
	.fbtp-columns-4 {
		grid-template-columns: 1fr;
	}
}

.fbtp-post {
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.fbtp-post:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.fbtp-post-image {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
	background: #f0f2f5;
}

.fbtp-post-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.fbtp-post:hover .fbtp-post-image img {
	transform: scale(1.05);
}

.fbtp-post-image--placeholder {
	background: linear-gradient(145deg, #e7f3ff 0%, #f0f2f5 50%, #dce7f5 100%);
}

.fbtp-post-placeholder-link {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	color: #1877f2 !important;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.fbtp-post-placeholder-link:hover {
	background: rgba(24, 119, 242, 0.08);
	color: #166fe5 !important;
}

.fbtp-post-placeholder-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 16px;
	text-align: center;
}

.fbtp-post-placeholder-ico {
	opacity: 0.85;
	flex-shrink: 0;
}

.fbtp-post-placeholder-text {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	max-width: 12rem;
}

.fbtp-post-content {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 0;
}

.fbtp-post-message {
	font-size: 14px;
	line-height: 1.5;
	color: #1c1e21;
	margin: 0 0 12px 0;
	flex-grow: 1;
}

.fbtp-post-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid #e4e6eb;
	margin-bottom: 12px;
}

.fbtp-post-meta--flush {
	padding-top: 0;
	border-top: none;
	margin-bottom: 12px;
}

.fbtp-post-date {
	font-size: 12px;
	color: #65676b;
}

.fbtp-post-stats {
	display: flex;
	gap: 12px;
	align-items: center;
}

.fbtp-stat {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: #65676b;
}

.fbtp-stat svg {
	opacity: 0.75;
	flex-shrink: 0;
}

.fbtp-reactions svg {
	color: #e74c3c;
}

.fbtp-comments svg {
	color: #3498db;
}

.fbtp-post .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.fbtp-post-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	margin-top: auto;
	background: #1877f2;
	color: #ffffff !important;
	text-decoration: none !important;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	transition: background-color 0.2s ease, transform 0.2s ease;
	text-align: center;
	justify-content: center;
}

.fbtp-post-link:hover {
	background: #166fe5;
	color: #ffffff !important;
}

.fbtp-post-link svg {
	flex-shrink: 0;
}

.fbtp-error {
	background: #fee2e2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 16px;
	border-radius: 8px;
	text-align: center;
}

.fbtp-empty {
	background: #f3f4f6;
	color: #6b7280;
	padding: 32px;
	border-radius: 8px;
	text-align: center;
	font-size: 14px;
}

@media (prefers-color-scheme: dark) {
	.fbtp-post {
		background: #242526;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	}

	.fbtp-post:hover {
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	}

	.fbtp-post-image {
		background: #3a3b3c;
	}

	.fbtp-post-image--placeholder {
		background: linear-gradient(145deg, #2d3748 0%, #3a3b3c 45%, #2c5282 100%);
	}

	.fbtp-post-placeholder-link {
		color: #8ab4ff !important;
	}

	.fbtp-post-placeholder-link:hover {
		background: rgba(138, 180, 255, 0.12);
		color: #aac8ff !important;
	}

	.fbtp-post-message {
		color: #e4e6eb;
	}

	.fbtp-post-meta {
		border-top-color: #3a3b3c;
	}

	.fbtp-post-meta--flush {
		border-top: none;
	}

	.fbtp-post-date,
	.fbtp-stat {
		color: #b0b3b8;
	}

	.fbtp-empty {
		background: #2d2d2d;
		color: #b0b3b8;
	}

	.fbtp-error {
		background: #3f1d1d;
		border-color: #7f1d1d;
		color: #fecaca;
	}
}
