
.wp-block-mlo-gallery {
	margin-bottom: 2em;
}

.mlo-gallery-block {
	--mlo-columns: 3;
	--mlo-gap: 10px;
	--mlo-radius: 4px;
	--mlo-row-height: 250px;
	box-sizing: border-box;
	position: relative;
	width: 100%;
}

.mlo-gallery-block *, .mlo-gallery-block :after, .mlo-gallery-block :before {
	box-sizing: inherit;
}

.mlo-gallery-block figure {
	margin: 0;
	padding: 0;
}

.mlo-gallery-empty {
	background: #f8f9fa;
	border: 2px dashed #ccc;
	border-radius: var(--mlo-radius);
	color: #666;
	padding: 2em;
	text-align: center;
}

.mlo-gallery-image {
	backface-visibility: hidden;
	border-radius: var(--mlo-radius);
	display: block;
	height: auto;
	transition: transform .3s ease, opacity .3s ease;
	width: 100%;
}

.mlo-gallery-item {
	background: #f0f0f1;
	border-radius: var(--mlo-radius);
	overflow: hidden;
	position: relative;
}

.mlo-gallery-layout-grid .mlo-gallery-grid {
	display: grid;
	gap: var(--mlo-gap);
	grid-template-columns: repeat(var(--mlo-columns), 1fr);
}

.mlo-gallery-layout-grid.mlo-gallery-ratio-square .mlo-gallery-image {
	aspect-ratio: 1/1;
	-o-object-fit: cover;
	object-fit: cover;
}

.mlo-gallery-layout-grid.mlo-gallery-ratio-4-3 .mlo-gallery-image {
	aspect-ratio: 4/3;
	-o-object-fit: cover;
	object-fit: cover;
}

.mlo-gallery-layout-grid.mlo-gallery-ratio-16-9 .mlo-gallery-image {
	aspect-ratio: 16/9;
	-o-object-fit: cover;
	object-fit: cover;
}

.mlo-gallery-layout-grid.mlo-gallery-ratio-3-2 .mlo-gallery-image {
	aspect-ratio: 3/2;
	-o-object-fit: cover;
	object-fit: cover;
}

.mlo-gallery-layout-masonry .mlo-gallery-grid {
	-moz-column-count: var(--mlo-columns);
	column-count: var(--mlo-columns);
	-moz-column-gap: var(--mlo-gap);
	column-gap: var(--mlo-gap);
	opacity: 1;
	transition: opacity .3s ease;
}

.mlo-gallery-layout-masonry .mlo-gallery-item {
	-moz-column-break-inside: avoid;
	break-inside: avoid;
	display: inline-block;
	margin-bottom: var(--mlo-gap);
	width: 100%;
}

.mlo-gallery-layout-justified .mlo-gallery-grid {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: var(--mlo-gap);
}

.mlo-gallery-layout-justified .mlo-gallery-item {
	min-width: 0;
	position: relative;
}

.mlo-gallery-layout-justified .mlo-gallery-image {
	display: block;
}

.mlo-gallery-layout-justified .mlo-gallery-grid:after {
	content: "";
	flex-grow: 999999999;
}

.mlo-gallery-layout-carousel .mlo-carousel-wrapper {
	overflow: hidden;
	padding: 0 40px;
	position: relative;
}

.mlo-gallery-layout-carousel .mlo-carousel-track {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--mlo-gap);
	left: 0;
	position: relative;
	transition: transform .5s cubic-bezier(.25, 1, .5, 1);
	will-change: transform;
}

.mlo-gallery-layout-carousel .mlo-carousel-slide {
	flex: 0 0 auto;
}

.mlo-gallery-layout-carousel .mlo-gallery-image {
	aspect-ratio: 16/9;
	-o-object-fit: cover;
	object-fit: cover;
}

.mlo-carousel-next, .mlo-carousel-prev {
	align-items: center;
	background: rgba(0, 0, 0, .5);
	border: none;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 24px;
	height: 40px;
	justify-content: center;
	line-height: 1;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: background .3s;
	width: 40px;
	z-index: 10;
}

.mlo-carousel-next:hover, .mlo-carousel-prev:hover {
	background: rgba(0, 0, 0, .8);
}

.mlo-carousel-prev {
	left: 0;
}

.mlo-carousel-next {
	right: 0;
}

.mlo-carousel-dots {
	margin-top: 15px;
	text-align: center;
}

.mlo-carousel-dot {
	background: #ccc;
	border-radius: 50%;
	cursor: pointer;
	display: inline-block;
	height: 10px;
	margin: 0 5px;
	transition: background .3s;
	width: 10px;
}

.mlo-carousel-dot.active {
	background: #333;
}

.mlo-gallery-hover-zoom .mlo-gallery-item:hover .mlo-gallery-image {
	transform: scale(1.05);
}

.mlo-overlay {
	align-items: center;
	background: rgba(0, 0, 0, .6);
	border-radius: var(--mlo-radius);
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: center;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	transition: opacity .3s ease;
	width: 100%;
	z-index: 2;
}

.mlo-overlay-icon svg {
	transform: scale(.5);
	transition: transform .3s cubic-bezier(.175, .885, .32, 1.275);
}

.mlo-gallery-hover-overlay .mlo-gallery-item:hover .mlo-overlay {
	opacity: 1;
}

.mlo-gallery-hover-overlay .mlo-gallery-item:hover .mlo-overlay-icon svg {
	transform: scale(1);
}

.mlo-caption-below {
	color: #666;
	font-size: .9em;
	margin-top: 8px;
	text-align: center;
}

.mlo-overlay-caption {
	color: #fff;
	font-size: 1em;
	margin-top: 10px;
	padding: 0 15px;
	text-align: center;
}

