/**
 * Video showcase — [megastay_video_showcase]
 * YouTube-style horizontal card shelf.
 */

.mg-video-showcase {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0;
}

/* ---------- Section header ---------- */

.mg-video-section {
	margin-bottom: 40px;
}

.mg-video-section-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	padding: 0 4px;
}

.mg-video-section-title {
	font-size: 20px;
	font-weight: 700;
	color: #0f0f0f;
	margin: 0;
	line-height: 1.3;
	letter-spacing: -0.2px;
}

/* ---------- Footer: YouTube에서 모두 보기 button (matches 수강신청 style) ---------- */

.mg-video-showcase-footer {
	text-align: center;
	margin-top: 40px;
}

.mg-video-showcase-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 55px;
	background: #A32424;
	color: #FFFFFF;
	font-size: 19px;
	font-weight: 500;
	border-radius: 30px;
	text-decoration: none !important;
	transition: background 0.2s ease, color 0.2s ease;
	letter-spacing: -0.2px;
	line-height: 1.2;
}

.mg-video-showcase-btn:hover,
.mg-video-showcase-btn:focus,
.mg-video-showcase-btn:active {
	text-decoration: none !important;
}

.mg-video-showcase-btn svg {
	transition: transform 0.2s ease;
}

.mg-video-showcase-btn:hover {
	background: #000000;
	color: #FFFFFF;
}

.mg-video-showcase-btn:hover svg {
	transform: translateX(3px);
}

@media (max-width: 768px) {
	.mg-video-showcase-btn {
		padding: 9px 39px;
		font-size: 16px;
	}
}

/* ---------- Carousel wrapper (holds overlay arrows) ---------- */

.mg-video-carousel-wrap {
	position: relative;
}

.mg-carousel-btn {
	position: absolute;
	top: 33%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #0f0f0f;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	padding: 0;
}

.mg-carousel-prev {
	left: -18px;
}

.mg-carousel-next {
	right: -18px;
}

.mg-carousel-btn:hover {
	background: #000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mg-carousel-btn:active {
	background: #333;
}

/* When JS marks the carousel wrap as at-start / at-end / no-scroll */
.mg-video-carousel-wrap.is-at-start .mg-carousel-prev,
.mg-video-carousel-wrap.is-at-end .mg-carousel-next,
.mg-video-carousel-wrap.is-no-scroll .mg-carousel-btn {
	display: none !important;
}


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

.mg-video-carousel {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	scroll-behavior: smooth;
	padding: 0 4px;
}

.mg-video-carousel::-webkit-scrollbar {
	display: none;
}

.mg-video-track {
	display: flex;
	gap: 10px;
}

.mg-video-slide {
	flex: 0 0 calc((100% - 50px) / 5);
	min-width: 240px;
	scroll-snap-align: start;
}

/* ---------- Video card (YouTube style) ---------- */

.mg-video-card {
	display: block;
	text-decoration: none !important;
	color: inherit;
}

.mg-video-card:hover,
.mg-video-card:focus,
.mg-video-card:active {
	text-decoration: none !important;
}

.mg-video-card-thumb {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	background: #e5e5e5 center/cover no-repeat;
	overflow: hidden;
}

/* Play overlay (subtle, shows on hover) */
.mg-video-card-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 54px;
	height: 54px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.mg-video-card:hover .mg-video-card-play {
	opacity: 1;
}

.mg-video-card-play::before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #fff;
	margin-left: 3px;
}

/* ---------- Card body ---------- */

.mg-video-card-title {
	font-size: 14px;
	font-weight: 500;
	color: #0f0f0f;
	margin: 12px 0 4px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	letter-spacing: -0.2px;
	text-decoration: none !important;
}

.mg-video-card-date {
	font-size: 12px;
	color: #606060;
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none !important;
}

/* Separator between meta items (like YouTube "2주 전 · 조회수 1만회") */
.mg-video-card-date::before {
	content: "";
}


/* ---------- Empty state ---------- */

.mg-video-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 180px;
	padding: 32px 20px;
	background: #fafafa;
	border-radius: 12px;
	color: #606060;
	text-align: center;
}

.mg-video-empty-icon {
	position: relative;
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #e5e5e5;
}

.mg-video-empty-icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
	margin-left: 2px;
}

.mg-video-empty-text {
	font-size: 14px;
	color: #606060;
	margin: 0;
	font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
	.mg-video-slide {
		flex: 0 0 calc((100% - 40px) / 4);
	}
}

@media (max-width: 1024px) {
	.mg-video-slide {
		flex: 0 0 calc((100% - 30px) / 3);
	}
}

@media (max-width: 768px) {
	.mg-video-showcase {
		padding: 16px 16px 24px;
	}
	.mg-video-section {
		margin-bottom: 28px;
	}
	.mg-video-section-title {
		font-size: 17px;
	}
	.mg-video-slide {
		flex: 0 0 calc((100% - 10px) / 1.3);
		min-width: 200px;
	}
	/* Hide arrows on mobile — users scroll with touch */
	.mg-carousel-btn {
		display: none;
	}
	/* Let the carousel extend to screen edges so no gap appears */
	.mg-video-showcase {
		padding-left: 0;
		padding-right: 0;
	}
	.mg-video-section-header,
	.mg-video-showcase-footer {
		padding-left: 16px;
		padding-right: 16px;
	}
	.mg-video-carousel {
		padding-left: 16px;
		padding-right: 16px;
	}
	.mg-video-card-title {
		font-size: 13px;
		margin-top: 10px;
	}
	.mg-video-card-date {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.mg-video-slide {
		flex: 0 0 calc((100% - 10px) / 1.3);
	}
}
