.mauve-gallery {
	--mg-columns: 3; --mg-gap: 24px; --mg-row-gap: 24px;
	--mg-scatter-space: 130px; --mg-scatter-size: 100%; --mg-duration: 1100ms;
	--mg-hover-duration: 700ms; --mg-radius: 0px;
	--mg-caption-overlay: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.55));
}
.mauve-gallery__grid { display: grid; grid-template-columns: repeat(var(--mg-columns), minmax(0, 1fr)); gap: var(--mg-row-gap) var(--mg-gap); }
.mauve-gallery .mauve-gallery__item { margin: 0; min-width: 0; }
.mauve-gallery__text-wrap { display: grid; gap: 24px; margin-bottom: 24px; }
.mauve-gallery__text-block {
	display: flex; width: 100%; flex-direction: column; justify-content: center; min-width: 0;
	box-sizing: border-box; text-align: center; overflow-wrap: anywhere;
}
.mauve-gallery__text-title { margin: 0; color: inherit; }
.mauve-gallery__text-description { margin: 0; }
.mauve-gallery__text-title + .mauve-gallery__text-description { margin-top: 16px; }
.mauve-gallery__text-divider { display: block; align-self: center; width: 40px; height: 1px; margin: 24px 0 0; background: currentColor; }
.mauve-gallery__sizer, .mauve-gallery__gutter { display: none; }
.mauve-gallery .mauve-gallery__reveal { position: relative; margin: 0; min-width: 0; }
.mauve-gallery__media { overflow: hidden; border-radius: var(--mg-radius); }
.mauve-gallery__media a { display: block; color: inherit; }
.mauve-gallery .mauve-gallery__media img { width: 100%; height: auto; display: block; }
.mauve-gallery--ratio-crop .mauve-gallery__media img { aspect-ratio: var(--mg-image-ratio); object-fit: cover; }
.mauve-gallery__caption { margin-top: 12px; font-size: .875em; }
.mauve-gallery__grid:focus { outline: none; }
.mauve-gallery__media a:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.mauve-gallery__reveal:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Overlay is part of the reveal figure, so entrance masks reveal image and text together. */
.mauve-gallery .mauve-gallery__caption--overlay {
	position: absolute; inset: 0; margin: 0; padding: 24px; box-sizing: border-box;
	display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
	border-radius: var(--mg-radius); background: var(--mg-caption-overlay); pointer-events: none;
}
.mauve-gallery__caption span { display: block; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
	.mauve-gallery .mauve-gallery__media img {
		transition: transform var(--mg-hover-duration) cubic-bezier(.22,.61,.36,1), filter var(--mg-hover-duration) ease;
	}
	.mauve-gallery .mauve-gallery__caption--overlay,
	.mauve-gallery .mauve-gallery__caption--overlay span {
		transition: opacity var(--mg-hover-duration) ease, transform var(--mg-hover-duration) cubic-bezier(.22,.61,.36,1), clip-path var(--mg-hover-duration) cubic-bezier(.77,0,.18,1);
	}
	.mauve-gallery--caption-fade .mauve-gallery__caption--overlay,
	.mauve-gallery--caption-slide .mauve-gallery__caption--overlay,
	.mauve-gallery--caption-mask .mauve-gallery__caption--overlay { opacity: 0; }
	.mauve-gallery--caption-slide .mauve-gallery__caption--overlay span { transform: translateY(16px); }
	.mauve-gallery--caption-mask .mauve-gallery__caption--overlay span { clip-path: inset(100% -.15em 0); transform: translateY(8px); }
	.mauve-gallery .mauve-gallery__item:is(:hover, :focus-within) .mauve-gallery__caption--overlay { opacity: 1; }
	.mauve-gallery .mauve-gallery__item:is(:hover, :focus-within) .mauve-gallery__caption--overlay span { transform: none; }
	.mauve-gallery--caption-mask .mauve-gallery__item:is(:hover, :focus-within) .mauve-gallery__caption--overlay span { clip-path: inset(-.25em -.15em); }
	.mauve-gallery--hover-zoom-in .mauve-gallery__item:is(:hover, :focus-within) img { transform: scale(1.065); }
	.mauve-gallery--hover-zoom-out .mauve-gallery__media img { transform: scale(1.08); }
	.mauve-gallery--hover-zoom-out .mauve-gallery__item:is(:hover, :focus-within) img { transform: scale(1); }
	.mauve-gallery--hover-drift .mauve-gallery__media img { transform: scale(1.08) translateX(-2%); }
	.mauve-gallery--hover-drift .mauve-gallery__item:is(:hover, :focus-within) img { transform: scale(1.08) translateX(2%); }
	.mauve-gallery--hover-color .mauve-gallery__media img { filter: grayscale(1); }
	.mauve-gallery--hover-color .mauve-gallery__item:is(:hover, :focus-within) img { filter: grayscale(0); }
}

