/* QU Galerie ACF v1.0.0 */

.qu-gal {
	--qu-gal-ratio: 4 / 3;
	--qu-gal-pad: 75%;
	--qu-gal-radius: 6px;
	--qu-gal-gap: 8px;
	--qu-gal-stage-bg: #111;
	--qu-gal-arrow: 46px;
	--qu-gal-arrow-offset: 12px;
	--qu-gal-arrow-stroke: 1.5;
	--qu-gal-arrow-color: rgba(255, 255, 255, .85);
	--qu-gal-arrow-bg: rgba(0, 0, 0, .18);
	--qu-gal-arrow-bg-hover: rgba(0, 0, 0, .38);
	--qu-gal-arrow-accent: var(--e-global-color-accent, #2563eb);
	--qu-gal-arrow-bg-focus: rgba(37, 99, 235, .35);
	--qu-gal-thumb-w: 150px;
	--qu-gal-thumb-ratio: 4 / 3;
	--qu-gal-thumb-opacity: .55;
	--qu-gal-thumb-active: #fff;

	width: 100%;
	max-width: 100%;
}

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

/* ---------- STAGE ---------- */

.qu-gal__stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--qu-gal-ratio);
	overflow: hidden;
	background: var(--qu-gal-stage-bg);
	border-radius: var(--qu-gal-radius);
	touch-action: pan-y;
}

.qu-gal--natural .qu-gal__stage {
	aspect-ratio: auto;
	transition: aspect-ratio .25s ease;
}

.qu-gal[data-lightbox="1"] .qu-gal__stage {
	cursor: zoom-in;
}

/* drag pe imaginea principală (desktop) */
.qu-gal .qu-gal__stage.is-draggable {
	cursor: grab;
}

.qu-gal .qu-gal__stage.is-grabbing {
	cursor: grabbing;
}

.qu-gal__stage:focus-visible {
	outline: 2px solid var(--qu-gal-thumb-active);
	outline-offset: 2px;
}

@supports not (aspect-ratio: 16 / 9) {
	.qu-gal__stage::before {
		content: "";
		display: block;
		padding-top: var(--qu-gal-pad);
	}
}

.qu-gal__slides {
	position: absolute;
	inset: 0;
}

.qu-gal__slide {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .28s ease, transform .25s ease;
	will-change: opacity;
}

/* în timpul drag-ului urmărim degetul/mouse-ul fără întârziere */
.qu-gal__slides.is-dragging .qu-gal__slide {
	transition: opacity .28s ease;
}

.qu-gal--natural .qu-gal__slide,
.qu-gal--contain .qu-gal__slide {
	object-fit: contain;
}

.qu-gal__slide.is-active {
	opacity: 1;
}

/* slide-ul vecin, dezvăluit în timpul gestului */
.qu-gal__slides.is-dragging .qu-gal__slide.is-peek {
	opacity: 1;
	transition: none;
}

/* ---------- SĂGEȚI ---------- */

.qu-gal__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--qu-gal-arrow);
	height: var(--qu-gal-arrow);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--qu-gal-arrow-bg);
	color: var(--qu-gal-arrow-color);
	cursor: pointer;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.qu-gal__nav:hover {
	background: var(--qu-gal-arrow-bg-hover);
	color: #fff;
}

/* focus: accent albastru semi-transparent */
.qu-gal .qu-gal__nav:focus,
.qu-gal .qu-gal__nav:focus-visible {
	background: var(--qu-gal-arrow-bg-focus) !important;
	color: #fff !important;
	outline: none !important;
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {

	.qu-gal .qu-gal__nav:focus,
	.qu-gal .qu-gal__nav:focus-visible {
		background: color-mix(in srgb, var(--qu-gal-arrow-accent) 35%, transparent) !important;
	}
}

.qu-gal .qu-gal__nav:focus-visible {
	box-shadow: 0 0 0 2px var(--qu-gal-arrow-accent) !important;
}

.qu-gal__nav svg {
	width: 58%;
	height: 58%;
	stroke-width: var(--qu-gal-arrow-stroke);
}

.qu-gal__nav--prev {
	left: var(--qu-gal-arrow-offset);
}

.qu-gal__nav--next {
	right: var(--qu-gal-arrow-offset);
}

/* ---------- THUMBNAILS ---------- */

.qu-gal__thumbs {
	display: flex;
	gap: var(--qu-gal-gap);
	margin-top: var(--qu-gal-gap);
	padding-bottom: 4px;
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	cursor: grab;
}

.qu-gal__thumbs.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	-webkit-user-select: none;
	user-select: none;
}

