/* =============================================================================
 * ce_gallery
 * ========================================================================== */

.ce_gallery .image_container {
	border-radius: var(--shape-media-radius, 0px);
}

.ce_gallery .cols_2 li {
	width: calc(100% / 2);
	float: left;
}

.ce_gallery .cols_3 li {
	width: calc(100% / 3);
	float: left;
}

.ce_gallery .cols_4 li {
	width: calc(100% / 4);
	float: left;
}

.ce_gallery .cols_5 li {
	width: calc(100% / 5);
	float: left;
}

.ce_gallery .cols_6 li {
	width: calc(100% / 6);
	float: left;
}

.ce_gallery .cols_7 li {
	width: calc(100% / 7);
	float: left;
}

.ce_gallery .cols_8 li {
	width: calc(100% / 8);
	float: left;
}

.ce_gallery .cols_9 li {
	width: calc(100% / 9);
	float: left;
}

.ce_gallery .cols_10 li {
	width: calc(100% / 10);
	float: left;
}

.ce_gallery .cols_11 li {
	width: calc(100% / 11);
	float: left;
}

.ce_gallery .cols_12 li {
	width: calc(100% / 12);
	float: left;
}

.edge .ce_gallery .cols_2 li {
	width: 49.8%;
	float: left;
}

.edge .ce_gallery .cols_3 li {
	width: 33.20%;
	float: left;
}

.edge .ce_gallery .cols_4 li {
	width: 24.98%;
	float: left;
}

.edge .ce_gallery .cols_5 li {
	width: 19.98%;
	float: left;
}

.edge .ce_gallery .cols_6 li {
	width: 16.65%;
	float: left;
}

.edge .ce_gallery .cols_7 li {
	width: 14.285%;
	float: left;
}

.edge .ce_gallery .cols_8 li {
	width: 12.46%;
	float: left;
}

.edge .ce_gallery .cols_9 li {
	width: 11.11%;
	float: left;
}

.edge .ce_gallery .cols_10 li {
	width: 10%;
	float: left;
}

.edge .ce_gallery .cols_11 li {
	width: 9.09%;
	float: left;
}

.edge .ce_gallery .cols_12 li {
	width: 8.33%;
	float: left;
}

/* Must match the image_container's side margin below, otherwise the list bleeds
   past the element and .block's overflow clips the outer images of every row. */
.ce_gallery .gallery-margin {
	margin-left: -5px;
	margin-right: -5px;
}

.ce_gallery .gallery-margin .image_container {
	margin: 0 5px 10px;

}

.ce_gallery .image_container {
	margin: 0;
}

.ce_gallery > ul li a {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
}

/* contao template: the link wraps the image itself, taken out of the flow the item collapses */
.ce_gallery > ul li a:has(img) {
	position: static;
	width: auto;
	height: auto;
}

/* hover: image stays visible and zooms softly, subtle scrim, glass icon */
/* .content itself stays opaque: an ancestor with opacity < 1 disables backdrop-filter, the blur would pop in at the end */
.ce_gallery .content {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	right: 0;
	height: 100%;
}

.ce_gallery .content:before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(180deg, rgba(15,23,42,0.15) 0%, rgba(15,23,42,0.55) 100%);
	opacity: 0;
	transition: opacity 0.45s cubic-bezier(0.2,0.8,0.2,1);
}

.ce_gallery li:hover .content:before,
.ce_gallery li a:focus-visible .content:before {
	opacity: 1;
}

.ce_gallery li img {
	transition: transform 0.8s cubic-bezier(0.2,0.8,0.2,1);
}

/* zoom only for linked images, otherwise it suggests a click that does nothing */
.ce_gallery li:hover .image_container:has(> a) img,
.ce_gallery li:focus-within .image_container:has(> a) img {
	transform: scale(1.06);
}

.ce_gallery .capt {
	opacity: 0;
	transform: translateY(8px);
	transition: transform 0.45s cubic-bezier(0.2,0.8,0.2,1), opacity 0.35s ease;
}

.ce_gallery li:hover .capt,
.ce_gallery li a:focus-visible .capt {
	opacity: 1;
	transform: translateY(0);
}

.ce_gallery .image_container {
	overflow: hidden;
}

.ce_gallery .content-outside {
	position: relative;
	display: table;
	width: 100%;
	height: 100%;
}

