/* Bright Addons Pro: Filterable Gallery */

/* Elementor Container: fill the width the container gives widgets. */
/* Same fix Elementor uses for its own Video and Accordion widgets: without it the */
/* widget shrinks to its content in Row or centred containers and can collapse to 0px. */
.e-con > .elementor-widget-bapro-filterable-gallery,
.e-con-inner > .elementor-widget-bapro-filterable-gallery {
	width: var(--container-widget-width, 100%);
	--flex-grow: var(--container-widget-flex-grow);
}

.bapro-fg {
	--bapro-fg-cols: 3;
	--bapro-fg-gap: 20px;
	--bapro-fg-ratio: 4 / 3;
	--bapro-fg-accent: #5b3df5;
}

/* ---------- Filters ---------- */
.bapro-fg__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 28px;
}

/* Filter buttons: stronger than theme / Site Settings button styles,
   weaker than the widget's own style controls. */
.bapro-fg .bapro-fg__filters .bapro-fg__filter {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	min-height: 0;
	margin: 0;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: #f0f1f5;
	box-shadow: none;
	color: #3c4150;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bapro-fg .bapro-fg__filters .bapro-fg__filter:not(.is-active):hover {
	color: var(--bapro-fg-accent);
}

.bapro-fg .bapro-fg__filters .bapro-fg__filter.is-active {
	background: var(--bapro-fg-accent);
	color: #fff;
}

.bapro-fg .bapro-fg__filters .bapro-fg__filter:focus:not(:focus-visible) {
	outline: none;
}

.bapro-fg .bapro-fg__filters .bapro-fg__filter:focus-visible {
	outline: 2px solid var(--bapro-fg-accent);
	outline-offset: 2px;
}

/* Buttons style */
.bapro-fg--filters-buttons .bapro-fg__filters .bapro-fg__filter {
	border-color: #e3e5ea;
	border-radius: 8px;
	background: #fff;
}

.bapro-fg--filters-buttons .bapro-fg__filters .bapro-fg__filter.is-active {
	border-color: var(--bapro-fg-accent);
}

/* Underline style */
.bapro-fg--filters-underline .bapro-fg__filters .bapro-fg__filter {
	padding: 8px 4px;
	border-width: 0 0 2px;
	border-radius: 0;
	background: transparent;
}

.bapro-fg--filters-underline .bapro-fg__filters .bapro-fg__filter.is-active {
	border-color: var(--bapro-fg-accent);
	background: transparent;
	color: var(--bapro-fg-accent);
}

.bapro-fg--filters-underline .bapro-fg__filters {
	gap: 22px;
}

/* Plain text style */
.bapro-fg--filters-text .bapro-fg__filters .bapro-fg__filter {
	padding: 4px 2px;
	background: transparent;
}

.bapro-fg--filters-text .bapro-fg__filters .bapro-fg__filter.is-active {
	background: transparent;
	color: var(--bapro-fg-accent);
}

.bapro-fg--filters-text .bapro-fg__filters {
	gap: 22px;
}

.bapro-fg__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 20px;
	background: rgba(0, 0, 0, 0.08);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.bapro-fg__filter.is-active .bapro-fg__count {
	background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 767px) {
	.bapro-fg--mobile-scroll .bapro-fg__filters {
		flex-wrap: nowrap;
		justify-content: flex-start !important;
		margin-right: calc(-1 * var(--bapro-fg-edge, 0px));
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 4px;
	}

	.bapro-fg--mobile-scroll .bapro-fg__filters::-webkit-scrollbar {
		display: none;
	}
}

/* ---------- Grid ---------- */
.bapro-fg__grid {
	display: grid;
	grid-template-columns: repeat(var(--bapro-fg-cols), minmax(0, 1fr));
	gap: var(--bapro-fg-gap);
}

.bapro-fg__item {
	min-width: 0;
}

.bapro-fg .bapro-fg__grid .bapro-fg__item.is-hidden,
.bapro-fg .bapro-fg__grid .bapro-fg__item.is-limited {
	display: none;
}

.bapro-fg__item.is-entering {
	animation: bapro-fg-in 0.45s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes bapro-fg-in {
	from {
		opacity: 0;
		scale: 0.94;
	}

	to {
		opacity: 1;
		scale: 1;
	}
}

.bapro-fg--grid .bapro-fg__grid {
	grid-auto-flow: row dense;
}

/* Featured item: 2 columns x 2 rows, the image fills whatever height the rows give it. */
.bapro-fg--grid .bapro-fg__item--wide {
	display: flex;
	grid-column: span 2;
	grid-row: span 2;
}

.bapro-fg--grid .bapro-fg__item--wide .bapro-fg__card {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
}

/* Masonry: JS sets each item's row span once sizes are known. */
.bapro-fg--masonry.is-masonry-ready .bapro-fg__grid {
	grid-auto-rows: 4px;
	row-gap: 0;
	align-items: start;
}

/* ---------- Card ---------- */
.bapro-fg__card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.3s;
}

a.bapro-fg__card:hover,
a.bapro-fg__card:focus {
	color: inherit;
	text-decoration: none;
}

.bapro-fg__card:focus-visible {
	outline: 3px solid var(--bapro-fg-accent);
	outline-offset: 3px;
}

.bapro-fg__media {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
}

.bapro-fg__img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
}

.bapro-fg--grid .bapro-fg__media {
	aspect-ratio: var(--bapro-fg-ratio);
}

.bapro-fg--grid .bapro-fg__img {
	height: 100%;
	object-fit: cover;
}

.bapro-fg--grid .bapro-fg__item--wide .bapro-fg__media {
	flex: 1 1 auto;
	min-height: 200px;
	aspect-ratio: auto;
}

