/**
 * By Bang Dynamic Carousel — frontend-styling.
 *
 * Designet til at matche Elementors standard Media Carousel:
 * 16:10-hovedbillede med afrundede hjørner, tynde sorte chevron-pile uden
 * baggrund, og en række kvadratiske thumbnails. Pilfarven styres via
 * CSS-variablen --bybang-primary, som Elementor-farvekontrollen overskriver.
 */

/* ---------------------------------------------------------------------------
 * Container — helt fladt: ingen baggrund, padding, border eller skygge.
 * ------------------------------------------------------------------------- */
.bybang-carousel {
	--bybang-primary: #1a1a1a;
	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * Hovedbillede — fast 16:10, fuld bredde, fylder hele området.
 * ------------------------------------------------------------------------- */
.bybang-carousel__main {
	position: relative;
	width: 100%;
	margin: 0;
	overflow: hidden;
	background: none;
	border: 0;
	border-radius: 16px;
	box-shadow: none;
}

.bybang-carousel__main .swiper-slide {
	position: relative;
	aspect-ratio: 16 / 10;
	background: none;
}

.bybang-carousel__main .swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 16px;
}

/* URL-link på et slide — fylder hele slidet. */
.bybang-carousel__main .bybang-carousel__link {
	display: block;
	width: 100%;
	height: 100%;
}

/* Video-slide — fylder hele slidet ligesom et billede. */
.bybang-carousel__main .bybang-carousel__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 16px;
	background-color: #000000;
}

/* ---------------------------------------------------------------------------
 * Tekst-overlay (slide_text / WYSIWYG) — semi-transparent bjælke nederst.
 * ------------------------------------------------------------------------- */
.bybang-dynamic-carousel__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 5;
	box-sizing: border-box;
	max-height: 30%;
	overflow: auto;
	padding: 16px;
	color: #ffffff;
	background-color: rgba(0, 0, 0, 0.6);
	font-size: 14px;
	line-height: 1.5;
}

.bybang-dynamic-carousel__caption > :first-child {
	margin-top: 0;
}

.bybang-dynamic-carousel__caption > :last-child {
	margin-bottom: 0;
}

.bybang-dynamic-carousel__caption a {
	color: #ffffff;
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * Navigationspile — tynde sorte chevroner, ingen cirkel/baggrund.
 * Swipers default-pil (::after font-icon) slås fra.
 * ------------------------------------------------------------------------- */
.bybang-carousel__arrow {
	position: absolute;
	top: 50%;
	z-index: 10;
	width: 28px;
	height: 28px;
	margin: -14px 0 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bybang-primary);
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.bybang-carousel__arrow::after,
.bybang-carousel__arrow::before {
	display: none;
	content: none;
}

.bybang-carousel__arrow svg {
	display: block;
	width: 100%;
	height: 100%;
}

.bybang-carousel__arrow.swiper-button-prev {
	left: 20px;
	right: auto;
}

.bybang-carousel__arrow.swiper-button-next {
	right: 20px;
	left: auto;
}

.bybang-carousel__arrow:hover,
.bybang-carousel__arrow:focus-visible {
	opacity: 0.7;
	outline: none;
}

.bybang-carousel__arrow.swiper-button-disabled {
	opacity: 0.25;
	cursor: default;
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * Thumbnails — lige række der fylder hele hovedbilledets bredde.
 * Bredden pr. thumb beregnes af Swiper ud fra slidesPerView (sat dynamisk i
 * carousel.js). Aktiv = fuld opacity, inaktive = 0.7. Mellemrum = 12px.
 * ------------------------------------------------------------------------- */
.bybang-carousel__thumbs {
	width: 100%;
	margin-top: 16px;
	overflow: hidden;
	background: none;
	border: 0;
}

.bybang-carousel__thumbs .swiper-slide {
	box-sizing: border-box;
	height: auto;
	aspect-ratio: 1 / 1;
	cursor: pointer;
	opacity: 0.7;
	border: 0;
	border-radius: 12px;
	overflow: hidden;
	transition: opacity 0.2s ease;
}

.bybang-carousel__thumbs .swiper-slide:hover {
	opacity: 0.85;
}

.bybang-carousel__thumbs .swiper-slide-thumb-active {
	opacity: 1;
}

.bybang-carousel__thumbs .swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

/* Placeholder-thumbnail for video-slides — grå flade med play-ikon. */
.bybang-carousel__thumbs .bybang-carousel__video-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #555555;
	background-color: #e2e2e2;
	border-radius: 12px;
}

.bybang-carousel__thumbs .bybang-carousel__video-thumb svg {
	width: 34%;
	max-width: 34px;
	height: auto;
}

/* ---------------------------------------------------------------------------
 * Ingen pagination — kun thumbs bruges til navigation.
 * ------------------------------------------------------------------------- */
.bybang-carousel .swiper-pagination {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Editor-besked når der ikke er nogen slides.
 * ------------------------------------------------------------------------- */
.bybang-carousel__empty {
	padding: 24px;
	text-align: center;
	color: #777777;
	background-color: #f5f5f5;
	border: 1px dashed #cccccc;
	border-radius: 12px;
	font-size: 14px;
}

/* ---------------------------------------------------------------------------
 * Responsivt — mobil under 768px: mindre pile, 4 thumbs ad gangen (swipe).
 * ------------------------------------------------------------------------- */
@media (max-width: 767px) {
	.bybang-carousel__arrow {
		width: 20px;
		height: 20px;
		margin-top: -10px;
	}

	.bybang-carousel__arrow.swiper-button-prev {
		left: 12px;
	}

	.bybang-carousel__arrow.swiper-button-next {
		right: 12px;
	}
}
