/**
 * Home featured courses — CSS grid desktop (980px+), looping Swiper carousel below.
 */

.elementor-widget-cb_home_featured_courses .elementor-widget-container {
	overflow: visible;
}

.cb-home-featured {
	overflow: visible;
	background:
		radial-gradient(ellipse 70% 60% at 50% 0%, rgba(243, 184, 155, 0.22), transparent 65%),
		radial-gradient(ellipse at 90% 100%, rgba(184, 92, 122, 0.06), transparent 60%),
		linear-gradient(
			180deg,
			var(--color-bg) 0%,
			color-mix(in srgb, var(--color-bg) 70%, var(--color-beige) 30%) 35%,
			color-mix(in srgb, var(--color-bg) 70%, var(--color-beige) 30%) 65%,
			var(--color-bg) 100%
		);
}

.cb-home-featured__header {
	margin-bottom: 0;
}

.cb-home-featured__bleed {
	--cb-featured-nav-inset: 3.25rem;
	--cb-featured-shadow-pad: var(--space-10);

	position: relative;
	width: 100%;
	overflow: visible;
	margin-top: var(--space-16);
	isolation: isolate;
}

.cb-home-featured__inner {
	position: relative;
}

.cb-home-featured__fade {
	position: absolute;
	top: 0;
	bottom: 0;
	width: clamp(16px, 4vw, 72px);
	z-index: 4;
	pointer-events: none;
}

.cb-home-featured__fade--start {
	inset-inline-start: 0;
	background: linear-gradient(
		to inline-end,
		var(--color-bg) 0%,
		transparent 100%
	);
}

.cb-home-featured__fade--end {
	inset-inline-end: 0;
	background: linear-gradient(
		to inline-start,
		var(--color-bg) 0%,
		transparent 100%
	);
}

.cb-home-featured__carousel {
	position: relative;
	width: 100%;
	overflow: visible;
}

.cb-home-featured__track {
	position: relative;
	width: 100%;
	padding-inline: var(--cb-featured-nav-inset);
	box-sizing: border-box;
}

/* Room for plate / card shadows — never cancel with negative margins */
.cb-home-featured__swiper-viewport {
	overflow: visible;
	padding: 0.5rem;
	box-sizing: border-box;
}

.cb-home-featured__swiper {
	overflow: visible !important;
	width: 100%;
}

.cb-home-featured__swiper .swiper-wrapper {
	align-items: stretch;
}

.cb-home-featured__swiper .swiper-slide {
	height: auto;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	box-sizing: border-box;
}

.cb-home-featured__nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	margin-top: 0;
	transform: translateY(-50%);
	-webkit-tap-highlight-color: transparent;
	tap-highlight-color: transparent;
	user-select: none;
}

.cb-home-featured__nav--prev {
	inset-inline-start: var(--cb-featured-nav-edge, var(--space-5));
}

.cb-home-featured__nav--next {
	inset-inline-end: var(--cb-featured-nav-edge, var(--space-5));
}

.cb-home-featured__nav:hover,
.cb-home-featured__nav:focus-visible {
	transform: translateY(calc(-50% - 2px));
}

.cb-home-featured__nav:focus {
	outline: none;
}

.cb-home-featured__nav:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

.cb-home-featured__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: var(--space-8);
	width: 100%;
}

/* Desktop: static 4-column grid (no carousel transforms / clones) */
@media (min-width: 980px) {
	.cb-home-featured__bleed {
		--cb-featured-nav-inset: 0;
	}

	.cb-home-featured__fade,
	.cb-home-featured__nav,
	.cb-home-featured__pagination {
		display: none !important;
	}

	.cb-home-featured__track {
		padding-inline: 0;
	}

	.cb-home-featured__swiper-viewport {
		padding: 0;
	}

	.cb-home-featured__swiper {
		overflow: visible !important;
	}

	.cb-home-featured__swiper .swiper-wrapper {
		display: grid !important;
		grid-template-columns: repeat(var(--cb-featured-cols, 4), minmax(0, 1fr));
		gap: var(--space-8);
		width: 100% !important;
		transform: none !important;
		box-sizing: border-box;
		justify-items: center;
	}

	.cb-home-featured__swiper .swiper-slide,
	.cb-home-featured__swiper .cb-swiper-loop-clone {
		width: 100% !important;
		max-width: 280px;
		height: auto !important;
		margin: 0 !important;
		flex-shrink: initial;
		z-index: auto;
	}

	.cb-home-featured__swiper .cb-swiper-loop-clone {
		display: none !important;
	}

	.cb-home-featured__swiper .swiper-slide .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide .cb-blog-card {
		width: 100%;
		max-width: 280px;
		transform: none;
		opacity: 1;
		filter: none;
	}

	.cb-home-featured__swiper .swiper-slide .cb-dish-card__plate {
		filter: none;
	}

	.cb-home-featured__swiper .swiper-slide .cb-dish-card__title,
	.cb-home-featured__swiper .swiper-slide .cb-blog-card__title {
		font-weight: inherit;
	}
}