.qu-gal__thumbs::-webkit-scrollbar {
	height: 4px;
}

.qu-gal__thumbs::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, .25);
	border-radius: 4px;
}

.qu-gal__thumb {
	flex: 0 0 auto;
	width: var(--qu-gal-thumb-w);
	aspect-ratio: var(--qu-gal-thumb-ratio);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: calc(var(--qu-gal-radius) * .66);
	overflow: hidden;
	background: var(--qu-gal-stage-bg);
	opacity: var(--qu-gal-thumb-opacity);
	cursor: pointer;
	transition: opacity .2s ease, box-shadow .2s ease;
}

.qu-gal__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	max-width: none;
	object-fit: cover;
	pointer-events: none;
}

.qu-gal__thumb:hover {
	opacity: .85;
}

.qu-gal__thumb.is-active {
	opacity: 1;
	box-shadow: inset 0 0 0 2px var(--qu-gal-thumb-active), 0 0 0 1px rgba(0, 0, 0, .18);
}

/* ---------- LIGHTBOX ---------- */

.qu-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .94);
	touch-action: pan-y;
	opacity: 0;
	transition: opacity .2s ease;
}

.qu-lb.is-open {
	display: flex;
	opacity: 1;
}

.qu-lb__img {
	display: block;
	max-width: 94vw;
	max-height: 88vh;
	object-fit: contain;
	-webkit-user-select: none;
	user-select: none;
}

.qu-lb__nav,
.qu-lb__close {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .07);
	color: rgba(255, 255, 255, .85);
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.qu-lb__nav:hover,
.qu-lb__nav:focus-visible,
.qu-lb__close:hover,
.qu-lb__close:focus-visible {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.qu-lb__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
}

.qu-lb__nav svg {
	width: 30px;
	height: 30px;
}

.qu-lb__nav--prev {
	left: 20px;
}

.qu-lb__nav--next {
	right: 20px;
}

.qu-lb__close {
	top: 18px;
	right: 20px;
	width: 44px;
	height: 44px;
}

.qu-lb__close svg {
	width: 24px;
	height: 24px;
}

.qu-lb__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, .7);
	font-size: 14px;
	letter-spacing: .5px;
}

.qu-lb__spinner {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 2px solid rgba(255, 255, 255, .2);
	border-top-color: rgba(255, 255, 255, .8);
	border-radius: 50%;
	opacity: 0;
	animation: qu-lb-spin .8s linear infinite;
	pointer-events: none;
}

.qu-lb.is-loading .qu-lb__spinner {
	opacity: 1;
}

@keyframes qu-lb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- MOBIL ---------- */

@media (max-width: 767px) {

	.qu-gal {
		--qu-gal-arrow: 38px;
		--qu-gal-arrow-offset: 8px;
		--qu-gal-thumb-w: 110px;
	}

	.qu-lb__nav {
		width: 42px;
		height: 42px;
	}

	.qu-lb__nav svg {
		width: 24px;
		height: 24px;
	}

	.qu-lb__nav--prev {
		left: 8px;
	}

	.qu-lb__nav--next {
		right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.qu-gal__slide,
	.qu-lb,
	.qu-gal__nav,
	.qu-gal__thumb {
		transition: none;
	}

	.qu-gal__thumbs {
		scroll-behavior: auto;
	}
}

/* ---------- SLIDE VIDEO YOUTUBE ---------- */

.qu-gal__slide--video {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	object-fit: unset;
}

.qu-gal__slide--video.is-active {
	pointer-events: auto;
}

.qu-gal__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	max-width: none;
	object-fit: cover;
	transform: scale(1.02);
}

.qu-gal__play {
	position: relative;
	z-index: 2;
	display: block;
	width: 68px;
	height: 48px;
	pointer-events: none;
	transition: opacity .2s ease;
}

.qu-gal__play svg {
	width: 100%;
	height: 100%;
}

.qu-gal__play-bg {
	fill: #212121;
	fill-opacity: .8;
}

.qu-gal__play-arrow {
	fill: #fff;
}

/* iframe-ul montat acoperă posterul */
.qu-gal__slide--video.is-mounted .qu-gal__poster,
.qu-gal__slide--video.is-mounted .qu-gal__play {
	opacity: 0;
	pointer-events: none;
}

.qu-gal__iframe {
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* thumbnail video */
.qu-gal__thumb--video {
	position: relative;
}

.qu-gal__thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	pointer-events: none;
}

.qu-gal__thumb-play svg {
	width: 60%;
	height: 60%;
	margin-left: 6%;
}