.ce_gallery .content-inside {
	display: table-cell;
	vertical-align: middle;
	text-align: center;
	color: rgb(255,255,255);
	line-height: 1.5;
}

.ce_gallery .capt h1,
.ce_gallery .capt h2,
.ce_gallery .capt h3,
.ce_gallery .capt h4,
.ce_gallery .capt h5,
.ce_gallery .capt h6 {
	font-size: 1.067rem;
	font-weight: bold;
	letter-spacing: 1px;
	color: rgb(255,255,255);
	margin: 0;
}

.ce_gallery .capt h1:after,
.ce_gallery .capt h2:after,
.ce_gallery .capt h3:after,
.ce_gallery .capt h4:after,
.ce_gallery .capt h5:after,
.ce_gallery .capt h6:after {
	content: '';
	width: 50px;
	height: 2px;
	display: block;
	margin: 8px auto 15px auto;
	background: rgb(255,255,255);
}

.ce_gallery .capt {
	font-size: 0.8rem;
}

.ce_gallery .image_container i.fa.fa-plus-circle {
	position: relative;
	display: inline-block;
	box-sizing: border-box;
	width: 56px;
	height: 56px;
	vertical-align: middle;
	border-radius: 50%;
	/* fades via colors + animated blur instead of opacity, so the glass effect grows with the animation */
	border: 1px solid rgba(255,255,255,0);
	background: rgba(255,255,255,0);
	-webkit-backdrop-filter: blur(0px);
	backdrop-filter: blur(0px);
	box-shadow: 0 8px 24px rgba(0,0,0,0);
	transform: scale(0.7);
	transition:
		transform 0.45s cubic-bezier(0.2,0.8,0.2,1),
		background-color 0.45s ease,
		border-color 0.45s ease,
		box-shadow 0.45s ease,
		-webkit-backdrop-filter 0.45s ease,
		backdrop-filter 0.45s ease;
}

.ce_gallery li:hover .image_container i.fa.fa-plus-circle,
.ce_gallery li a:focus-visible i.fa.fa-plus-circle {
	border-color: rgba(255,255,255,0.5);
	background: rgba(255,255,255,0.16);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	transform: scale(1);
}

.ce_gallery .image_container i.fa.fa-plus-circle:before,
.ce_gallery .image_container i.fa.fa-plus-circle:after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	margin: -1px 0 0 -9px;
	border-radius: 2px;
	background: rgba(255,255,255,0);
	transition: transform 0.45s cubic-bezier(0.2,0.8,0.2,1), background-color 0.45s ease;
}

.ce_gallery li:hover .image_container i.fa.fa-plus-circle:before,
.ce_gallery li:hover .image_container i.fa.fa-plus-circle:after,
.ce_gallery li a:focus-visible i.fa.fa-plus-circle:before,
.ce_gallery li a:focus-visible i.fa.fa-plus-circle:after {
	background: rgb(255,255,255);
}

.ce_gallery .image_container i.fa.fa-plus-circle:after {
	transform: rotate(90deg);
}

.ce_gallery li:hover .image_container i.fa.fa-plus-circle:before {
	transform: rotate(90deg);
}

.ce_gallery li:hover .image_container i.fa.fa-plus-circle:after {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.ce_gallery li:hover .image_container:has(> a) img,
	.ce_gallery li:focus-within .image_container:has(> a) img,
	.ce_gallery li:hover .image_container i.fa.fa-plus-circle:before,
	.ce_gallery li:hover .image_container i.fa.fa-plus-circle:after {
		transform: none;
	}

	.ce_gallery .image_container i.fa.fa-plus-circle:after {
		transform: rotate(90deg);
	}
}

.ce_gallery .capt {
	font-size: inherit;
}

/* gallery with borders */

.ce_gallery .borders li {
	padding: 10px;
}

.ce_gallery .borders li figure {
	border: 1px solid rgb(229,229,229);
}

/* gallery with swiper slider: controls stay inside the element, glass look readable on any image */

.ce_gallery .swiper-gallery-wrapper .swiper-slide {
	height: auto;
	/* Rounded media needs air between the slides, square reads better flush. The gap
	   comes from the Theme Designer's shape block; padding keeps Swiper's own slide
	   width untouched, the negative container margin keeps the outer edges flush. */
	padding: 0 calc(var(--shape-media-gap, 0px) / 2);
}