@media (max-width: 979px) {
	.cb-home-featured__bleed {
		--cb-featured-nav-inset: 3.5rem;
		--cb-featured-nav-edge: max(15px, var(--space-6));
	}

	.cb-home-featured__fade {
		display: block;
	}

	.cb-home-featured__inner {
		max-width: none;
		width: 100%;
		padding-inline: 0;
	}

	/* Circular stack: center card large, prev/next smaller on the sides */
	.cb-home-featured__swiper .swiper-slide {
		width: clamp(200px, 68%, 260px);
		flex-shrink: 0;
		z-index: 1;
	}

	.cb-home-featured__swiper .swiper-slide-prev,
	.cb-home-featured__swiper .swiper-slide-next,
	.cb-home-featured__swiper .swiper-slide-duplicate-prev,
	.cb-home-featured__swiper .swiper-slide-duplicate-next {
		z-index: 2;
	}

	.cb-home-featured__swiper .swiper-slide-active,
	.cb-home-featured__swiper .swiper-slide-duplicate-active {
		z-index: 3;
	}

	.cb-home-featured__swiper .swiper-slide .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide .cb-blog-card {
		width: 100%;
		max-width: 280px;
		margin-inline: auto;
		transition:
			transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
			opacity 0.45s ease,
			filter 0.45s ease,
			box-shadow 0.45s ease;
		transform: scale(0.72);
		opacity: 0.42;
	}

	.cb-home-featured__swiper .swiper-slide-prev .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-next .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-prev .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-next .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-prev .cb-blog-card,
	.cb-home-featured__swiper .swiper-slide-next .cb-blog-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-prev .cb-blog-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-next .cb-blog-card {
		transform: scale(0.84);
		opacity: 0.72;
	}

	.cb-home-featured__swiper .swiper-slide-active .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-dish-card,
	.cb-home-featured__swiper .swiper-slide-active .cb-blog-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-blog-card {
		transform: scale(1);
		opacity: 1;
	}

	.cb-home-featured__swiper .swiper-slide-active .cb-dish-card__plate,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-dish-card__plate {
		filter: drop-shadow(0 34px 52px rgba(110, 50, 70, 0.42));
	}

	.cb-home-featured__swiper .swiper-slide-active .cb-blog-card,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-blog-card {
		box-shadow: var(--shadow-lg);
	}

	/* Blog cards use translateY on hover — keep carousel scale states */
	.cb-home-featured__swiper .swiper-slide .cb-blog-card:hover {
		box-shadow: var(--shadow-lg);
	}

	.cb-home-featured__swiper .swiper-slide:not(.swiper-slide-active):not(.swiper-slide-duplicate-active):not(.swiper-slide-prev):not(.swiper-slide-next):not(.swiper-slide-duplicate-prev):not(.swiper-slide-duplicate-next) .cb-blog-card:hover {
		transform: scale(0.72);
		opacity: 0.42;
	}

	.cb-home-featured__swiper .swiper-slide-prev .cb-blog-card:hover,
	.cb-home-featured__swiper .swiper-slide-next .cb-blog-card:hover,
	.cb-home-featured__swiper .swiper-slide-duplicate-prev .cb-blog-card:hover,
	.cb-home-featured__swiper .swiper-slide-duplicate-next .cb-blog-card:hover {
		transform: scale(0.84);
		opacity: 0.72;
	}

	.cb-home-featured__swiper .swiper-slide-active .cb-blog-card:hover,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-blog-card:hover {
		transform: scale(1);
		opacity: 1;
	}

	.cb-home-featured__swiper .swiper-slide-active .cb-dish-card__title,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-dish-card__title,
	.cb-home-featured__swiper .swiper-slide-active .cb-blog-card__title,
	.cb-home-featured__swiper .swiper-slide-duplicate-active .cb-blog-card__title {
		font-weight: 800;
	}

	.cb-home-featured__swiper .cb-dish-card,
	.cb-home-featured__swiper .cb-blog-card {
		max-width: 100%;
	}

	.cb-home-featured__pagination .cb-swiper__bullet {
		-webkit-tap-highlight-color: transparent;
		tap-highlight-color: transparent;
	}
}

@media (max-width: 767px) {
	.cb-home-featured__bleed {
		--cb-featured-nav-inset: 3.25rem;
		--cb-featured-nav-edge: max(15px, var(--space-5));
		--cb-featured-shadow-pad: var(--space-8);
	}

	.cb-home-featured__fade {
		width: clamp(12px, 6vw, 40px);
	}
}

@media (max-width: 479px) {
	.cb-home-featured__bleed {
		--cb-featured-nav-inset: 3rem;
		--cb-featured-nav-edge: 15px;
	}

	.cb-home-featured__nav {
		width: 40px;
		height: 40px;
	}
}