/* Masonry positions the outer figures; reveal transforms only affect the media inside. */
.mauve-gallery--masonry.is-masonry .mauve-gallery__grid { display: block; }
.mauve-gallery--masonry.is-masonry .mauve-gallery__entry,
.mauve-gallery--masonry .mauve-gallery__sizer { width: calc((100% - (var(--mg-columns) - 1) * var(--mg-gap)) / var(--mg-columns)); }
.mauve-gallery--masonry .mauve-gallery__sizer,
.mauve-gallery--masonry .mauve-gallery__gutter { display: block; height: 0; position: absolute; pointer-events: none; }
.mauve-gallery--masonry .mauve-gallery__gutter { width: var(--mg-gap); }
.mauve-gallery--masonry .mauve-gallery__sizer { height: var(--mg-row-gap); }
.mauve-gallery--masonry.is-masonry .mauve-gallery__entry { margin-bottom: var(--mg-row-gap); }

/* Use actual image columns: a gutter must not be multiplied across twelve tracks. */
.mauve-gallery--scatter { --mg-row-gap: 130px; --mg-scatter-columns: 2; }
.mauve-gallery--scatter-3 { --mg-scatter-columns: 3; }
.mauve-gallery--scatter .mauve-gallery__grid {
	grid-template-columns: repeat(var(--mg-scatter-columns), minmax(0, 1fr));
	align-items: start; row-gap: var(--mg-row-gap);
	column-gap: min(clamp(0px, var(--mg-gap), 100px), 20%);
}
/* Unequal sizes preserve the scattered composition. Spread moves images within
   their own tracks, so even the widest setting cannot push them outside. */
.mauve-gallery--scatter { --mg-scatter-spread: 1; }
.mauve-gallery--scatter .mauve-gallery__item {
	--mg-item-size: clamp(0%, calc(var(--mg-scatter-size) * var(--mg-size-factor, 1)), 100%);
	--mg-inset: calc((100% - var(--mg-item-size)) * clamp(0, var(--mg-scatter-spread), 1) * var(--mg-spread-factor, 1));
	width: var(--mg-item-size); justify-self: end; margin-inline-end: var(--mg-inset);
}
.mauve-gallery--scatter .mauve-gallery__item--1 { --mg-size-factor: .833333; }
.mauve-gallery--scatter .mauve-gallery__item--2 { --mg-size-factor: .833333; margin-top: var(--mg-scatter-space); }
.mauve-gallery--scatter .mauve-gallery__item--3 { --mg-size-factor: .666667; --mg-spread-factor: .5; margin-top: calc(var(--mg-scatter-space) * .4); }
.mauve-gallery--scatter .mauve-gallery__item--6 { --mg-size-factor: .666667; margin-top: var(--mg-scatter-space); }
.mauve-gallery--scatter-2 .mauve-gallery__item--2,
.mauve-gallery--scatter-2 .mauve-gallery__item--4,
.mauve-gallery--scatter-2 .mauve-gallery__item--6 { justify-self: start; margin-inline-end: 0; margin-inline-start: var(--mg-inset); }
.mauve-gallery--scatter-3 .mauve-gallery__item--1,
.mauve-gallery--scatter-3 .mauve-gallery__item--3 { --mg-size-factor: .9; }
.mauve-gallery--scatter-3 .mauve-gallery__item--2 { --mg-size-factor: .82; margin: calc(var(--mg-scatter-space) * .65) 0 0; justify-self: center; }
.mauve-gallery--scatter-3 .mauve-gallery__item--3 { --mg-spread-factor: 1; margin-top: calc(var(--mg-scatter-space) * .2); }
.mauve-gallery--scatter-3 .mauve-gallery__item--4 { --mg-size-factor: .82; --mg-spread-factor: .5; margin-top: calc(var(--mg-scatter-space) * .4); }
.mauve-gallery--scatter-3 .mauve-gallery__item--5 { margin-inline: 0; justify-self: center; }
.mauve-gallery--scatter-3 .mauve-gallery__item--6 { --mg-size-factor: .85; }
.mauve-gallery--scatter-3 .mauve-gallery__item--3,
.mauve-gallery--scatter-3 .mauve-gallery__item--6 { justify-self: start; margin-inline-end: 0; margin-inline-start: var(--mg-inset); }
.mauve-gallery__float { transform: translateY(var(--mg-float-y, 0px)); }

