@charset "utf-8";

/**
 * ============================================================
 * CYBER TEAM — Unit Gallery
 *
 * Desktop:
 * - mosaic galerija
 * - jedna velika slika levo
 * - četiri manje slike desno
 *
 * Mobilni:
 * - 4:3 slider
 * - swipe / navigacija preko posebnog JS modula
 * ============================================================
 */

.ct-unit-gallery {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 14px;
	background: #edf0f2;
	isolation: isolate;
}

/**
 * ============================================================
 * DESKTOP MOSAIC
 * ============================================================
 */

.ct-unit-gallery__viewport {
	position: relative;
	width: 100%;
	aspect-ratio: 15 / 4;
	overflow: hidden;
	background: #edf0f2;
}

.ct-unit-gallery__track {
	display: grid;
	grid-template-columns: 3fr 3fr 2fr 2fr;
	grid-template-rows: 1fr 1fr;
	gap: 4px;
	width: 100%;
	height: 100%;
}

.ct-unit-gallery__item {
	position: relative;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	background: #e7eaec;
}

/**
 * Na desktopu prikazujemo najviše pet slika.
 * Ostale slike ostaju u DOM-u zbog mobilnog slidera i lightbox-a.
 */
.ct-unit-gallery__item:nth-child(n + 6) {
	display: none;
}

.ct-unit-gallery__link {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.ct-unit-gallery__image {
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	user-select: none;
	-webkit-user-drag: none;
	transition: transform 0.35s ease;
}

/**
 * Standardni layout za pet ili više slika.
 */
.ct-unit-gallery__item:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}

.ct-unit-gallery__item:nth-child(2) {
	grid-column: 3;
	grid-row: 1;
}

.ct-unit-gallery__item:nth-child(3) {
	grid-column: 4;
	grid-row: 1;
}

.ct-unit-gallery__item:nth-child(4) {
	grid-column: 3;
	grid-row: 2;
}

.ct-unit-gallery__item:nth-child(5) {
	grid-column: 4;
	grid-row: 2;
}

/**
 * Jedna slika.
 */
.ct-unit-gallery--count-1 .ct-unit-gallery__item:nth-child(1) {
	grid-column: 1 / -1;
	grid-row: 1 / -1;
}

/**
 * Dve slike.
 */
.ct-unit-gallery--count-2 .ct-unit-gallery__item:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}

.ct-unit-gallery--count-2 .ct-unit-gallery__item:nth-child(2) {
	grid-column: 3 / 5;
	grid-row: 1 / 3;
}

/**
 * Tri slike.
 */
.ct-unit-gallery--count-3 .ct-unit-gallery__item:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}

.ct-unit-gallery--count-3 .ct-unit-gallery__item:nth-child(2) {
	grid-column: 3 / 5;
	grid-row: 1;
}

.ct-unit-gallery--count-3 .ct-unit-gallery__item:nth-child(3) {
	grid-column: 3 / 5;
	grid-row: 2;
}

/**
 * Četiri slike.
 */
.ct-unit-gallery--count-4 .ct-unit-gallery__item:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}

.ct-unit-gallery--count-4 .ct-unit-gallery__item:nth-child(2) {
	grid-column: 3;
	grid-row: 1;
}

.ct-unit-gallery--count-4 .ct-unit-gallery__item:nth-child(3) {
	grid-column: 4;
	grid-row: 1;
}

.ct-unit-gallery--count-4 .ct-unit-gallery__item:nth-child(4) {
	grid-column: 3 / 5;
	grid-row: 2;
}

/**
 * Blagi zoom samo na uređajima koji imaju hover.
 */
@media (hover: hover) and (pointer: fine) {
	.ct-unit-gallery__link:hover .ct-unit-gallery__image {
		transform: scale(1.025);
	}
}

/**
 * ============================================================
 * BROJ FOTOGRAFIJA
 * ============================================================
 */

.ct-unit-gallery__photo-count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 7;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 34px;
	padding: 7px 11px;
	border-radius: 999px;
	background: rgba(20, 31, 43, 0.86);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	pointer-events: none;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.ct-unit-gallery__photo-count-icon {
	display: block;
	width: 17px;
	height: 17px;
	flex: 0 0 17px;
}

.ct-unit-gallery__photo-count--desktop {
	display: flex;
}

.ct-unit-gallery__photo-count--mobile {
	display: none;
}

/**
 * ============================================================
 * MOBILNE KONTROLE — skrivene na desktopu
 * ============================================================
 */

.ct-unit-gallery__button,
.ct-unit-gallery__dots,
.ct-unit-gallery__counter {
	display: none;
}

/**
 * Tablet korekcija visine mosaic galerije.
 */
@media (min-width: 768px) and (max-width: 1024px) {
	.ct-unit-gallery__viewport {
		aspect-ratio: 3 / 1;
	}
}

/**
 * ============================================================
 * MOBILNI 4:3 SLIDER
 * ============================================================
 */

