/**
 * A Post List (UX Builder Element) Stylesheet
 * Dark Tech / Cyberchamfer Horizontal Cards
 *
 * @package Flatsome Child
 */

:root {
	--a-pl-card-bg: #060a14;
	--a-pl-border: rgba(40, 80, 150, 0.4);
	--a-pl-border-hover: rgba(96, 165, 250, 0.85);
	--a-pl-cat-color: #3b82f6;
	--a-pl-title-color: #ffffff;
	--a-pl-title-hover: #60a5fa;
	--a-pl-meta-color: #7b8ea8;
	--a-pl-desc-color: #94a3b8;
	--a-pl-more-color: #3b82f6;
	--a-pl-more-hover: #60a5fa;
	--a-pl-banner-w: 38%;
	--a-pl-spacing: 20px;
	--a-pl-corner: 14px;
}

/* Container */
.a-post-list {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--a-pl-spacing, 20px);
	box-sizing: border-box;
}

.a-post-list *,
.a-post-list *::before,
.a-post-list *::after {
	box-sizing: border-box;
}

/* Outer Card Wrapper (Creates 1px chamfered border: top-left, top-right, bottom-right. Bottom-left is SQUARE 90deg) */
.a-post-card-wrap {
	position: relative;
	background: var(--a-pl-border, rgba(40, 80, 150, 0.4));
	clip-path: polygon(var(--a-pl-corner, 16px) 0,
			calc(100% - var(--a-pl-corner, 16px)) 0,
			100% var(--a-pl-corner, 16px),
			100% calc(100% - var(--a-pl-corner, 16px)),
			calc(100% - var(--a-pl-corner, 16px)) 100%,
			0 100%,
			0 var(--a-pl-corner, 16px));
	padding: 1px;
	transition: background 0.3s ease, filter 0.3s ease, transform 0.3s ease;
	margin: 0;
	will-change: transform, filter;
}

.a-post-card-wrap:hover {
	background: var(--a-pl-border-hover, rgba(96, 165, 250, 0.85));
	filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(59, 130, 246, 0.25));
}

/* Inner Card Container */
.a-post-card {
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	background: var(--a-pl-card-bg, #060a14);
	clip-path: polygon(calc(var(--a-pl-corner, 16px) - 1px) 0,
			calc(100% - (var(--a-pl-corner, 16px) - 1px)) 0,
			100% calc(var(--a-pl-corner, 16px) - 1px),
			100% calc(100% - (var(--a-pl-corner, 16px) - 1px)),
			calc(100% - (var(--a-pl-corner, 16px) - 1px)) 100%,
			0 100%,
			0 calc(var(--a-pl-corner, 16px) - 1px));
	height: 205px;
	overflow: hidden;
	width: 100%;
}

/* Subtle corner highlight lines (aesthetic touch) */
.a-post-card::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 120px;
	height: 120px;
	background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 70%);
	pointer-events: none;
	z-index: 1;
}

/* Left Banner Container */
.a-post-banner {
	flex: 0 0 var(--a-pl-banner-w, 38%);
	width: var(--a-pl-banner-w, 38%);
	position: relative;
	overflow: hidden;
	background: #090e1c;
	min-height: 100%;
	/*
	 * Corners theo đúng thiết kế mẫu:
	 * - Góc trái bên trên: vát góc khớp với thẻ card & có góc xanh
	 * - Góc phải bên trên: vuông góc 100% 0
	 * - Góc phải bên dưới: "MẤT GÓC" (vát chéo 45 độ 28px)
	 * - Góc trái bên dưới: "BÌNH THƯỜNG" (vuông góc 90 độ 0 100%)
	 */
	clip-path: polygon(calc(var(--a-pl-corner, 16px) - 1px) 0,
			100% 0,
			100% calc(100% - 28px),
			calc(100% - 28px) 100%,
			0 100%,
			0 calc(var(--a-pl-corner, 16px) - 1px));
}

/* Góc màu xanh ở góc trái bên trên banner */
.a-post-banner-corner {
	position: absolute;
	top: 0;
	left: 0;
	width: 38px;
	height: 38px;
	background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
	clip-path: polygon(0 0, 100% 0, 0 100%);
	z-index: 6;
	pointer-events: none;
	box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
	transition: filter 0.3s ease, background 0.3s ease;
}

.a-post-banner-corner::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, transparent 48%, #60a5fa 49%, #93c5fd 52%, transparent 54%);
	pointer-events: none;
}

.a-post-card-wrap:hover .a-post-banner-corner {
	background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
	filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.9));
}

.a-post-banner-link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
	text-decoration: none;
}

.a-post-banner-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.a-post-card-wrap:hover .a-post-banner-img {
	transform: scale(1.05);
}

/* Fallback Banner (when post has no featured image) */
.a-post-banner-fallback {
	width: 100%;
	height: 100%;
	min-height: 195px;
	background: linear-gradient(135deg, #0b1329 0%, #060a14 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.a-post-banner-fallback::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(59, 130, 246, 0.08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
	background-size: 20px 20px;
	opacity: 0.6;
}

.a-post-fallback-icon {
	width: 44px;
	height: 44px;
	color: rgba(96, 165, 250, 0.3);
	position: relative;
	z-index: 1;
	transition: transform 0.4s ease, color 0.4s ease;
}

.a-post-card-wrap:hover .a-post-fallback-icon {
	transform: scale(1.1);
	color: rgba(96, 165, 250, 0.6);
}

/* Right Content Area */
.a-post-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 15px;
	position: relative;
	z-index: 2;
}

