/* Widget "ACF Gallery". Settings arrive as custom properties from the widget's controls. */

.pixa-gallery {
	--pixa-columns: 3;
	--pixa-gap: 10px;
	--pixa-ratio: auto;
	--pixa-fit: cover;
	--pixa-overlay: rgba(0, 0, 0, 0.35);
	--pixa-nav-color: #fff;
	--pixa-nav-bg: rgba(0, 0, 0, 0.6);
	--pixa-nav-color-hover: #fff;
	--pixa-nav-bg-hover: rgba(0, 0, 0, 0.85);
	position: relative;
}

.pixa-gallery__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pixa-gallery__item {
	margin: 0;
	padding: 0;
}

.pixa-gallery__item::before {
	content: none;
}

.pixa-gallery__figure {
	margin: 0;
}

.pixa-gallery__link {
	display: block;
	color: inherit;
}

.pixa-gallery__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.pixa-gallery__media {
	position: relative;
	display: block;
	overflow: hidden;
}

.pixa-gallery .pixa-gallery__img {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Grid and carousel: fixed aspect ratio */
.pixa-gallery--grid .pixa-gallery__img,
.pixa-gallery--carousel .pixa-gallery__img {
	aspect-ratio: var(--pixa-ratio);
	height: auto;
	object-fit: var(--pixa-fit);
}

/* Grid */
.pixa-gallery--grid .pixa-gallery__list {
	display: grid;
	grid-template-columns: repeat(var(--pixa-columns), minmax(0, 1fr));
	gap: var(--pixa-gap);
}

/* Masonry: CSS columns, no script. Images keep their own proportions. */
.pixa-gallery--masonry .pixa-gallery__list {
	column-count: var(--pixa-columns);
	column-gap: var(--pixa-gap);
}

.pixa-gallery--masonry .pixa-gallery__item {
	break-inside: avoid;
	margin-bottom: var(--pixa-gap);
}

/* Carousel */
.pixa-gallery--carousel .pixa-gallery__viewport {
	overflow: hidden;
}

.pixa-gallery--carousel .swiper-slide {
	height: auto;
}

.pixa-gallery__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 12px;
}

.pixa-gallery__arrow,
.pixa-gallery__pause {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: var(--pixa-nav-color);
	background: var(--pixa-nav-bg);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.pixa-gallery__arrow:hover,
.pixa-gallery__arrow:focus-visible,
.pixa-gallery__pause:hover,
.pixa-gallery__pause:focus-visible {
	color: var(--pixa-nav-color-hover);
	background: var(--pixa-nav-bg-hover);
}

.pixa-gallery__arrow:focus-visible,
.pixa-gallery__pause:focus-visible,
.pixa-gallery__dot:focus-visible {
	outline: 3px solid var(--pixa-nav-bg-hover);
	outline-offset: 3px;
}

.pixa-gallery__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

/* Pause icon: two bars; play icon: triangle */
.pixa-gallery__pause-icon {
	display: block;
	width: 12px;
	height: 14px;
	border-left: 4px solid currentColor;
	border-right: 4px solid currentColor;
}

.pixa-gallery.is-paused .pixa-gallery__pause-icon {
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 13px solid currentColor;
	border-right: 0;
}

.pixa-gallery__dots {
	display: flex;
	min-width: 0;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
}

/* 24 x 24 target (WCAG 2.5.8), visible dot 10 px */
.pixa-gallery__dot {
	position: relative;
	display: inline-block;
	width: 24px;
	height: 24px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.pixa-gallery__dot::after {
	content: "";
	position: absolute;
	top: 7px;
	left: 7px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pixa-nav-bg);
	opacity: 0.4;
}

.pixa-gallery__dot.is-active::after {
	opacity: 1;
}

/* Hover effects (Elementor's prefix class on the widget wrapper) */
.pixa-gallery__img {
	transition: transform 0.4s ease, opacity 0.3s ease;
}

.pixa-gallery-hover-zoom .pixa-gallery__link:hover .pixa-gallery__img,
.pixa-gallery-hover-zoom .pixa-gallery__link:focus-visible .pixa-gallery__img {
	transform: scale(1.06);
}

.pixa-gallery-hover-darken .pixa-gallery__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--pixa-overlay);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.pixa-gallery-hover-darken .pixa-gallery__link:hover .pixa-gallery__media::after,
.pixa-gallery-hover-darken .pixa-gallery__link:focus-visible .pixa-gallery__media::after {
	opacity: 1;
}

.pixa-gallery-hover-lift .pixa-gallery__media {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pixa-gallery-hover-lift .pixa-gallery__link:hover .pixa-gallery__media,
.pixa-gallery-hover-lift .pixa-gallery__link:focus-visible .pixa-gallery__media {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
	.pixa-gallery__img,
	.pixa-gallery__media,
	.pixa-gallery__media::after {
		transition: none;
	}

	.pixa-gallery-hover-zoom .pixa-gallery__link:hover .pixa-gallery__img,
	.pixa-gallery-hover-lift .pixa-gallery__link:hover .pixa-gallery__media {
		transform: none;
	}
}

.pixa-gallery__caption {
	margin-top: 6px;
	font-size: 0.9em;
}

.pixa-gallery-empty {
	padding: 20px;
	text-align: center;
	color: #50575e;
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
}
