/* ── ITC Posts Grid ──────────────────────────────────────────────────────── */

.itc-posts {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: var(--itcp-gap, 24px);
}
.itc-posts--cols-1 { grid-template-columns: minmax( 0, 1fr ); }
.itc-posts--cols-2 { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
.itc-posts--cols-4 { grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); }

/* Tablet: up to 2 columns. Phone: 1 column (Salient breakpoints). */
@media ( max-width: 999px ) {
	.itc-posts--cols-3,
	.itc-posts--cols-4 { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
}
@media ( max-width: 690px ) {
	.itc-posts { grid-template-columns: minmax( 0, 1fr ) !important; }
}

/* ── Card (whole box is the link) ────────────────────────────────────────── */

.itc-posts a.itc-posts__card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
	overflow: hidden;
	border: var(--itcp-bw, 1px) solid var(--itcp-bc, #e5e5e5);
	border-radius: var(--itcp-radius, 12px);
	background-color: var(--itcp-card-bg, #fff);
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}
.itc-posts a.itc-posts__card:hover,
.itc-posts a.itc-posts__card:focus {
	text-decoration: none;
	color: inherit;
}
.itc-posts a.itc-posts__card:focus-visible {
	outline: 2px solid var(--itcp-more-color, #4f7a28);
	outline-offset: 3px;
}

/* ── Image (fixed height, also when there is no featured image) ──────────── */

.itc-posts .itc-posts__media {
	flex: 0 0 auto;
	height: var(--itcp-img-h, 194px);
	background-color: var(--itcp-ph-bg, #e9ece6);
	overflow: hidden;
	line-height: 0;
}
.itc-posts .itc-posts__media img.itc-posts__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: var(--itcp-img-fit, cover);
	object-position: center;
}

/* ── Text section ────────────────────────────────────────────────────────── */

.itc-posts .itc-posts__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: var(--itcp-pad, 22px 18px);
}

.itc-posts .itc-posts__body .itc-posts__cat {
	margin: 0 0 var(--itcp-cat-mb, 12px);
	color: var(--itcp-cat-color, #4f7a28);
	font-size: var(--itcp-cat-size, 13px);
	line-height: var(--itcp-cat-lh, 1.4);
	font-weight: var(--itcp-cat-weight, 600);
	text-transform: var(--itcp-cat-transform, uppercase);
	letter-spacing: 0.02em;
}

.itc-posts .itc-posts__body .itc-posts__title {
	margin: 0 0 var(--itcp-title-mb, 20px);
	padding: 0;
	color: var(--itcp-title-color, #555);
	font-size: var(--itcp-title-size, 18px);
	line-height: var(--itcp-title-lh, 1.45);
	font-weight: var(--itcp-title-weight, 400);
	letter-spacing: normal;
	text-transform: none;
	transition: color 0.25s ease;
}
.itc-posts--clamp .itc-posts__body .itc-posts__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--itcp-title-lines, 2);
	line-clamp: var(--itcp-title-lines, 2);
	overflow: hidden;
}
.itc-posts a.itc-posts__card:hover .itc-posts__title {
	color: var(--itcp-title-color-h, var(--itcp-title-color, #555));
}

/* Read more sits at the bottom so all boxes line up */
.itc-posts .itc-posts__body .itc-posts__more {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	color: var(--itcp-more-color, #4f7a28);
	font-size: var(--itcp-more-size, 16px);
	line-height: var(--itcp-more-lh, 1.4);
	font-weight: var(--itcp-more-weight, 600);
	transition: color 0.25s ease;
}
.itc-posts a.itc-posts__card:hover .itc-posts__more {
	color: var(--itcp-more-color-h, var(--itcp-more-color, #4f7a28));
}
.itc-posts .itc-posts__arrow {
	display: block;
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	transition: transform 0.25s ease;
}
.itc-posts a.itc-posts__card:hover .itc-posts__arrow {
	transform: translateX( 3px );
}
.itc-posts__title:last-child,
.itc-posts__cat:last-child {
	margin-bottom: 0 !important;
}

@media ( prefers-reduced-motion: reduce ) {
	.itc-posts .itc-posts__arrow { transition: none; }
	.itc-posts a.itc-posts__card:hover .itc-posts__arrow { transform: none; }
}
/* ── Smooth image zoom on hover ──────────────────────────────────────────── */

.itc-posts .itc-posts__media img.itc-posts__img {
	transition: transform 0.6s cubic-bezier( 0.25, 0.46, 0.45, 0.94 );
	will-change: transform;
}
.itc-posts a.itc-posts__card:hover .itc-posts__media img.itc-posts__img,
.itc-posts a.itc-posts__card:focus-visible .itc-posts__media img.itc-posts__img {
	transform: scale( 1.06 );
}

@media ( prefers-reduced-motion: reduce ) {
	.itc-posts .itc-posts__media img.itc-posts__img {
		transition: none;
	}
	.itc-posts a.itc-posts__card:hover .itc-posts__media img.itc-posts__img,
	.itc-posts a.itc-posts__card:focus-visible .itc-posts__media img.itc-posts__img {
		transform: none;
	}
}