/* =====================================================================
   BW Blog Feed
   Grid rapi, infinite scroll (AJAX), hover: overlay warna + zoom gambar.
   ===================================================================== */

.bw-blog-feed {
	--bw-blog-columns: 3;
	--bw-blog-gap: 24px;
	--bw-blog-accent: #DCA54A;
	width: 100%;
	box-sizing: border-box;
}
.bw-blog-feed *, .bw-blog-feed *::before, .bw-blog-feed *::after {
	box-sizing: border-box;
}

.bw-blog-feed__grid {
	display: grid;
	grid-template-columns: repeat(var(--bw-blog-columns), 1fr);
	gap: var(--bw-blog-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --- Card --- */
.bw-blog-card {
	margin: 0;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 14px;
	overflow: hidden;
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.bw-blog-card:hover {
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.bw-blog-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.bw-blog-card__thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: #f2f2f2;
	font-size: 0;
	line-height: 0;
}

.bw-blog-card__thumb img,
.bw-blog-card__img {
	/* Posisi absolute + inset 0 supaya gambar SELALU penuh mengisi kotak
	   thumbnail, walau file gambar asli dari WordPress punya atribut
	   width/height/rasio yang beda (mencegah celah/ruang kosong di
	   dalam kotak thumbnail, apapun ukuran/rasio file aslinya). */
	position: absolute !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	min-width: 100% !important;
	min-height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block;
	margin: 0;
	padding: 0;
	transition: transform 0.5s ease;
}

.bw-blog-card:hover .bw-blog-card__img {
	transform: scale(1.08);
}

.bw-blog-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px 20px 20px;
}

.bw-blog-card__title {
	color: #1a1a1a;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 16px 0;
	transition: color 0.25s ease;
	/* Batasi maksimal 3 baris supaya tinggi card konsisten */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bw-blog-card:hover .bw-blog-card__title {
	color: var(--bw-blog-accent);
}

.bw-blog-card__meta {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 8px;
}

.bw-blog-card__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--bw-blog-accent);
	font-size: 13px;
	font-weight: 500;
}

.bw-blog-card__icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.bw-blog-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid #eee;
	color: var(--bw-blog-accent);
	transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.bw-blog-card__arrow svg {
	width: 16px;
	height: 16px;
}

.bw-blog-card:hover .bw-blog-card__arrow {
	background: var(--bw-blog-accent);
	border-color: var(--bw-blog-accent);
	color: #fff;
	transform: rotate(45deg);
}

/* --- Infinite scroll sentinel & loader --- */
.bw-blog-feed__sentinel {
	height: 1px;
}

.bw-blog-feed__loader {
	display: flex;
	justify-content: center;
	padding: 28px 0 4px;
}

.bw-blog-feed__loader[hidden] {
	display: none;
}

.bw-blog-feed__spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid #eee;
	border-top-color: var(--bw-blog-accent);
	animation: bw-blog-spin 0.8s linear infinite;
}

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

/* =====================================================================
   RESPONSIVE
   Desktop : sesuai atribut columns (default 3)
   Tablet  : 2 kolom
   Mobile  : 1 kolom
   ===================================================================== */
@media (max-width: 1024px) and (min-width: 768px) {
	.bw-blog-feed { --bw-blog-gap: 20px; }
	.bw-blog-feed__grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 767px) {
	.bw-blog-feed { --bw-blog-gap: 16px; }
	.bw-blog-feed__grid { grid-template-columns: 1fr !important; }
}