.a-post-header {
	margin-bottom: 8px;
}

/* Category Badge */
.a-post-category {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--a-pl-cat-color, #3b82f6);
	margin-bottom: 8px;
	text-decoration: none !important;
	transition: color 0.2s ease, opacity 0.2s ease;
	line-height: 1.2;
}

.a-post-category:hover {
	color: var(--a-pl-title-hover, #60a5fa);
	opacity: 0.9;
}

/* Post Title */
.a-post-title {
	margin: 0 0 8px 0 !important;
	padding: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--a-pl-title-color, #ffffff);
	letter-spacing: -0.01em;
}

.a-post-title a {
	color: var(--a-pl-title-color, #ffffff) !important;
	text-decoration: none !important;
	transition: color 0.25s ease;
	display: inline;
}

.a-post-title a:hover,
.a-post-card-wrap:hover .a-post-title a {
	color: var(--a-pl-title-hover, #60a5fa) !important;
}

/* Meta: Author & Date */
.a-post-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: var(--a-pl-meta-color, #7b8ea8);
	font-weight: 400;
	line-height: 1.4;
}

.a-post-author {
	color: var(--a-pl-meta-color, #7b8ea8);
}

.a-post-meta-sep {
	opacity: 0.6;
	font-size: 10px;
	user-select: none;
}

.a-post-date {
	color: var(--a-pl-meta-color, #7b8ea8);
}

/* Excerpt / Summary */
.a-post-excerpt {
	color: var(--a-pl-desc-color, #94a3b8);
	font-size: 13px;
	line-height: 1.6;
	margin: 0 0 5px 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
}

.a-post-excerpt p {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

/* Footer & Read More Link */
.a-post-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

.a-post-readmore {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--a-pl-more-color, #3b82f6) !important;
	text-decoration: none !important;
	transition: color 0.25s ease;
	cursor: pointer;
}

.a-post-readmore:hover,
.a-post-card-wrap:hover .a-post-readmore {
	color: var(--a-pl-more-hover, #60a5fa) !important;
}

.a-post-arrow {
	width: 15px;
	height: 15px;
	stroke-width: 2.5;
	transition: transform 0.25s ease;
	flex-shrink: 0;
}

.a-post-readmore:hover .a-post-arrow,
.a-post-card-wrap:hover .a-post-readmore .a-post-arrow {
	transform: translateX(5px);
}

/* Pagination */
.a-post-list-pagination {
	margin-top: 36px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.a-post-list-pagination.a-pl-align-left {
	justify-content: flex-start;
}

.a-post-list-pagination.a-pl-align-center {
	justify-content: center;
}

.a-post-list-pagination.a-pl-align-right {
	justify-content: flex-end;
}

.a-post-list-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	background: var(--a-pl-card-bg, #060a14);
	border: 1px solid var(--a-pl-border, rgba(40, 80, 150, 0.4));
	color: var(--a-pl-meta-color, #94a3b8);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	border-radius: 8px;
	transition: all 0.25s ease;
}

.a-post-list-pagination .page-numbers:hover {
	border-color: var(--a-pl-border-hover, #3b82f6);
	color: #ffffff;
	background: rgba(37, 99, 235, 0.15);
}

.a-post-list-pagination .page-numbers.current {
	background: var(--primary-color, #2563eb);
	border-color: var(--primary-color, #2563eb);
	color: #ffffff;
}

.a-post-list-pagination .page-numbers.dots {
	background: transparent;
	border: none;
	box-shadow: none;
	color: var(--a-pl-meta-color, #64748b);
	min-width: auto;
}

.a-post-list-pagination .page-numbers svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
}

/* Empty State / Notice */
.a-post-list-empty {
	padding: 40px 24px;
	text-align: center;
	background: #060a14;
	border: 1px dashed rgba(40, 80, 150, 0.5);
	border-radius: 12px;
	color: #94a3b8;
	font-size: 14px;
	line-height: 1.6;
}

.a-post-list-empty a {
	color: #3b82f6;
	text-decoration: underline;
}

/* Preview Demo Badge in UX Builder */
.a-post-demo-badge {
	display: inline-block;
	padding: 3px 8px;
	background: rgba(234, 179, 8, 0.15);
	border: 1px solid rgba(234, 179, 8, 0.4);
	color: #fbbf24;
	font-size: 11px;
	border-radius: 4px;
	margin-bottom: 12px;
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
	.a-post-card {
		flex-direction: column;
	}

	.a-post-banner {
		flex: 0 0 auto;
		width: 100%;
		height: 220px;
	}

	.a-post-content {
		padding: 20px 22px;
	}

	.a-post-title {
		font-size: 17px;
	}
}

@media (max-width: 550px) {
	.a-post-banner {
		height: 180px;
	}

	.a-post-content {
		padding: 18px 18px 16px 18px;
	}

	.a-post-title {
		font-size: 16px;
		line-height: 1.35;
	}

	.a-post-meta {
		font-size: 12px;
		gap: 6px;
		margin-bottom: 10px;
	}

	.a-post-excerpt {
		font-size: 13px;
		line-height: 1.5;
		margin-bottom: 14px;
	}

	.a-post-readmore {
		font-size: 11.5px;
	}
}