.mlo-fade-caption {
	background: linear-gradient(0deg, rgba(0, 0, 0, .8) 0, transparent);
	border-bottom-left-radius: var(--mlo-radius);
	border-bottom-right-radius: var(--mlo-radius);
	bottom: 0;
	color: #fff;
	font-size: .95em;
	left: 0;
	opacity: 0;
	padding: 15px;
	pointer-events: none;
	position: absolute;
	transform: translateY(10px);
	transition: opacity .3s ease;
	width: 100%;
	z-index: 2;
}

.mlo-gallery-hover-fade .mlo-gallery-item:hover .mlo-fade-caption {
	opacity: 1;
	transform: translateY(0);
}

.mlo-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 20px;
}

.mlo-filter-pills .mlo-filter-btn {
	background: #f0f0f1;
	border: none;
	border-radius: 20px;
	color: #333;
	cursor: pointer;
	font-size: .95em;
	padding: 8px 16px;
	transition: background .2s, color .2s;
}

.mlo-filter-pills .mlo-filter-btn:hover {
	background: #e0e0e1;
}

.mlo-filter-pills .mlo-filter-btn.active {
	background: #333;
	color: #fff;
}

.mlo-filter-dropdown .mlo-filter-select {
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1em;
	min-width: 200px;
	padding: 8px 12px;
}

.mlo-item-hidden {
	display: none !important;
}

.mlo-gallery-block[data-animation=fade] .mlo-gallery-item {
	transition: opacity .4s ease;
}

.mlo-gallery-block[data-animation=fade] .mlo-gallery-item.mlo-anim-hide {
	opacity: 0;
}

.mlo-gallery-block[data-animation=slide] .mlo-gallery-item {
	transition: transform .4s ease, opacity .4s ease;
}

.mlo-gallery-block[data-animation=slide] .mlo-gallery-item.mlo-anim-hide {
	opacity: 0;
	transform: scale(.8);
}

.mlo-lightbox-overlay {
	align-items: center;
	background: rgba(0, 0, 0, .9);
	display: none;
	height: 100%;
	justify-content: center;
	left: 0;
	opacity: 0;
	position: fixed;
	top: 0;
	transition: opacity .3s ease;
	width: 100%;
	z-index: 999999;
}

.mlo-lightbox-overlay.active {
	display: flex;
	opacity: 1;
}

.mlo-lightbox-overlay.active .mlo-lightbox-img {
	opacity: 1;
	transform: scale(1);
}

.mlo-lightbox-inner {
	align-items: center;
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: center;
	position: relative;
	width: 100%;
}

.mlo-lightbox-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 30px;
	line-height: 1;
	opacity: .7;
	padding: 10px;
	position: absolute;
	right: 20px;
	top: 20px;
	transition: opacity .2s;
	z-index: 10;
}

.mlo-lightbox-close:hover {
	opacity: 1;
}

.mlo-lightbox-counter {
	color: #ccc;
	font-size: 14px;
	left: 30px;
	position: absolute;
	top: 30px;
}

.mlo-lightbox-next, .mlo-lightbox-prev {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 60px;
	opacity: .5;
	padding: 20px;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: opacity .2s;
	z-index: 10;
}

.mlo-lightbox-next:hover, .mlo-lightbox-prev:hover {
	opacity: 1;
}

.mlo-lightbox-prev {
	left: 20px;
}

.mlo-lightbox-next {
	right: 20px;
}

.mlo-lightbox-img-wrap {
	align-items: center;
	display: flex;
	flex-direction: column;
	justify-content: center;
	max-height: 85vh;
	max-width: 90%;
	text-align: center;
}

.mlo-lightbox-img {
	max-height: calc(85vh - 40px);
	max-width: 100%;
	-o-object-fit: contain;
	object-fit: contain;
	opacity: 0;
	transform: scale(.95);
	transition: transform .3s cubic-bezier(.175, .885, .32, 1.275), opacity .3s;
}

.mlo-lightbox-caption {
	color: #ddd;
	font-size: 16px;
	margin-top: 15px;
	min-height: 24px;
}

body.mlo-lightbox-open {
	overflow: hidden;
}

.block-editor-block-list__block .mlo-lightbox-trigger {
	pointer-events: none;
}

.mlo-gallery-block-placeholder {
	background: #f0f0f1;
	border: 1px dashed #757575;
	border-radius: 4px;
	color: #1e1e1e;
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
	padding: 40px 20px;
	text-align: center;
}

@media (max-width:768px) {
	.mlo-gallery-layout-grid .mlo-gallery-grid {
		grid-template-columns: repeat(min(2, var(--mlo-columns)), 1fr) !important;
	}
	
	.mlo-gallery-layout-masonry .mlo-gallery-grid {
		-moz-column-count: min(2, var(--mlo-columns)) !important;
		column-count: min(2, var(--mlo-columns)) !important;
	}
	
	.mlo-lightbox-next, .mlo-lightbox-prev {
		font-size: 40px;
		padding: 10px;
	}
	
	.mlo-lightbox-prev {
		left: 0;
	}
	
	.mlo-lightbox-next {
		right: 0;
	}
	
	.mlo-carousel-wrapper {
		padding: 0 30px;
	}
}

@media (max-width:480px) {
	.mlo-gallery-layout-grid .mlo-gallery-grid {
		grid-template-columns: 1fr !important;
	}
	
	.mlo-gallery-layout-masonry .mlo-gallery-grid {
		-moz-column-count: 1 !important;
		column-count: 1 !important;
	}
	
	.mlo-gallery-layout-justified .mlo-gallery-item {
		height: auto;
	}
}
