/* ASD Stories – ultralight frontend */

.asd-carousel {
	width: 100%;
	overflow: hidden;
}

.asd-track {
	--asd-cols: 5;
	--asd-gap: 12px;
	display: flex;
	gap: var(--asd-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.asd-track::-webkit-scrollbar {
	display: none;
}

.asd-item {
	flex: 0 0 calc((100% - (var(--asd-cols) - 1) * var(--asd-gap)) / var(--asd-cols));
	height: 320px;
	position: relative;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	scroll-snap-align: start;
	overflow: hidden;
	border-radius: 12px;
	background: #111;
	appearance: none;
	-webkit-appearance: none;
}

.asd-item img,
.asd-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.asd-placeholder {
	background: linear-gradient(135deg, #222, #444);
}

.asd-item-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 10px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
	pointer-events: none;
	text-align: left;
}

.asd-item-title {
	display: block;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.asd-empty {
	padding: 24px;
	text-align: center;
	color: #666;
	border: 1px dashed #ccc;
	border-radius: 8px;
}

/* ===== Modal ===== */
.asd-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	padding: 16px;
	box-sizing: border-box;
}

.asd-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.asd-modal-inner {
	display: flex;
	max-width: 960px;
	width: 100%;
	max-height: 90vh;
	background: #0d0d0d;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	position: relative;
}

.asd-modal-media {
	flex: 1 1 58%;
	min-width: 0;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.asd-modal-media img,
.asd-modal-media video {
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.asd-modal-media iframe {
	width: 100%;
	aspect-ratio: 9 / 16;
	max-height: 90vh;
	border: 0;
}

.asd-modal-side {
	flex: 0 0 42%;
	padding: 28px 24px;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow-y: auto;
	box-sizing: border-box;
}

.asd-modal-title {
	margin: 0 0 12px;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
}

.asd-modal-desc {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.8);
	white-space: pre-wrap;
}

.asd-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s;
}

.asd-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.asd-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s;
}

.asd-nav:hover {
	background: rgba(255, 255, 255, 0.25);
}

.asd-nav-prev {
	left: 12px;
}

.asd-nav-next {
	right: 12px;
}

.asd-nav[disabled] {
	opacity: 0.3;
	pointer-events: none;
}

/* Mobile: stack media on top */
@media (max-width: 720px) {
	.asd-modal-inner {
		flex-direction: column;
		max-height: 95vh;
	}

	.asd-modal-media {
		flex: 0 0 auto;
		max-height: 55vh;
	}

	.asd-modal-media img,
	.asd-modal-media video {
		max-height: 55vh;
	}

	.asd-modal-media iframe {
		max-height: 55vh;
		aspect-ratio: 16 / 9;
	}

	.asd-modal-side {
		flex: 1 1 auto;
		padding: 20px 18px;
	}

	.asd-nav-prev {
		left: 8px;
	}

	.asd-nav-next {
		right: 8px;
	}
}

body.asd-modal-open {
	overflow: hidden;
}
