/**
 * Featured Posts Grid for Elementor
 * Matches the OpinionHunt magazine layout: 2 large hero cards + a row of small cards.
 */

.fpg-grid {
	--fpg-small-columns: 4;
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
	/* Outer rounding of the whole widget block; overridden by the
	   "Widget Corner Radius" control in Style -> Layout. */
	border-radius: 16px;
	overflow: hidden;
}

/* Row: large hero cards (two, side by side) */
.fpg-row--large {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-auto-rows: 1fr;
	align-items: stretch;
	gap: inherit;
}

/* Row: small cards, count driven by the --fpg-small-columns var */
.fpg-row--small {
	display: grid;
	grid-template-columns: repeat(var(--fpg-small-columns), 1fr);
	grid-auto-rows: 1fr;
	align-items: stretch;
	gap: inherit;
}

.fpg-item--large {
	min-height: 330px;
}

.fpg-item--small {
	min-height: 175px;
}

/* Card shell */
.fpg-item {
	position: relative;
	display: block;
	height: 100%; /* fill the grid track so paired cards match height */
	overflow: hidden;
	border-radius: 12px;
	isolation: isolate;
	background-color: #d8d5cd;
}

/* Background image layer */
.fpg-item__image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transition: transform 0.6s ease;
	z-index: 1;
}

.fpg-item__image--placeholder {
	background-color: #cbc7bd;
}

/* Dark gradient so text stays legible over any photo.
   (The Elementor "Gradient Color" control overrides this via inline CSS.) */
.fpg-item__overlay {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 42%, rgba(0, 0, 0, 0) 78%);
	z-index: 2;
	pointer-events: none;
}

/* Text block anchored to the bottom-left */
.fpg-item__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fpg-item--small .fpg-item__content {
	padding: 18px;
	gap: 7px;
}

/* Category eyebrow: uppercase, spaced-out sans-serif */
.fpg-item__category {
	display: block;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff;
	opacity: 0.9;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* Title: serif display face, as in the reference */
.fpg-item__title {
	margin: 0;
	color: #ffffff;
	font-family: Georgia, "Times New Roman", "Playfair Display", serif;
	font-weight: 700;
	line-height: 1.2;
	font-size: 28px;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.fpg-item--small .fpg-item__title {
	font-size: 17px;
	line-height: 1.25;
}

/* Whole-card link overlay */
.fpg-item__link {
	position: absolute;
	inset: 0;
	z-index: 4;
	text-indent: -9999px;
	overflow: hidden;
}

/* Hover: gentle image zoom when enabled */
.fpg-hover-zoom-yes .fpg-item:hover .fpg-item__image {
	transform: scale(1.06);
}

/* Screen-reader-only helper (in case the theme lacks it) */
.fpg-grid .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fpg-empty {
	padding: 24px;
	text-align: center;
	color: #777;
	border: 1px dashed #ccc;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

/* NOTE: small-row column count is driven by the responsive "Small Card Columns"
   control (--fpg-small-columns: 4 / 2 / 1 across breakpoints), so it is not
   hardcoded here. These queries handle only what that control does not. */

/* Tablet */
@media (max-width: 1024px) {
	.fpg-item--large {
		min-height: 280px;
	}
}

/* Mobile: stack the two hero cards */
@media (max-width: 767px) {
	.fpg-row--large {
		grid-template-columns: 1fr;
	}
	.fpg-item--large,
	.fpg-item--small {
		min-height: 240px;
	}
	.fpg-item--small .fpg-item__title {
		font-size: 20px;
	}
}