.mauve-gallery .mauve-gallery__nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.mauve-gallery .mauve-gallery__nav[hidden] { display: none; }
.mauve-gallery__nav button { cursor: pointer; border: 1px solid currentColor; background: transparent; color: inherit; padding: 12px 20px; font: inherit; border-radius: 0; transition: opacity .2s; }
.mauve-gallery__nav button:hover { opacity: .7; }
.mauve-gallery__nav button[aria-current="page"] { box-shadow: inset 0 -3px currentColor; }
.mauve-gallery__nav button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.mauve-gallery__nav button:disabled { opacity: .4; cursor: default; }
.mauve-gallery__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Slideshow reuses the Blog Posts Swiper behaviour, while keeping the Image
   Gallery's media-library captions and Elementor lightbox grouping. */
.mauve-gallery--slideshow { --mg-side-caption-offset: 24px; --mg-slideshow-height: 640px; }
.mauve-gallery--slideshow .swiper-wrapper { height: var(--mg-slideshow-height); }
.mauve-gallery--slideshow .swiper-slide { height: var(--mg-slideshow-height); }
.mauve-gallery--slideshow .mauve-gallery-slideshow__slide,
.mauve-gallery--slideshow .mauve-gallery-slideshow__tile { overflow: visible; }
.mauve-gallery--slideshow .mauve-gallery-slideshow__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}
.mauve-gallery--slideshow .ss-natural .mauve-gallery-slideshow__media {
	position: relative;
	display: inline-block;
	width: auto;
	height: 100%;
}
.mauve-gallery--slideshow .mauve-gallery-slideshow__caption { margin: 0; }
.mauve-gallery--slideshow .mauve-gallery-slideshow__caption--below {
	top: auto; min-height: 78px; padding: 18px 0 0; color: inherit; background: none;
	justify-content: flex-end;
}
.mauve-gallery--slideshow .caption-placement-below .mauve-gallery-slideshow__media { bottom: 78px; }
.mauve-gallery--slideshow .ss-natural .caption-placement-below .mauve-gallery-slideshow__media {
	bottom: auto;
	height: calc(100% - 78px);
}
.mauve-gallery--slideshow .mauve-gallery-slideshow__caption--overlay {
	background: var(--mg-caption-overlay); color: #fff;
}
.mauve-gallery--slideshow .mauve-gallery-slideshow__caption--side {
	left: auto;
	right: calc(100% + var(--mg-side-caption-offset));
	top: 50%;
	bottom: auto;
	min-height: 0;
	padding: 0;
	color: inherit;
	background: none;
	justify-content: center;
	align-items: flex-start;
	translate: 0 -50%;
	text-shadow: none;
}
.mauve-caption-v-flex-start .mauve-gallery--slideshow .mauve-gallery-slideshow__caption--side { top: 0; translate: 0 0; }
.mauve-caption-v-center .mauve-gallery--slideshow .mauve-gallery-slideshow__caption--side { top: 50%; translate: 0 -50%; }
.mauve-caption-v-flex-end .mauve-gallery--slideshow .mauve-gallery-slideshow__caption--side { top: 100%; translate: 0 -100%; }
.mauve-gallery--slideshow .mauve-gallery-slideshow__caption .blog-slideshow-caption-text { max-width: 100%; }
.mauve-gallery--slideshow .mauve-gallery-slideshow__lightbox {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 30;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,.42);
	box-shadow: none;
	color: #fff;
	cursor: pointer !important;
	pointer-events: auto !important;
	transition: background-color .25s ease, transform .25s ease;
}
.mauve-gallery--slideshow .mauve-gallery-slideshow__lightbox:hover {
	background: rgba(0,0,0,.68);
	color: #fff;
	transform: scale(1.06);
}
.mauve-gallery--slideshow .mauve-gallery-slideshow__lightbox:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.mauve-gallery--slideshow .mauve-gallery-slideshow__lightbox svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.mauve-gallery--slideshow .caption-placement-below .mauve-gallery-slideshow__lightbox { bottom: 94px; }

/* Animate the media link independently from the parallaxed image. This keeps
   hover motion smooth even while Swiper writes transforms to the image. */
