/**
 * Ultra Banners - front end.
 *
 * Everything sizes off two custom properties so the Elementor controls and the
 * shortcode attributes can drive the same rules.
 */

.ubn {
	--ubn-gap: 20px;
	--ubn-radius: 16px;
	--ubn-columns: 1;

	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.ubn *,
.ubn *::before,
.ubn *::after {
	box-sizing: border-box;
}

.ubn__track {
	display: grid;
	gap: var(--ubn-gap);
}

.ubn__item {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--ubn-radius);
	line-height: 0;
	text-decoration: none;
	transition: opacity .25s ease, box-shadow .25s ease, transform .25s ease;
}

a.ubn__item:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.ubn__picture {
	display: block;
	width: 100%;
}

.ubn__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: inherit;
	transition: transform .35s ease;
}

.ubn-empty {
	padding: 14px;
	color: inherit;
	opacity: .7;
	text-align: center;
}

/* ------------------------------------------------------------- Layouts --- */

.ubn--grid .ubn__track {
	grid-template-columns: repeat(var(--ubn-columns), minmax(0, 1fr));
}

/* ------------------------------------------------------------ Carousel --- */

.ubn--carousel {
	overflow: hidden;
}

.ubn--carousel .ubn__track {
	display: flex;
	gap: 0;
	transition: transform .5s cubic-bezier(.4, 0, .2, 1);
	will-change: transform;
}

.ubn--carousel .ubn__item {
	flex: 0 0 100%;
	min-width: 100%;
}

.ubn__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: rgba(255, 255, 255, .9);
	color: #1a1a1a;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.ubn__nav:hover {
	background-color: #fff;
	transform: scale(1.06);
}

.ubn__nav--prev {
	inset-inline-start: 12px;
}

.ubn__nav--next {
	inset-inline-end: 12px;
}

/* The arrows are drawn for LTR; mirror them in an RTL context. */
[dir="rtl"] .ubn__nav svg {
	transform: scaleX(-1);
}

.ubn__dots {
	position: absolute;
	inset-inline: 0;
	bottom: 12px;
	z-index: 2;
	display: flex;
	gap: 8px;
	justify-content: center;
}

.ubn__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: rgba(255, 255, 255, .55);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.ubn__dot.is-active {
	background-color: #fff;
	transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
	.ubn--carousel .ubn__track,
	.ubn__image,
	.ubn__item {
		transition: none;
	}
}

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

@media (max-width: 1024px) {
	.ubn--grid .ubn__track {
		grid-template-columns: repeat(min(var(--ubn-columns), 2), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ubn--grid .ubn__track {
		grid-template-columns: 1fr;
	}

	.ubn__nav {
		width: 34px;
		height: 34px;
		margin-top: -17px;
	}
}

/* ------------------------------------------------- Dots below the image --- */

/*
 * ברירת המחדל מניחה את הנקודות על גבי התמונה. במצב הזה הן יורדות מתחתיה,
 * ולכן הן צריכות להפסיק להיות ממוקמות אבסולוטית ולקבל מרווח משלהן.
 */
.ubn--dots-below .ubn__dots {
	position: static;
	margin-top: 12px;
}

/* ------------------------------------------------------------- Full bleed --- */

/*
 * שובר את הבאנר מהמכולה של אלמנטור ומצמיד אותו לשולי החלון, בלי לגלוש
 * אופקית: הרוחב נמדד לפי גוף המסמך ולא לפי חלון הגלילה.
 */
.ubn--bleed {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
	border-radius: 0;
}

.ubn--bleed .ubn__item,
.ubn--bleed .ubn__image {
	border-radius: 0;
}

@supports (width: 100dvw) {
	.ubn--bleed {
		width: 100dvw;
		max-width: 100dvw;
	}
}
