/* Rakam News Grid — [rakam_news] shortcode.
   Scoped to .rakam-news-* classes so it won't collide with theme/Elementor
   styling. Swap --rakam-news-red for the exact brand hex if it differs. */

.rakam-news-grid {
	--rakam-news-red: #E42D33;
	display: grid;
	grid-template-columns: repeat(var(--rakam-news-columns, 3), 1fr);
	gap: 50px 40px;
}

.rakam-news-card {
	display: flex;
	flex-direction: column;
}

.rakam-news-thumb-wrap {
	position: relative;
	display: block;
	text-decoration: none;
	margin-bottom: 34px;
}

.rakam-news-thumb {
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: #f2f2f2;
	aspect-ratio: 16 / 9;
}

.rakam-news-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}

.rakam-news-card:hover .rakam-news-thumb img {
	transform: scale(1.04);
}

/* Red date badge — overlaps the bottom-left corner of the image. */
.rakam-news-date {
	position: absolute;
	left: 20px;
	bottom: -18px;
	background: var(--rakam-news-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .2px;
	padding: 10px 18px;
	border-radius: 3px;
	white-space: nowrap;
	line-height: 1;
}

/* Title — deliberately smaller than a typical blog-card title. */
.rakam-news-title {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 1.4;
	font-weight: 700;
}

.rakam-news-title a {
	color: #16171a;
	text-decoration: none;
}

.rakam-news-title a:hover {
	color: var(--rakam-news-red);
}

/* Excerpt — deliberately smaller/shorter than a typical blog-card excerpt;
   the word-count trim happens in PHP (rakam_news shortcode "words" attr,
   default 16), and line-clamp is a visual backstop in case a theme's own
   excerpt filter returns more than that. */
.rakam-news-excerpt {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.7;
	color: #6a6a6a;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rakam-news-readmore {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #16171a;
	text-decoration: none;
	margin-top: auto;
}

.rakam-news-arrow {
	transition: transform .2s ease;
}

.rakam-news-readmore:hover {
	color: var(--rakam-news-red);
}

.rakam-news-readmore:hover .rakam-news-arrow {
	transform: translateX(4px);
}

@media (max-width: 900px) {
	.rakam-news-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.rakam-news-grid {
		grid-template-columns: 1fr;
	}
}