.ce_gallery .swiper-gallery-wrapper .swiper-container {
	margin: 0 calc(var(--shape-media-gap, 0px) / -2);
}

/* clip the widened container here instead of relying on .block's overflow */
.ce_gallery .swiper-gallery-wrapper {
	overflow: hidden;
}

.ce_gallery .swiper-gallery-wrapper .swiper-slide .image_container,
.ce_gallery .swiper-gallery-wrapper .swiper-slide img {
	height: 100%;
}

.ce_gallery .swiper-gallery-wrapper .swiper-slide img {
	width: 100%;
	object-fit: cover;
}

.ce_gallery .swiper-gallery-wrapper .swiper-button-prev,
.ce_gallery .swiper-gallery-wrapper .swiper-button-next {
	width: 44px;
	height: 44px;
	margin-top: -22px;
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: var(--shape-action-radius, 0px);
	background: rgba(15,23,42,0.35);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 6px 18px rgba(0,0,0,0.18);
	transition: background-color 0.25s ease, opacity 0.25s ease;
}

/* the gap widens the container by half of it per side, so add it back here to keep
   the visual inset at 12px regardless of the shape style */
.ce_gallery .swiper-gallery-wrapper .swiper-button-prev {
	left: calc(12px + var(--shape-media-gap, 0px) / 2);
}

.ce_gallery .swiper-gallery-wrapper .swiper-button-next {
	right: calc(12px + var(--shape-media-gap, 0px) / 2);
}

.ce_gallery .swiper-gallery-wrapper .swiper-button-prev:after,
.ce_gallery .swiper-gallery-wrapper .swiper-button-next:after {
	font-size: 14px;
	color: #fff;
}

.ce_gallery .swiper-gallery-wrapper .swiper-button-prev:hover,
.ce_gallery .swiper-gallery-wrapper .swiper-button-next:hover {
	background: rgba(15,23,42,0.55);
}

.ce_gallery .swiper-gallery-wrapper .swiper-button-disabled {
	opacity: 0;
	pointer-events: none;
}

.ce_gallery .swiper-gallery-wrapper .swiper-pagination {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	left: 50%;
	right: auto;
	bottom: 12px;
	width: auto;
	padding: 6px 10px;
	line-height: 0;
	border-radius: var(--shape-surface-radius, 0px);
	background: rgba(15,23,42,0.35);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transform: translateX(-50%);
}

.ce_gallery .swiper-gallery-wrapper .swiper-pagination .swiper-pagination-bullet {
	width: 6px;
	height: 6px;
	margin: 0;
	/* not 50%: the active bullet grows to 18px and 50% would stretch it into an ellipse */
	border-radius: var(--shape-action-radius, 999px);
	background: rgba(255,255,255,0.55);
	opacity: 1;
	transition: width 0.35s cubic-bezier(0.2,0.8,0.2,1), background-color 0.25s ease;
}

.ce_gallery .swiper-gallery-wrapper .swiper-pagination .swiper-pagination-bullet:hover {
	background: rgba(255,255,255,0.85);
}

.ce_gallery .swiper-gallery-wrapper .swiper-pagination .swiper-pagination-bullet-active,
.ce_gallery .swiper-gallery-wrapper .swiper-pagination .swiper-pagination-bullet-active:hover {
	width: 18px;
	background: var(--accentColor);
}

/* =============================================================================
 * ce_gallery flex-gallery
 * ========================================================================== */

