/* ============================================================
   MST Link Boxes — باکس لینک
   ============================================================ */

.mstpl {
	--mstpl-maxw-base: 380px;
	--mstpl-maxw: min(100%, var(--mstpl-maxw-base));
	display: grid;
	grid-template-columns: repeat(3, minmax(0, var(--mstpl-maxw)));
	justify-content: center;
	column-gap: 24px;
	row-gap: 28px;
}

.mstpl--few {
	--mstpl-maxw: min(100%, calc(var(--mstpl-maxw-base) * 1.15));
}

.mstpl__item {
	min-width: 0;
	display: flex;
}

/* ---------- کارت ---------- */
.mstpl-card {
	--mstpl-card-bg: #f4f5fa;
	--mstpl-card-radius: 18px;
	--mstpl-img-radius: 12px;
	--mstpl-img-fit: cover;
	--mstpl-lift: -6px;

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: var(--mstpl-card-bg);
	border-radius: var(--mstpl-card-radius);
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.3s ease;
	will-change: transform;
}

.mstpl-card:hover {
	transform: translateY(var(--mstpl-lift));
}

.mstpl-card.is-clickable {
	cursor: pointer;
}

.mstpl-card.is-clickable:focus-visible {
	outline: 2px solid #ebc942;
	outline-offset: 3px;
}

/* خط زرد پایین کارت که با هاور پر می‌شود — سیگنال «برو جلو» */
.mstpl-card::after {
	content: "";
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	height: 3px;
	width: 0;
	background: #ebc942;
	border-radius: 3px;
	transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
	z-index: 2;
}

.mstpl-card:hover::after {
	width: 100%;
}

/* ---------- تصویر ---------- */
.mstpl-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	flex-shrink: 0;
	border-radius: var(--mstpl-img-radius);
	overflow: hidden;
	isolation: isolate;
	background: #e8eaf4;
}

.mstpl-card__img {
	display: block;
	width: 100%;
	height: 100%;
}

.mstpl-card__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var(--mstpl-img-fit);
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- برچسب ---------- */
.mstpl-card__badge {
	position: absolute;
	top: 12px;
	inset-inline-start: 12px;
	z-index: 3;
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	line-height: 1.6;
	letter-spacing: 0.2px;
	box-shadow: 0 4px 12px rgba(41, 49, 124, 0.20);
}

.mstpl-card__badge--inline {
	position: static;
	align-self: flex-start;
	margin: 4px 4px 0;
}

/* ---------- بدنه ---------- */
.mstpl-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 14px 8px 6px;
}

.mstpl-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mstpl-card__chip {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.25s ease;
}

.mstpl-card__chip i,
.mstpl-card__chip svg {
	fill: currentColor;
}

