/* ACF Dynamic Slideshow for Elementor */

.acfds {
	--acfds-duration: 600ms;
	--acfds-thumb-size: 80px;
	--acfds-thumb-gap: 8px;
	--acfds-stack-gap: 12px;
	--acfds-thumb-radius: 4px;
	--acfds-thumb-opacity: 0.6;
	--acfds-thumb-active: #2563eb;
	--acfds-arrow-size: 44px;
	--acfds-arrow-offset: 12px;
	--acfds-arrow-radius: 50%;
	--acfds-arrow-color: #fff;
	--acfds-arrow-bg: rgba(0, 0, 0, 0.45);
	--acfds-arrow-color-hover: #fff;
	--acfds-arrow-bg-hover: rgba(0, 0, 0, 0.75);
	--acfds-counter-color: #fff;
	--acfds-counter-bg: rgba(0, 0, 0, 0.55);
	--acfds-lb-bg: rgba(0, 0, 0, 0.92);
	--acfds-lb-color: #fff;
	--acfds-lb-controls-bg: rgba(255, 255, 255, 0.14);

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

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

/* ---------- Palco ---------- */

.acfds__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background-color: #111;
	touch-action: pan-y;
}

.acfds__track {
	position: relative;
	width: 100%;
	height: 100%;
}

.acfds__slide {
	margin: 0;
	padding: 0;
}

.acfds__open {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: zoom-in;
	line-height: 0;
	appearance: none;
	-webkit-appearance: none;
}

.acfds__slide img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	user-select: none;
	-webkit-user-drag: none;
}

/* Fade: slides empilhados */
.acfds--fade .acfds__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	z-index: 0;
	transition: opacity var(--acfds-duration) ease, visibility 0s linear var(--acfds-duration);
}

.acfds--fade .acfds__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	transition: opacity var(--acfds-duration) ease, visibility 0s linear 0s;
}

/* Slide: trilho horizontal */
.acfds--slide .acfds__track {
	display: flex;
	flex-wrap: nowrap;
	transform: translate3d(0, 0, 0);
	transition: transform var(--acfds-duration) ease;
	will-change: transform;
}

.acfds--slide .acfds__slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	min-width: 0;
}

.acfds.is-dragging .acfds__track {
	transition: none;
}

/* ---------- Setas ---------- */

.acfds__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--acfds-arrow-size);
	height: var(--acfds-arrow-size);
	margin: calc(var(--acfds-arrow-size) / -2) 0 0;
	padding: 0;
	border: 0;
	border-radius: var(--acfds-arrow-radius);
	background: var(--acfds-arrow-bg);
	color: var(--acfds-arrow-color);
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.acfds__arrow svg {
	width: 55%;
	height: 55%;
	pointer-events: none;
}

.acfds__arrow:hover,
.acfds__arrow:focus-visible {
	background: var(--acfds-arrow-bg-hover);
	color: var(--acfds-arrow-color-hover);
}

.acfds__arrow--prev {
	left: var(--acfds-arrow-offset);
}

.acfds__arrow--next {
	right: var(--acfds-arrow-offset);
}

/* ---------- Contador ---------- */

.acfds__counter {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--acfds-counter-bg);
	color: var(--acfds-counter-color);
	font-size: 14px;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

/* ---------- Miniaturas ---------- */

.acfds__thumbs {
	position: relative;
	display: flex;
	flex-wrap: nowrap;
	gap: var(--acfds-thumb-gap);
	margin-top: var(--acfds-stack-gap);
	padding: 3px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.acfds__thumb {
	flex: 0 0 auto;
	position: relative;
	width: var(--acfds-thumb-size);
	height: var(--acfds-thumb-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--acfds-thumb-radius);
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	opacity: var(--acfds-thumb-opacity);
	overflow: hidden;
	line-height: 0;
	transition: opacity 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.acfds__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.acfds__thumb:hover,
.acfds__thumb:focus-visible,
.acfds__thumb.is-active {
	opacity: 1;
}

.acfds__thumb.is-active {
	box-shadow: 0 0 0 2px var(--acfds-thumb-active);
}

/* ---------- Foco visível ---------- */

.acfds button:focus-visible,
.acfds-lightbox button:focus-visible {
	outline: 2px solid var(--acfds-thumb-active, #2563eb);
	outline-offset: 2px;
}

.acfds__open:focus-visible {
	outline-offset: -4px;
}

/* ---------- Estado vazio (editor) ---------- */

.acfds-empty {
	padding: 24px;
	border: 2px dashed #b4b9be;
	border-radius: 4px;
	background: #f6f7f7;
	color: #50575e;
	font-size: 14px;
	text-align: center;
}

/* ---------- Lightbox ---------- */

body.acfds-lb-open {
	overflow: hidden;
}

.acfds-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--acfds-lb-bg, rgba(0, 0, 0, 0.92));
	color: var(--acfds-lb-color, #fff);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.acfds-lightbox.is-open {
	opacity: 1;
}

.acfds-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 56px 72px;
	overflow: hidden;
}

.acfds-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	min-height: 0;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform 0.25s ease;
	transform-origin: 50% 50%;
	user-select: none;
	-webkit-user-drag: none;
}

.acfds-lightbox.is-zoomed .acfds-lightbox__img {
	cursor: zoom-out;
	transform: scale(2);
}

.acfds-lightbox.is-zoomed .acfds-lightbox__figure {
	cursor: move;
}

.acfds-lightbox__caption {
	flex: 0 0 auto;
	max-width: 80ch;
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

.acfds-lightbox__caption:empty {
	display: none;
}

.acfds-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--acfds-lb-controls-bg, rgba(255, 255, 255, 0.14));
	color: var(--acfds-lb-color, #fff);
	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 0.2s ease;
}

.acfds-lightbox__btn:hover,
.acfds-lightbox__btn:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.acfds-lightbox__btn svg {
	width: 24px;
	height: 24px;
	pointer-events: none;
}

.acfds-lightbox__close {
	top: 12px;
	right: 12px;
}

.acfds-lightbox__zoom {
	top: 12px;
	right: 64px;
}

.acfds-lightbox__prev {
	left: 12px;
	top: 50%;
	margin-top: -22px;
}

.acfds-lightbox__next {
	right: 12px;
	top: 50%;
	margin-top: -22px;
}

.acfds-lightbox__counter {
	position: absolute;
	top: 22px;
	left: 16px;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1024px) {
	.acfds-lightbox__figure {
		padding: 56px 60px;
	}
}

@media (max-width: 767px) {
	.acfds__counter {
		right: 8px;
		bottom: 8px;
		font-size: 12px;
	}

	.acfds-lightbox__figure {
		padding: 56px 8px 24px;
	}

	.acfds-lightbox__prev {
		left: 6px;
	}

	.acfds-lightbox__next {
		right: 6px;
	}
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
	.acfds--fade .acfds__slide,
	.acfds--fade .acfds__slide.is-active,
	.acfds--slide .acfds__track,
	.acfds--slide .acfds__slide,
	.acfds-lightbox,
	.acfds-lightbox__img {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}

	.acfds__thumbs {
		scroll-behavior: auto;
	}
}
