/* ============================================================
   VIO Omidvar Options — Frontend Styles
   Author: حسین نظری | VIO Web Team | vioweb.ir
   ============================================================ */

/* ── Grid container ─────────────────────────────────────── */
.vio-services-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	direction: rtl;
	/* isolation: new stacking context — prevents cards leaking above
	   other page sections (forms, nav, etc.) on mobile */
	isolation: isolate;
	position: relative;
	z-index: 0;
}

/* Responsive fallbacks (overridden by Elementor responsive selectors) */
@media (max-width: 1024px) {
	.vio-services-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.vio-services-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Single card ─────────────────────────────────────────── */
.vio-service-card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 3 / 4;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	-webkit-font-smoothing: antialiased;
	/* Contain stacking context inside each card so internal z-index
	   values (overlay=1, content=2) never escape outside the card */
	isolation: isolate;
	/* Ensure the card itself never floats above sibling sections */
	z-index: auto;
	/* Prevent any transform on the card root from creating a new
	   stacking context relative to the page */
	transform: translateZ(0);
}

/* ── Background image ────────────────────────────────────── */
.vio-service-card__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

.vio-service-card:hover .vio-service-card__bg {
	transform: scale(1.06);
}

/* ── Dark gradient overlay ───────────────────────────────── */
.vio-service-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(10, 10, 30, 0.80) 0%,
		rgba(10, 10, 30, 0.20) 55%,
		transparent 100%
	);
	transition: background 0.4s ease;
	z-index: 1;
}

.vio-service-card:hover .vio-service-card__overlay {
	background: linear-gradient(
		to top,
		rgba(10, 10, 40, 0.90) 0%,
		rgba(10, 10, 40, 0.50) 60%,
		rgba(10, 10, 40, 0.10) 100%
	);
}

/* ── Text content ────────────────────────────────────────── */
.vio-service-card__content {
	position: absolute;
	bottom: 0;
	right: 0;
	left: 0;
	z-index: 2;
	padding: 24px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	direction: rtl;
	text-align: right;
	transition: transform 0.4s ease;
}

.vio-service-card:hover .vio-service-card__content {
	transform: translateY(-4px);
}

/* ── Label (سرویس‌ها و خدمات ما) ────────────────────────── */
.vio-service-card__label {
	display: inline-block;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.03em;
	color: #a78bfa;
	opacity: 0.90;
	font-family: inherit;
	line-height: 1.4;
}

/* ── Title ───────────────────────────────────────────────── */
.vio-service-card__title {
	margin: 0;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	color: #ffffff;
	font-family: inherit;
	word-break: break-word;
}

/* ── Excerpt (optional) ──────────────────────────────────── */
.vio-service-card__excerpt {
	margin: 4px 0 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.75);
	font-family: inherit;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.vio-service-card:hover .vio-service-card__excerpt {
	opacity: 1;
	transform: translateY(0);
}

/* ── Mobile: کارت‌ها روی موبایل کوتاه‌تر باشن ───────────── */
@media (max-width: 767px) {
	.vio-service-card {
		/* روی موبایل نسبت لندسکیپ بهتره تا کارت خیلی بلند نشه */
		aspect-ratio: 4 / 3;
	}

	.vio-service-card__title {
		font-size: 16px;
	}

	.vio-service-card__content {
		padding: 16px 14px 14px;
	}
}

/* ── No posts message ────────────────────────────────────── */
.vio-no-posts {
	direction: rtl;
	text-align: center;
	padding: 40px;
	color: #888;
	font-size: 14px;
}