.bapro-fg--grid .bapro-fg__item--wide .bapro-fg__img {
	position: absolute;
	inset: 0;
}

/* Hover effects */
.bapro-fg--fx-zoom .bapro-fg__item:hover .bapro-fg__img {
	transform: scale(1.08);
}

.bapro-fg--fx-grayscale .bapro-fg__img {
	filter: grayscale(1);
}

.bapro-fg--fx-grayscale .bapro-fg__item:hover .bapro-fg__img {
	filter: grayscale(0);
}

.bapro-fg--fx-blur .bapro-fg__item:hover .bapro-fg__img {
	filter: blur(3px);
	transform: scale(1.05);
}

.bapro-fg--fx-lift .bapro-fg__item:hover .bapro-fg__card {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(18, 22, 40, 0.16);
}

/* ---------- Overlay and caption ---------- */
.bapro-fg__overlay {
	position: absolute;
	inset: 0;
	background: rgba(14, 14, 32, 0.55);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.bapro-fg__caption {
	display: flex;
	flex-direction: column;
	gap: 4px;
	line-height: 1.4;
}

.bapro-fg__title {
	margin: 0;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.bapro-fg__desc {
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
}

.bapro-fg__cats {
	color: rgba(255, 255, 255, 0.8);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
}

.bapro-fg__icon {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #1d2330;
	font-size: 14px;
	line-height: 1;
	opacity: 0;
	scale: 0.6;
	transition: opacity 0.35s ease, scale 0.35s ease;
}

.bapro-fg__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.bapro-fg__item:hover .bapro-fg__icon,
.bapro-fg__card:focus-visible .bapro-fg__icon {
	opacity: 1;
	scale: 1;
}

/* Overlay on hover */
.bapro-fg--caption-overlay .bapro-fg__caption {
	position: absolute;
	inset: 0;
	z-index: 1;
	justify-content: center;
	padding: 24px;
	text-align: center;
	opacity: 0;
	translate: 0 12px;
	transition: opacity 0.35s ease, translate 0.35s ease;
}

.bapro-fg--caption-overlay .bapro-fg__item:hover .bapro-fg__overlay,
.bapro-fg--caption-overlay .bapro-fg__card:focus-visible .bapro-fg__overlay,
.bapro-fg--caption-overlay .bapro-fg__item:hover .bapro-fg__caption,
.bapro-fg--caption-overlay .bapro-fg__card:focus-visible .bapro-fg__caption {
	opacity: 1;
	translate: 0 0;
}

/* Slide up on hover */
.bapro-fg--caption-slide .bapro-fg__overlay {
	background: rgba(14, 14, 32, 0.25);
}

.bapro-fg--caption-slide .bapro-fg__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	padding: 20px;
	background: linear-gradient(to top, rgba(14, 14, 32, 0.85), rgba(14, 14, 32, 0));
	translate: 0 100%;
	transition: translate 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.bapro-fg--caption-slide .bapro-fg__item:hover .bapro-fg__overlay,
.bapro-fg--caption-slide .bapro-fg__card:focus-visible .bapro-fg__overlay {
	opacity: 1;
}

.bapro-fg--caption-slide .bapro-fg__item:hover .bapro-fg__caption,
.bapro-fg--caption-slide .bapro-fg__card:focus-visible .bapro-fg__caption {
	translate: 0 0;
}

/* Always on image */
.bapro-fg--caption-always .bapro-fg__overlay {
	background: linear-gradient(to top, rgba(14, 14, 32, 0.75), rgba(14, 14, 32, 0) 60%);
	opacity: 1;
}

.bapro-fg--caption-always .bapro-fg__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	padding: 18px 20px;
}

/* Below image */
.bapro-fg--caption-below .bapro-fg__caption {
	padding: 14px 16px 16px;
	background: #fff;
}

.bapro-fg--caption-below .bapro-fg__title {
	color: #1d2330;
	font-size: 16px;
}

.bapro-fg--caption-below .bapro-fg__desc {
	color: #5a6070;
}

.bapro-fg--caption-below .bapro-fg__cats {
	color: var(--bapro-fg-accent);
}

.bapro-fg--caption-below .bapro-fg__card {
	box-shadow: 0 8px 24px rgba(18, 22, 40, 0.08);
}

.bapro-fg__empty {
	margin: 20px 0 0;
	color: #646b7a;
	text-align: center;
}

/* ---------- Load more ---------- */
.bapro-fg__more {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.bapro-fg__more[hidden] {
	display: none;
}

.bapro-fg .bapro-fg__more .bapro-fg__more-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	margin: 0;
	padding: 12px 26px;
	border: 0;
	border-radius: 40px;
	background: var(--bapro-fg-accent);
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	transition: all 0.3s ease;
}

.bapro-fg .bapro-fg__more .bapro-fg__more-btn svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.bapro-fg .bapro-btn__icon {
	display: inline-flex;
}

@media (max-width: 767px) {
	.bapro-fg--grid .bapro-fg__item--wide {
		grid-column: auto;
		grid-row: auto;
	}

	.bapro-fg--grid .bapro-fg__item--wide .bapro-fg__media {
		min-height: 0;
		aspect-ratio: var(--bapro-fg-ratio);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bapro-fg__item.is-entering {
		animation: none;
	}

	.bapro-fg__img,
	.bapro-fg__caption,
	.bapro-fg__card {
		transition: none;
	}
}

/* Anything the script hides with the hidden attribute stays hidden, even
   when a display value above (or from the theme) would show it. */
.bapro-fg [hidden] {
	display: none !important;
}