.mstpl-card__title {
	margin: 0;
	line-height: 1.7;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mstpl-card__desc {
	margin: 10px 0 14px;
	line-height: 1.9;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- دکمه ---------- */
.mstpl-card__btn {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.mstpl-card__btn i,
.mstpl-card__btn svg {
	display: inline-block;
	font-size: 15px;
	width: 15px;
	height: 15px;
	fill: currentColor;
	transition: transform 0.25s ease;
}

.mstpl-card:hover .mstpl-card__btn i,
.mstpl-card:hover .mstpl-card__btn svg {
	transform: translateX(-4px);
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
	.mstpl-card,
	.mstpl-card__img img,
	.mstpl-card__chip,
	.mstpl-card__btn,
	.mstpl-card__btn i,
	.mstpl-card__btn svg,
	.mstpl-card::after {
		transition: none !important;
	}

	.mstpl-card:hover {
		transform: none;
	}

	.mstpl-card:hover .mstpl-card__img img {
		transform: none !important;
	}
}

/* ============================================================
   بریدگی‌های گوشه — بالا-راست (آیکون) و پایین-چپ (برچسب)
   ============================================================ */
.mstpl-card {
	--mstpl-notch-r: 18px;
	--mstpl-notch-pad: 7px;
}

.mstpl-card__notch {
	position: absolute;
	z-index: 2;
	background: var(--mstpl-card-bg);
}

.mstpl-card__nc {
	position: absolute;
	width: var(--mstpl-notch-r);
	height: var(--mstpl-notch-r);
	pointer-events: none;
}

/* بریدگی بالا-راست */
.mstpl-card__notch--tr {
	top: 0;
	right: 0;
	border-bottom-left-radius: var(--mstpl-notch-r);
	padding: 0 0 var(--mstpl-notch-pad) var(--mstpl-notch-pad);
}

.mstpl-card__notch--tr .mstpl-card__nc {
	background: radial-gradient(
		circle at 0 100%,
		transparent var(--mstpl-notch-r),
		var(--mstpl-card-bg) calc(var(--mstpl-notch-r) + 0.5px)
	);
}

.mstpl-card__notch--tr .mstpl-card__nc--v {
	top: 100%;
	right: 0;
}

.mstpl-card__notch--tr .mstpl-card__nc--h {
	top: 0;
	right: 100%;
}

/* بریدگی پایین-چپ */
.mstpl-card__notch--bl {
	bottom: 0;
	left: 0;
	border-top-right-radius: var(--mstpl-notch-r);
	padding: var(--mstpl-notch-pad) var(--mstpl-notch-pad) 0 0;
}

.mstpl-card__notch--bl .mstpl-card__nc {
	background: radial-gradient(
		circle at 100% 0,
		transparent var(--mstpl-notch-r),
		var(--mstpl-card-bg) calc(var(--mstpl-notch-r) + 0.5px)
	);
}

.mstpl-card__notch--bl .mstpl-card__nc--v {
	bottom: 100%;
	left: 0;
}

.mstpl-card__notch--bl .mstpl-card__nc--h {
	bottom: 0;
	left: 100%;
}

/* برچسب داخل بریدگی: دیگر شناور نیست */
.mstpl-card__notch--bl .mstpl-card__badge {
	position: static;
	display: inline-block;
	box-shadow: none;
}

/* ============================================================
   طرح‌های رنگی آماده — برای جلب توجه و تمایز از بقیه المان‌ها
   ============================================================ */

/* ---------- کانون توجه: سرمه‌ای پررنگ + زرد ---------- */
.mstpl-scheme-spotlight .mstpl-card {
	--mstpl-card-bg: #29317c !important;
	background: linear-gradient(165deg, #333c93 0%, #29317c 55%, #1e2461 100%) !important;
	border-color: rgba(235, 201, 66, 0.35) !important;
	box-shadow: 0 14px 34px -12px rgba(41, 49, 124, 0.45) !important;
}

.mstpl-scheme-spotlight .mstpl-card:hover {
	border-color: #ebc942 !important;
	box-shadow: 0 22px 48px -14px rgba(41, 49, 124, 0.6) !important;
}

.mstpl-scheme-spotlight .mstpl-card__title {
	color: #ffffff !important;
}

.mstpl-scheme-spotlight .mstpl-card__desc {
	color: rgba(255, 255, 255, 0.78) !important;
}

.mstpl-scheme-spotlight .mstpl-card__chip {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

.mstpl-scheme-spotlight .mstpl-card__badge {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

.mstpl-scheme-spotlight .mstpl-card__btn {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

.mstpl-scheme-spotlight .mstpl-card:hover .mstpl-card__btn {
	background-color: #ffffff !important;
	color: #29317c !important;
}

/* ---------- زرد برند ---------- */
.mstpl-scheme-gold .mstpl-card {
	--mstpl-card-bg: #fdf6dd !important;
	background: linear-gradient(165deg, #fffaea 0%, #fdf1cf 100%) !important;
	border-color: #ebc942 !important;
	box-shadow: 0 14px 32px -14px rgba(196, 158, 26, 0.4) !important;
}

.mstpl-scheme-gold .mstpl-card:hover {
	border-color: #29317c !important;
}

.mstpl-scheme-gold .mstpl-card__title {
	color: #29317c !important;
}

.mstpl-scheme-gold .mstpl-card__desc {
	color: #5b6084 !important;
}

.mstpl-scheme-gold .mstpl-card__chip,
.mstpl-scheme-gold .mstpl-card__btn {
	background-color: #29317c !important;
	color: #ffffff !important;
}

.mstpl-scheme-gold .mstpl-card__badge {
	background-color: #29317c !important;
	color: #ebc942 !important;
}

.mstpl-scheme-gold .mstpl-card:hover .mstpl-card__btn {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

/* ---------- سفید با لبه سرمه‌ای ---------- */
.mstpl-scheme-edge .mstpl-card {
	--mstpl-card-bg: #ffffff !important;
	background: #ffffff !important;
	border: 2px solid #29317c !important;
	box-shadow: 0 12px 30px -14px rgba(41, 49, 124, 0.35) !important;
}

.mstpl-scheme-edge .mstpl-card::after {
	height: 4px;
}

.mstpl-scheme-edge .mstpl-card:hover {
	box-shadow: 0 20px 44px -14px rgba(41, 49, 124, 0.5) !important;
}

.mstpl-scheme-edge .mstpl-card__title {
	color: #29317c !important;
}

.mstpl-scheme-edge .mstpl-card__desc {
	color: #5b6084 !important;
}

.mstpl-scheme-edge .mstpl-card__chip {
	background-color: #29317c !important;
	color: #ebc942 !important;
}

.mstpl-scheme-edge .mstpl-card__badge {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

.mstpl-scheme-edge .mstpl-card__btn {
	background-color: #29317c !important;
	color: #ffffff !important;
}

.mstpl-scheme-edge .mstpl-card:hover .mstpl-card__btn {
	background-color: #ebc942 !important;
	color: #29317c !important;
}

/* بریدگی‌ها باید هم‌رنگ زمینه‌ی همان طرح بمانند */
.mstpl-scheme-spotlight .mstpl-card__notch,
.mstpl-scheme-gold .mstpl-card__notch,
.mstpl-scheme-edge .mstpl-card__notch {
	background: var(--mstpl-card-bg) !important;
}

/* ============================================================
   موبایل و تبلت — همه‌چیز کوچک و متناسب، تصویر مربعی کامل
   ============================================================ */
@media (max-width: 767px) {
	.mstpl {
		column-gap: 8px;
		row-gap: 14px;
	}

	/* بریدگی نازک‌تر تا تصویر پوشیده نشود */
	.mstpl-card {
		--mstpl-notch-r: 10px;
		--mstpl-notch-pad: 4px;
	}

	.mstpl-card__media {
		border-radius: 10px;
	}

	.mstpl-card__chip {
		width: 34px !important;
		height: 34px !important;
		border-radius: 10px !important;
	}

	.mstpl-card__chip i,
	.mstpl-card__chip svg {
		font-size: 14px !important;
		width: 14px !important;
		height: 14px !important;
	}

	.mstpl-card__badge {
		padding: 3px 8px !important;
		font-size: 10px !important;
		box-shadow: none !important;
	}

	.mstpl-card__body {
		padding: 10px 4px 4px;
	}

	.mstpl-card__title {
		font-size: 14px !important;
		line-height: 1.6;
	}

	.mstpl-card__desc {
		margin: 6px 0 10px;
		font-size: 12px !important;
		line-height: 1.8;
	}

	.mstpl-card__btn {
		gap: 6px;
		padding: 9px 10px !important;
		font-size: 12px !important;
		border-radius: 10px !important;
	}

	.mstpl-card__btn i,
	.mstpl-card__btn svg {
		font-size: 12px !important;
		width: 12px !important;
		height: 12px !important;
	}
}

@media (max-width: 380px) {
	.mstpl-card__chip {
		width: 28px !important;
		height: 28px !important;
		border-radius: 8px !important;
	}

	.mstpl-card__chip i,
	.mstpl-card__chip svg {
		font-size: 12px !important;
		width: 12px !important;
		height: 12px !important;
	}

	.mstpl-card__title {
		font-size: 13px !important;
	}

	.mstpl-card__btn {
		padding: 8px !important;
		font-size: 11px !important;
	}
}

/* ============================================================
   رنگ تاکیدی — آیکون گوشه و برچسب (خارج از پالت اصلی)
   بعد از طرح‌های رنگی می‌آید تا تنظیمات کاربر بر آن‌ها اولویت داشته باشد
   ============================================================ */
.mstpl .mstpl-card {
	--mstpl-chip-bg: #0d9488;
	--mstpl-chip-fg: #ffffff;
	--mstpl-chip-bg-h: #0b7f76;
	--mstpl-chip-fg-h: #ffffff;
	--mstpl-badge-bg: #0d9488;
	--mstpl-badge-fg: #ffffff;
}

.mstpl .mstpl-card__chip {
	background-color: var(--mstpl-chip-bg) !important;
	color: var(--mstpl-chip-fg) !important;
	box-shadow: 0 6px 16px -8px var(--mstpl-chip-bg);
}

.mstpl .mstpl-card:hover .mstpl-card__chip {
	background-color: var(--mstpl-chip-bg-h) !important;
	color: var(--mstpl-chip-fg-h) !important;
	box-shadow: 0 10px 22px -8px var(--mstpl-chip-bg-h);
}

.mstpl .mstpl-card__badge {
	background-color: var(--mstpl-badge-bg) !important;
	color: var(--mstpl-badge-fg) !important;
}
