/**
 * EK Featured Posts – responsive grid
 * Desktop: 50% left (full height), 50% right (top 70% / bottom 30% split, bottom two equal)
 * Thin white gutters. Mobile: 4 stacked; category badge hidden.
 * Compatible with modern browsers + fallbacks for older ones (no Grid = stacked layout).
 */

@media (max-width: 767px) {
  .ek-featured-row {
    margin-left: -20px;
    margin-right: -20px;
  }
}

.ekfp-wrap {
	--ekfp-gap: 3px;
	--ekfp-overlay: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
	width: 100%;
	margin: 0 auto;
	background: #fff;
}

.ekfp-grid {
	display: grid;
	gap: 3px;
	gap: var(--ekfp-gap);
	grid-template-columns: 1fr;
	grid-template-rows: auto;
	grid-auto-rows: minmax(200px, auto);
	background: #fff;
}

/* Fallback when CSS Grid is not supported (e.g. IE11): stacked layout */
@supports not (display: grid) {
	.ekfp-grid {
		display: block;
	}
	.ekfp-item {
		display: block;
		width: 100%;
		margin-bottom: 3px;
	}
	.ekfp-item:last-child {
		margin-bottom: 0;
	}
}

.ekfp-item {
	position: relative;
	display: block;
	min-height: 300px;
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	margin: 0;
}

.ekfp-item__bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: #1a1a1a;
}

.ekfp-item__bg img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
.ekfp-item img {
    transition: opacity 0.3s, transform 0.3s;
    -webkit-transition: opacity 0.3s, transform 0.3s;
	overflow: hidden;
}
.ekfp-item img:hover {
	transform: scale3d(1.1, 1.1, 1);
	-webkit-transform: scale3d(1.1, 1.1, 1);
}

.ekfp-item__overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
	background: var(--ekfp-overlay);
	pointer-events: none;
}

/* Video play icon: centered on card when post format is video */
.ekfp-item .td-video-play-ico {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	pointer-events: none;
	-webkit-transform: translate(-50%, -50%);
	-ms-transform: translate(-50%, -50%);
	transform: translate(-50%, -50%);
}

.ekfp-item__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px 16px 16px;
	z-index: 1;
}

.ekfp-item__cat {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 6px;
	padding: 4px 8px;
	background: #15729a;
	color: #fff;
	-webkit-transition: background-color 0.25s ease;
	transition: background-color 0.25s ease;
}

.ekfp-item:hover .ekfp-item__cat {
	background-color: #0399B7;
}

.ekfp-item__title {
	margin: 0;
	font-size: 1.2rem;
	font-size: clamp(1.2rem, 2.5vw, 1.35rem);
	line-height: 1.25;
	font-weight: 500;
	color: #fff;
	/* Truncate visually when not enough space over the thumb */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ekfp-item__meta {
	display: block;
	font-size: 0.75rem;
	opacity: 0.85;
	margin-top: 4px;
}

/* Desktop: min-width 1019px – 50% left (full height), 50% right (top 70%, bottom 30% two equal); white gutters */
@media (min-width: 1019px) {
	.ekfp-item {
		position: relative;
		display: block;
		min-height: 220px;
		overflow: hidden;
		text-decoration: none;
		color: #fff;
	}
	.ekfp-grid {
		grid-template-columns: 1fr 1fr 1fr 1fr;
		grid-template-rows: 5fr 3fr;
		min-height: 420px;
	}

	.ekfp-item--primary {
		grid-column: 1 / span 2;
		grid-row: 1 / -1;
		min-height: 100%;
	}

	.ekfp-item--secondary {
		grid-column: 3 / span 2;
		grid-row: 1;
	}

	.ekfp-item--tertiary {
		grid-column: 3;
		grid-row: 2;
	}

	.ekfp-item--quaternary {
		grid-column: 4;
		grid-row: 2;
	}

	.ekfp-item--primary .ekfp-item__title {
		font-size: 1.5rem;
		font-size: clamp(1.2rem, 1.8vw, 1.75rem);
		font-weight: 500;
	}
}

/* Grid fallback in desktop: keep stacked if grid unsupported */
@supports not (display: grid) {
	@media (min-width: 1019px) {
		.ekfp-item {
			margin-bottom: 3px;
		}
	}
}

/* Mobile: hide category badge */
@media (max-width: 1018px) {
	.ekfp-item__cat {
		display: none;
	}
}