.ce_gallery ul.flex-gallery {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.ce_gallery ul.flex-gallery li {
	max-width: none;
	line-height: 0;
	text-align: center;
}

.ce_gallery ul.flex-gallery.cols_1 li {
	flex: 0 0 100%;
}

.ce_gallery ul.flex-gallery.cols_2 li {
	flex: 0 0 calc(100% / 2);
}

.ce_gallery ul.flex-gallery.cols_3 li {
	flex: 0 0 calc(100% / 3);
}

.ce_gallery ul.flex-gallery.cols_4 li {
	flex: 0 0 calc(100% / 4);
}

.ce_gallery ul.flex-gallery.cols_5 li {
	flex: 0 0 calc(100% / 5);
}

.ce_gallery ul.flex-gallery.cols_6 li {
	flex: 0 0 calc(100% / 6);
}

.ce_gallery ul.flex-gallery.cols_7 li {
	flex: 0 0 calc(100% / 7);
}

.ce_gallery ul.flex-gallery.cols_8 li {
	flex: 0 0 calc(100% / 8);
}

.ce_gallery ul.flex-gallery.cols_9 li {
	flex: 0 0 calc(100% / 9);
}

.ce_gallery ul.flex-gallery.cols_10 li {
	flex: 0 0 calc(100% / 10);
}

.ce_gallery ul.flex-gallery.cols_11 li {
	flex: 0 0 calc(100% / 11);
}

.ce_gallery ul.flex-gallery.cols_12 li {
	flex: 0 0 calc(100% / 12);
}

.ce_gallery .borders.flex-gallery {
	align-items: inherit;
}

/* =============================================================================
 * ce_gallery gap field (pct_theme_settings: gallery_gap)
 * ========================================================================== */

/* Empty = the template decides. A chosen value always wins: over every gallery template
   (grid, borders, contao, isotope, zoom thumbnails, swiper) and over the Theme Designer's
   shape layer, which is why every rule below outranks those selectors. "With gap" follows
   the corner style: 10px, or the Theme Designer's media gap when that is larger. */
.ce_gallery.gap-none {
	--gallery-gap: 0px;
}

.ce_gallery.gap-default {
	--gallery-gap: max(10px, var(--shape-media-gap, 0px));
}

/* grid lists directly in the element: half the gap around every item, the list pulls the
   outer half back, so the outer images stay flush with the element */
.ce_gallery:is(.gap-none, .gap-default) > ul[class*="cols_"] {
	margin: calc(var(--gallery-gap) / -2);
	padding: 0;
}

/* rounded media (Theme Designer Soft/Round) keep the same air at the outer edges as between
   the items, square media stay flush */
.ce_gallery.gap-default > ul[class*="cols_"] {
	margin: calc(var(--shape-media-gap, 0px) - var(--gallery-gap) / 2);
}

/* floated lists must contain their items, otherwise the negative margin has nothing to hold */
.ce_gallery:is(.gap-none, .gap-default) > ul[class*="cols_"]:not(.flex-gallery, .isotope-gallery) {
	display: flow-root;
}

.ce_gallery:is(.gap-none, .gap-default) > ul[class*="cols_"] > li {
	padding: calc(var(--gallery-gap) / 2);
}

.ce_gallery:is(.gap-none, .gap-default) > ul[class*="cols_"] > li .image_container {
	margin: 0;
}

/* zoom gallery: the thumbnail list */
.ce_gallery:is(.gap-none, .gap-default) .ce_elevatezoom ul[class*="cols_"] {
	margin: 0 calc(var(--gallery-gap) / -2);
	padding: 0;
}

.ce_gallery:is(.gap-none, .gap-default) .ce_elevatezoom ul[class*="cols_"] > li {
	padding: 0 calc(var(--gallery-gap) / 2);
	margin-bottom: var(--gallery-gap);
}

/* swiper: same mechanism as the shape gap, driven by the field */
.ce_gallery:is(.gap-none, .gap-default) .swiper-gallery-wrapper .swiper-slide {
	padding: 0 calc(var(--gallery-gap) / 2);
}

.ce_gallery:is(.gap-none, .gap-default) .swiper-gallery-wrapper .swiper-container {
	margin: 0 calc(var(--gallery-gap) / -2);
}

/* =============================================================================
* smart phones  (s / small screens)
* ========================================================================== */
@media only screen and (max-width: 767px) {
	.ce_gallery .gallery-margin .image_container {
		margin-bottom: 10px;
	}
	
	.ce_gallery [class*='cols_'] li {
		width: 49.8%;
	}

	.ce_gallery .borders li,
	.ce_gallery .borders li.col_last {
		border-right: 1px solid transparent;
		width: 50%;
	}

	.ce_gallery .borders li.row_last {
		border-bottom: 1px solid rgb(229,229,229);
	}

	.ce_gallery .borders li:nth-child(odd) {
		border-right: 1px solid rgb(229,229,229);
	}

	.ce_gallery ul.flex-gallery li {
		flex: 0 0 50%!important;
	}
}