@media (hover: hover) and (pointer: fine) {
	.mauve-gallery--slideshow .blog-slideshow-link {
		transition: transform var(--mg-hover-duration) var(--mg-hover-ease, cubic-bezier(.22,.61,.36,1));
		transform-origin: center;
	}
	.mauve-gallery--slideshow .blog-slideshow-img {
		transition-property: filter;
		transition-duration: var(--mg-hover-duration);
		transition-timing-function: ease;
	}
	.mauve-gallery--slideshow .ss-parallax .blog-slideshow-img {
		transition-property: transform, filter;
		transition-duration: var(--ss-parallax-duration, 0ms), var(--mg-hover-duration);
		transition-timing-function: ease, ease;
	}
	.mauve-gallery--slideshow.mauve-gallery--hover-zoom-in .mauve-gallery-slideshow__slide:is(:hover, .is-pointer-slide) .blog-slideshow-link { transform: scale(1.06); }
	.mauve-gallery--slideshow.mauve-gallery--hover-zoom-out .blog-slideshow-link { transform: scale(1.06); }
	.mauve-gallery--slideshow.mauve-gallery--hover-zoom-out .mauve-gallery-slideshow__slide:is(:hover, .is-pointer-slide) .blog-slideshow-link { transform: scale(1); }
	.mauve-gallery--slideshow.mauve-gallery--hover-drift .blog-slideshow-link { transform: scale(1.06) translateX(-1.5%); }
	.mauve-gallery--slideshow.mauve-gallery--hover-drift .mauve-gallery-slideshow__slide:is(:hover, .is-pointer-slide) .blog-slideshow-link { transform: scale(1.06) translateX(1.5%); }
	.mauve-gallery--slideshow.mauve-gallery--hover-color .blog-slideshow-img { filter: grayscale(1); }
	.mauve-gallery--slideshow.mauve-gallery--hover-color .mauve-gallery-slideshow__slide:is(:hover, .is-pointer-slide) .blog-slideshow-img { filter: grayscale(0); }
}
.mauve-gallery--slideshow .swiper-button-prev,
.mauve-gallery--slideshow .swiper-button-next,
.mauve-gallery--slideshow .swiper-button-prev:hover,
.mauve-gallery--slideshow .swiper-button-next:hover,
.mauve-gallery--slideshow .swiper-button-prev:focus,
.mauve-gallery--slideshow .swiper-button-next:focus {
	z-index: 5;
	-webkit-appearance: none !important;
	appearance: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: var(--mg-arrow-radius, 50%) !important;
	padding: 0 !important;
	background: var(--mg-arrow-background, rgba(0,0,0,.32)) !important;
	box-shadow: none !important;
	color: var(--mg-arrow-color, #fff) !important;
	font: inherit;
}

@media (max-width: 767px) {
	.mauve-gallery--slideshow { --mg-slideshow-height: 72vh; }
	.mauve-gallery--slideshow .swiper-wrapper { min-height: 360px; }
	.mauve-gallery--slideshow .swiper-slide { min-height: 0; }
	.mauve-gallery--slideshow .mauve-gallery-slideshow__caption--side {
		left: 22px; right: auto; top: auto !important; bottom: 28px !important; width: calc(100% - 44px) !important;
		color: #fff; translate: none !important;
	}
	.mauve-gallery--slideshow .swiper-button-prev,
	.mauve-gallery--slideshow .swiper-button-next { display: none; }
}

/* First-paint guard, with a fallback if scripts fail or load very late. */
.mauve-gallery--reveal:not(.is-ready) .mauve-gallery__reveal { visibility: hidden; animation: mauve-gallery-fallback 0s 10s forwards; }
@keyframes mauve-gallery-fallback { to { visibility: visible; } }
.mauve-gallery__reveal.is-pending { visibility: hidden; }
.mauve-gallery .mauve-gallery__reveal.is-revealing {
	visibility: visible; animation-duration: var(--mg-duration); animation-delay: var(--mg-delay, 0ms);
	animation-fill-mode: both;
}
@media (max-width: 1024px) {
	.mauve-gallery { --mg-columns: 2; --mg-scatter-space: 70px; }
	.mauve-gallery--scatter { --mg-row-gap: 70px; }
}
@media (max-width: 767px) {
	.mauve-gallery { --mg-columns: 1; --mg-scatter-space: 40px; --mg-gap: 16px; }
	.mauve-gallery--scatter { --mg-row-gap: 40px; }
	.mauve-gallery--scatter .mauve-gallery__grid { grid-template-columns: minmax(0, 1fr); }
	.mauve-gallery.mauve-gallery--scatter .mauve-gallery__item { grid-column: 1; margin: 0; width: var(--mg-scatter-size); justify-self: start; }
	.mauve-gallery.mauve-gallery--scatter .mauve-gallery__item:nth-of-type(even) { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
	.mauve-gallery__float { transform: none; }
	.mauve-gallery .mauve-gallery__media img,
	.mauve-gallery .mauve-gallery__caption--overlay,
	.mauve-gallery .mauve-gallery__caption--overlay span { transition: none; }
	.mauve-gallery .mauve-gallery__media img { transform: none !important; }
	.mauve-gallery .mauve-gallery__caption--overlay span { transform: none !important; clip-path: none !important; }
	.mauve-gallery--reveal:not(.is-ready) .mauve-gallery__reveal,
	.mauve-gallery .mauve-gallery__reveal.is-pending,
	.mauve-gallery .mauve-gallery__reveal.is-revealing { visibility: visible; animation: none; }
}
