/* ========================================================
   JA Canada — Featured Grid Widget Styles
   Scoped under .jac-fg to avoid theme conflicts.
   ======================================================== */

.jac-fg,
.jac-fg * {
	box-sizing: border-box;
}

.jac-fg {
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	width: 100%;
	background: transparent;
	color: #fff;
}

/* Outer 2-column layout: featured left, 2x2 grid right */
.jac-fg__container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	align-items: stretch;
	width: 100%;
}

/* 2x2 grid of small cards */
.jac-fg__small-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 12px;
	min-width: 0;
}

/* ------------- Card base ------------- */
.jac-fg__card {
	position: relative;
	display: block;
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	background: #1B3C4F;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
	will-change: transform;
}

.jac-fg__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.35);
}

.jac-fg__card:focus-visible {
	outline: 3px solid #5EC4C6;
	outline-offset: 2px;
}

.jac-fg__card--featured {
	height: 100%;
	min-height: 100%;
}

.jac-fg__card--small {
	aspect-ratio: 16 / 11;
}

.jac-fg__card--empty {
	background: rgba(27, 60, 79, 0.08);
	pointer-events: none;
}

/* ------------- Image + overlay -------------
   Image is forced to cover the card. X/Y focal point
   is driven by CSS custom properties set per-slot by
   the Elementor controls (defaults to 50% / center).
*/
.jac-fg__card-image {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: var(--jac-fg-img-x, 50%) var(--jac-fg-img-y, 50%) !important;
	transition: transform 0.7s ease;
}

.jac-fg__card:hover .jac-fg__card-image {
	transform: scale(1.04);
}

.jac-fg__card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.85) 0%,
		rgba(0, 0, 0, 0.55) 35%,
		rgba(0, 0, 0, 0.15) 70%,
		rgba(0, 0, 0, 0) 100%
	);
}

/* ------------- Content ------------- */
.jac-fg__card-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px;
	z-index: 2;
}

/* Color cards: center content vertically */
.jac-fg__card--color .jac-fg__card-content {
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
	text-align: center;
}

.jac-fg__card-meta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.02em;
	margin-bottom: 10px;
	opacity: 0.95;
}

.jac-fg__card-category {
	font-weight: 600;
}

.jac-fg__card-title {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
	color: #fff;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.jac-fg__card--color .jac-fg__card-title {
	text-shadow: none;
}

.jac-fg__card--featured .jac-fg__card-title {
	font-size: 26px;
	line-height: 1.25;
}

/* ============================================
   RESPONSIVE — TABLET (≤1024px)
   Featured stacks on top, 2x2 grid below.
   ============================================ */
@media (max-width: 1024px) {
	.jac-fg__container {
		grid-template-columns: 1fr;
	}
	.jac-fg__card--featured {
		aspect-ratio: 16 / 9;
		min-height: 0;
		height: auto;
	}
	.jac-fg__card-content {
		padding: 22px;
	}
	.jac-fg__card-title {
		font-size: 17px;
	}
	.jac-fg__card--featured .jac-fg__card-title {
		font-size: 24px;
	}
}

/* ============================================
   RESPONSIVE — MOBILE (≤640px)
   Single-column stack of all 5 cards.
   ============================================ */
@media (max-width: 640px) {
	.jac-fg__container {
		gap: 10px;
	}
	.jac-fg__small-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		gap: 10px;
	}
	.jac-fg__card--small {
		aspect-ratio: 16 / 9;
	}
	.jac-fg__card--featured {
		aspect-ratio: 4 / 3;
	}
	.jac-fg__card-content {
		padding: 18px;
	}
	.jac-fg__card-meta {
		font-size: 11px;
		margin-bottom: 6px;
	}
	.jac-fg__card-title {
		font-size: 16px;
	}
	.jac-fg__card--featured .jac-fg__card-title {
		font-size: 20px;
	}
}
