.bupuf-gallery-item {
	padding: 8px;
    display: inline-flex;
    align-items: stretch;
    max-height: 150px;
}

.bupuf-gallery-item > a {
	display: flex;
	width: 100%;
}

.bupuf-gallery-item > a:hover,
.bupuf-gallery-item > a:focus {
    text-decoration: none;
}

.bupuf-gallery-item > a > img {
	max-width: 100%;
	height: auto;
	margin: auto;
	display: block;
    max-height: 100%;
}

.bupuf-layout.layout-gallery .gallery-title,
.bupuf-layout.layout-gallery-items .gallery-title {
	text-align: center;
	padding-left: 8px;
	padding-right: 8px;
}

.bupuf-impromptu-gallery .gallery-content,
.layout-gallery .gallery-content,
.layout-gallery-items .gallery-content {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-evenly;
	align-items: stretch;
}

.bupuf-impromptu-gallery .bupuf-gallery-item {
	flex-basis: 166px;
	flex-grow: 0;
	flex-shrink: 0;
	border: none;
}

.bupuf-impromptu-gallery.thumbnail-size-small .bupuf-gallery-item {
	flex-basis: 116px;
}

/* BlueImp Gallery Overrides START */

#bupuf-blueimp-gallery-lightbox .slides .slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}


#bupuf-blueimp-gallery-lightbox .slides .slide .slide-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* BlueImp Gallery Overrides END */
/* Gallery Item Meta Text START */

.bupuf-gallery-item-wrapper {
    color: white;
}

.bupuf-gallery-item-wrapper .slide-title,
.bupuf-gallery-item-wrapper .slide-subtitle,
.bupuf-gallery-item-wrapper .slide-description {
    display: block;
    margin: 6px;
}

.bupuf-gallery-item-wrapper .slide-title { font-weight: bold; }
.bupuf-gallery-item-wrapper .slide-subtitle { font-weight: bolder; }

.bupuf-gallery-item-wrapper img {
    object-fit: contain;
    min-height: 0;
}

/* Gallery Item Meta Text END */
/* Gallery Items Layout START */

.layout-gallery-items .bupuf-gallery-item {
    max-height: unset;
}

.layout-gallery-items .bupuf-gallery-item > a {
    flex-direction: column;
}

.bupuf-gallery-item .gallery-item-title { font-weight: bold; }
.bupuf-gallery-item .gallery-item-subtitle { font-weight: bolder; }

.bupuf-gallery-item .gallery-item-image {
    height: 250px;
    width: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0;
    padding: 0;
}

.gallery-item-image-overlay {
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 45px;
    opacity: 0;
    transition: opacity 0.2s;
}

a.gallery-link:hover .gallery-item-image-overlay {
    opacity: 0.6;

}

.gallery-item-description p {
    margin: 0;
}

/* Gallery Items Layout END */