/* Category Grid Cards for Elementor */

.cgc-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
}

.cgc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-height: 190px;
	padding: 24px;
	border-radius: 14px;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(135deg, #f7f7f7 0%, #e8eaea 100%);
	color: #111;
	text-decoration: none;
	transition: transform .3s ease, box-shadow .3s ease;
}

a.cgc-card:hover,
a.cgc-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
}

/* ---------- Overlay (sits above the image, below the text) ---------- */
.cgc-card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

/* ---------- Text ---------- */
.cgc-content {
	position: relative;
	z-index: 3;
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	width: 75%;
}

.cgc-title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.15;
	color: #111;
}

.cgc-desc {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	color: #444;
}

/* ---------- Arrow button ---------- */
.cgc-btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(0, 0, 0, .22);
	border-radius: 50%;
	background: #fff;
	color: #111;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.cgc-btn svg {
	display: block;
	width: 16px;
	height: 16px;
}

.cgc-grid .cgc-card:hover .cgc-btn {
	background: #111;
	border-color: #111;
	color: #fff;
}

/* ---------- Image (CSS background, theme-proof) ---------- */
.cgc-media {
	position: absolute;
	z-index: 1;
	pointer-events: none;
	background-repeat: no-repeat;
	background-size: contain;
	transition: transform .5s ease;
}

.cgc-card:hover .cgc-media {
	transform: scale(1.04);
}

/* Right: image on the right, text on the left */
.cgc-mode-right .cgc-media {
	top: 0;
	right: 0;
	bottom: 0;
	width: 55%;
	background-position: right center;
	transform-origin: right center;
}

/* Left: image on the left, text pushed to the right */
.cgc-mode-left .cgc-media {
	top: 0;
	left: 0;
	bottom: 0;
	width: 55%;
	background-position: left center;
	transform-origin: left center;
}

.cgc-mode-left .cgc-content {
	margin-left: auto;
}

/* Top: image on top, text at the bottom */
.cgc-mode-top .cgc-media {
	top: 0;
	left: 0;
	right: 0;
	height: 50%;
	background-position: center top;
	transform-origin: center top;
}

/* Bottom: text at the top, image at the bottom */
.cgc-mode-bottom .cgc-media {
	bottom: 0;
	left: 0;
	right: 0;
	height: 50%;
	background-position: center bottom;
	transform-origin: center bottom;
}

/* Top and bottom cards: text and arrow sit side by side */
.cgc-card.cgc-mode-top .cgc-content,
.cgc-card.cgc-mode-bottom .cgc-content {
	flex: none;
	flex-direction: row;
	align-items: flex-end;
	justify-content: space-between;
	width: 100%;
}

.cgc-card.cgc-mode-top .cgc-content {
	margin-top: auto;
}

.cgc-card.cgc-mode-bottom .cgc-content {
	align-items: flex-start;
}

/* Cover: image fills the whole card */
.cgc-card.cgc-mode-cover .cgc-media {
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
}

/* ---------- Soft fade where the image meets the card ---------- */
.cgc-fade .cgc-mode-right .cgc-media {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
	mask-image: linear-gradient(to right, transparent 0, #000 30%);
}

.cgc-fade .cgc-mode-left .cgc-media {
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 30%);
	mask-image: linear-gradient(to left, transparent 0, #000 30%);
}

.cgc-fade .cgc-mode-top .cgc-media {
	-webkit-mask-image: linear-gradient(to top, transparent 0, #000 30%);
	mask-image: linear-gradient(to top, transparent 0, #000 30%);
}

.cgc-fade .cgc-mode-bottom .cgc-media {
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
}

/* ---------- Responsive defaults (Elementor controls override these) ---------- */
@media (max-width: 1024px) {
	.cgc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.cgc-card {
		min-height: 170px;
	}
}

@media (max-width: 767px) {
	.cgc-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr));
	}
	.cgc-card {
		min-height: 150px;
		padding: 20px;
	}
	.cgc-title {
		font-size: 20px;
	}
}
