/**
 * Shorts — homepage carousel (4 per slide) + full-screen viewer.
 */

#halchal-shorts {
	scroll-margin-top: calc(var(--hp-header-strip-min-h, 46px) + 72px);
}

.halchal-shorts-section {
	padding: 0 10px 12px;
}

.halchal-shorts-carousel-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0;
}

.halchal-shorts-carousel-viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.halchal-shorts-carousel-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.halchal-shorts-carousel-track::-webkit-scrollbar {
	display: none;
}

.halchal-shorts-slide {
	flex: 0 0 100%;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	scroll-snap-align: start;
	box-sizing: border-box;
	padding: 2px 0 8px;
}

.halchal-shorts-carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.95);
	color: #333;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	padding: 0;
}

.halchal-shorts-carousel-btn:hover {
	background: var(--color-header-bg, #e67e22);
	color: #fff;
}

.halchal-shorts-carousel-prev {
	left: 4px;
}

.halchal-shorts-carousel-next {
	right: 4px;
}

.halchal-shorts-card {
	display: block;
	text-decoration: none !important;
	color: inherit;
	min-width: 0;
}

.halchal-shorts-card-media {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	max-height: 320px;
	border-radius: 10px;
	overflow: hidden;
	background: #111;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.halchal-shorts-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.halchal-shorts-card-placeholder {
	display: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 42px;
	color: #fff;
	position: absolute;
	inset: 0;
	z-index: 0;
}

.halchal-shorts-card-placeholder.is-visible,
.halchal-shorts-card-img.is-broken + .halchal-shorts-card-placeholder {
	display: flex;
}

.halchal-shorts-card-img.is-broken {
	display: none;
}

.halchal-shorts-card--youtube .halchal-shorts-card-placeholder {
	background: linear-gradient(160deg, #cc0000, #8b0000);
}

.halchal-shorts-card--facebook .halchal-shorts-card-placeholder {
	background: linear-gradient(160deg, #1877f2, #0d47a1);
}

.halchal-shorts-card--tiktok .halchal-shorts-card-placeholder {
	background: linear-gradient(160deg, #111, #fe2c55);
}

.halchal-shorts-card-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	pointer-events: none;
	opacity: 0.85;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.halchal-shorts-card:hover .halchal-shorts-card-play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.05);
}

.halchal-shorts-card-caption {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	z-index: 2;
	margin: 0;
	padding: 8px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	color: #fff !important;
	background: rgba(0, 0, 0, 0.62);
	border-radius: 8px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

.halchal-shorts-card:hover .halchal-shorts-card-media {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

@media (max-width: 991px) {
	.halchal-shorts-slide {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.halchal-shorts-card-media {
		max-height: 280px;
	}
}

@media (max-width: 575px) {
	.halchal-shorts-carousel-prev {
		left: 2px;
	}

	.halchal-shorts-carousel-next {
		right: 2px;
	}

	.halchal-shorts-carousel-btn {
		width: 32px;
		height: 32px;
		font-size: 12px;
	}

	.halchal-shorts-card-caption {
		font-size: 11px;
		padding: 6px 8px;
		-webkit-line-clamp: 2;
	}
}

/* —— Full-screen viewer —— */
.halchal-shorts-viewer-page {
	margin: 0;
	min-height: 100vh;
	background: #2b2b2b;
	overflow: hidden;
}

.halchal-shorts-viewer-close {
	position: fixed;
	top: 12px;
	left: 14px;
	z-index: 10002;
	width: 44px;
	height: 44px;
	line-height: 40px;
	text-align: center;
	font-size: 32px;
	color: #fff;
	text-decoration: none !important;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
}

.halchal-shorts-viewer {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 56px 24px 16px;
	box-sizing: border-box;
}

.halchal-shorts-viewer-stage {
	flex: 0 1 auto;
	max-width: 100%;
	text-align: center;
}

.halchal-shorts-viewer-frame {
	width: min(100vw - 80px, 400px);
	height: min(100vh - 120px, 720px);
	margin: 0 auto;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.halchal-shorts-viewer-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.halchal-shorts-viewer-frame.is-tiktok iframe {
	min-height: 100%;
}

.halchal-shorts-viewer-frame.is-facebook iframe {
	background: #000;
}

.halchal-shorts-viewer-title {
	margin: 14px auto 0;
	max-width: 400px;
	color: #f0f0f0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.halchal-shorts-viewer-nav {
	position: fixed;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 10001;
}

.halchal-shorts-nav-btn {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
}

.halchal-shorts-nav-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.25);
}

.halchal-shorts-nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.halchal-shorts-viewer-hint {
	position: fixed;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	color: rgba(255, 255, 255, 0.55);
	font-size: 13px;
}

@media (max-width: 767px) {
	.halchal-shorts-viewer {
		padding: 40px 12px 20px;
	}
	.halchal-shorts-viewer-nav {
		right: 8px;
	}
	.halchal-shorts-viewer-frame {
		width: min(100vw - 24px, 400px);
		height: min(100vh - 100px, 680px);
	}
}
