/* ==========================================================================
   MAWA Featured Courses
   Card design deliberately mirrors the "Explore Our Training Courses"
   section: white card at rest, deep teal (#0D4A4C) on hover with white
   text, #ABDDDE accent, a 6px lift and a feathered edge wash.
   ========================================================================== */

.mfc {
	--mfc-teal-deep: #0D4A4C;
	--mfc-teal-mid: #3AADAF;
	--mfc-teal-soft: #ABDDDE;
	--mfc-muted: #3A7070;
	--mfc-ease: cubic-bezier(.22, 1, .36, 1);

	position: relative;
	width: 100%;
}

.mfc__heading {
	margin: 0 0 18px;
	color: #FFFFFF;
	font-weight: 700;
}

/* ---------- track ---------- */

.mfc__viewport {
	position: relative;
	/* Vertical padding leaves room for the hover lift and shadow so
	   neither gets clipped by the scroll container. */
	padding-block: 10px 18px;
}

.mfc__track {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	/* NO scroll-snap and NO CSS scroll-behavior here, deliberately.
	   `scroll-snap-type: x mandatory` overrides programmatic scrolling: with
	   it set, assigning scrollLeft = 0 or 300 both landed on 1688, which
	   froze the autoplay. Scroll behaviour is passed per call from JS
	   instead, so the seamless jump-back can be instant while normal
	   advances stay smooth. Native touch swiping still works. */
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 4px;
	margin: -4px;
}

.mfc__track::-webkit-scrollbar {
	display: none;
}

/* ---------- card ---------- */

.mfc__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 0 0 clamp(205px, 23%, 265px);
	box-sizing: border-box;

	padding: 22px 20px 20px;
	border: 1px solid #FFFFFF;
	border-radius: 14px;
	background-color: #FFFFFF;
	box-shadow: 0 6px 18px rgba(13, 74, 76, .12);
	text-decoration: none;
	overflow: hidden;

	transition:
		transform .45s var(--mfc-ease),
		box-shadow .45s var(--mfc-ease),
		background-color .45s ease,
		border-color .45s ease;
}

/* Feathered edge wash. Fades in on hover and sits under the text. */
.mfc__card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0;
	transition: opacity .45s ease;
	background: radial-gradient(115% 95% at 50% 0%,
		rgba(255, 255, 255, .16) 0%,
		rgba(255, 255, 255, 0) 52%,
		rgba(0, 0, 0, .20) 100%);
}

.mfc__card > * {
	position: relative;
	z-index: 1;
}

/* ---------- card contents ---------- */

.mfc__cat {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--mfc-teal-mid);
	transition: color .45s ease;
}

.mfc__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
	font-weight: 600;
	color: var(--mfc-teal-deep);
	transition: color .45s ease;
}

.mfc__meta {
	margin: auto 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 300;
	color: var(--mfc-muted);
}

.mfc__meta li {
	transition: color .45s ease;
}

.mfc__date {
	font-weight: 600;
}

.mfc__fee {
	align-self: flex-start;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--mfc-teal-deep);
	transition: color .45s ease;
}

/* ---------- hover / keyboard focus ---------- */

.mfc__card:hover,
.mfc__card:focus-visible,
.mfc__card:focus-within {
	transform: translateY(-6px);
	background-color: var(--mfc-teal-deep);
	border-color: var(--mfc-teal-deep);
	box-shadow: 0 18px 44px rgba(13, 74, 76, .30);
	outline: none;
}

.mfc__card:hover::after,
.mfc__card:focus-visible::after,
.mfc__card:focus-within::after {
	opacity: 1;
}

.mfc__card:hover .mfc__title,
.mfc__card:focus-visible .mfc__title,
.mfc__card:focus-within .mfc__title,
.mfc__card:hover .mfc__meta li,
.mfc__card:focus-visible .mfc__meta li,
.mfc__card:focus-within .mfc__meta li,
.mfc__card:hover .mfc__fee,
.mfc__card:focus-visible .mfc__fee,
.mfc__card:focus-within .mfc__fee {
	color: #FFFFFF;
}

/* The date and category take the soft accent, as "Training" does in the
   Explore section.
   NOTE: the date selector must include `.mfc__meta li` because the white
   rule above is `.mfc__card:hover .mfc__meta li` (0,3,1) -- a bare
   `.mfc__date` (0,3,0) would lose to it and the date would render white. */
.mfc__card:hover .mfc__meta li.mfc__date,
.mfc__card:focus-visible .mfc__meta li.mfc__date,
.mfc__card:focus-within .mfc__meta li.mfc__date,
.mfc__card:hover .mfc__cat,
.mfc__card:focus-visible .mfc__cat,
.mfc__card:focus-within .mfc__cat {
	color: var(--mfc-teal-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
	.mfc__card {
		flex: 0 0 42%;
	}
}

@media (max-width: 640px) {
	.mfc__card {
		flex: 0 0 72%;
	}
}

/* ---------- accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
	/* Autoplay is skipped entirely in JS when this preference is set, so
	   there is nothing to neutralise on the track itself. */
	.mfc__card,
	.mfc__card::after,
	.mfc__title,
	.mfc__meta li,
	.mfc__fee,
	.mfc__cat {
		transition-duration: .01ms;
	}

	.mfc__card:hover,
	.mfc__card:focus-visible,
	.mfc__card:focus-within {
		transform: none;
	}
}