@media (max-width: 767px) {
	.ct-unit-gallery {
		position: relative;
		display: block;
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 3;
		min-width: 0;
		overflow: hidden;
		border-radius: 12px;
		background: #edf0f2;
	}

	/**
	 * Stabilan 4:3 okvir.
	 * Koristimo padding fallback umesto oslanjanja samo na aspect-ratio.
	 */

	.ct-unit-gallery__viewport {
		position: absolute;
		inset: 0;
		display: block;
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
		padding: 0;
		overflow: hidden;
		background: #edf0f2;
		touch-action: pan-y;
	}

	.ct-unit-gallery__track {
		position: absolute;
		inset: 0;
		display: flex;
		width: 100%;
		height: 100%;
		gap: 0;
		transform: translate3d(0, 0, 0);
		transition: transform 0.36s ease;
		will-change: transform;
	}

	/**
	 * Na mobilnom ponovo prikazujemo sve slike.
	 */
	.ct-unit-gallery__item,
	.ct-unit-gallery__item:nth-child(n + 6) {
		position: relative;
		display: block;
		flex: 0 0 100%;
		width: 100%;
		min-width: 100%;
		height: 100%;
		min-height: 100%;
		overflow: hidden;
		grid-column: auto !important;
		grid-row: auto !important;
	}

	.ct-unit-gallery__link {
		position: relative;
		display: block;
		width: 100%;
		height: 100%;
		overflow: hidden;
	}

	.ct-unit-gallery__image {
		position: absolute;
		inset: 0;
		display: block;
		width: 100% !important;
		max-width: none !important;
		height: 100% !important;
		object-fit: cover;
		object-position: center;
		transform: none;
	}

	/**
	 * Mobilne navigacione strelice.
	 */
	.ct-unit-gallery__button {
		position: absolute;
		top: 50%;
		z-index: 8;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(20, 31, 43, 0.82);
		color: #fff;
		font-size: 16px;
		line-height: 1;
		cursor: pointer;
		transform: translateY(-50%);
		transition: background 0.2s ease;
	}

	.ct-unit-gallery__button--prev {
		left: 10px;
	}

	.ct-unit-gallery__button--next {
		right: 10px;
	}

	.ct-unit-gallery__button:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 2px;
	}

	/**
	 * Mobilni dots.
	 */
	.ct-unit-gallery__dots {
		position: absolute;
		left: 50%;
		bottom: 13px;
		z-index: 8;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		max-width: 52%;
		transform: translateX(-50%);
	}

	.ct-unit-gallery__dot {
		display: block;
		width: 7px;
		height: 7px;
		flex: 0 0 7px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.58);
		opacity: 1;
		cursor: pointer;
		transition:
			background 0.2s ease,
			transform 0.2s ease,
			opacity 0.2s ease;
	}


	/**
 	* Smanjena krajnja tačka označava da postoje
 	* dodatne fotografije van trenutno vidljivog prozora.
 	*/
	.ct-unit-gallery__dot.is-edge {
		opacity: 0.68;
		transform: scale(0.72);
	}

	/**
 	* Aktivna tačka uvek ima prioritet.
 	*/
	.ct-unit-gallery__dot.is-active {
		background: #fff;
		opacity: 1;
		transform: scale(1.2);
	}

	/**
	 * Klasičan 1/7 counter ne prikazujemo,
	 * jer mobilni photo-count badge već pokazuje ukupan broj slika.
	 */
	.ct-unit-gallery__counter {
		display: none;
	}

	/**
	 * Desktop badge se skriva, mobilni se prikazuje.
	 */
	.ct-unit-gallery__photo-count--desktop {
		display: none;
	}

	.ct-unit-gallery__photo-count--mobile {
		display: flex;
		right: 10px;
		bottom: 10px;
		min-height: 32px;
		padding: 6px 10px;
		font-size: 13px;
	}

	.ct-unit-gallery__photo-count-icon {
		width: 16px;
		height: 16px;
		flex-basis: 16px;
	}
}

/**
 * Korisnici koji su isključili animacije.
 */
@media (prefers-reduced-motion: reduce) {

	.ct-unit-gallery__track,
	.ct-unit-gallery__image,
	.ct-unit-gallery__dot {
		transition: none;
	}
}



/**
 * JavaScript prikazuje samo dinamički prozor
 * od najviše pet tačkica.
 */
.ct-unit-gallery__dot[hidden] {
	display: none !important;
}






/**
 * Elementor Shortcode widget koji sadrži
 * galeriju jedinice mora da zadrži punu širinu i visinu.
 */
.elementor-widget-shortcode:has(.ct-unit-gallery),
.elementor-widget-shortcode:has(.ct-unit-gallery)>.elementor-widget-container,
.elementor-widget-shortcode .elementor-shortcode:has(.ct-unit-gallery) {
	display: block;
	width: 100%;
	min-width: 0;
}

/**
 * Fallback i galerijski elementi.
 */
.elementor-shortcode>.ct-unit-gallery {
	display: block;
	width: 100%;
	min-width: 0;
}

.ct-unit-gallery,
.ct-unit-gallery__viewport,
.ct-unit-gallery__track {
	min-width: 0;
}


/* =========================================================
   CT Unit Gallery
   Zaštita slider dots od globalnog Elementor Button stila
   ========================================================= */

.ct-unit-gallery .ct-unit-gallery__dot {
	padding: 0 !important;

	width: 8px;
	height: 8px;
	min-width: 8px;
	min-height: 8px;

	border: 0;
	border-radius: 50% !important;

	line-height: 0;

	box-shadow: none;
}