.wp-block-behold-gallery-content.behold-justified-ready {
	position: relative;
}

.wp-block-behold-gallery-content.behold-justified-ready > .behold-gallery-grid__image {
	position: absolute;
	margin: 0;
}

.wp-block-behold-gallery-content.behold-justified-ready > .behold-gallery-grid__image img,
.wp-block-behold-gallery-content.behold-justified-ready > .behold-gallery-grid__image > a {
	height: 100%;
}


/* Per-gallery crops preserve the media-library original and share editor/front geometry. */
.wp-block-behold-gallery-content > .behold-gallery-grid__image.has-image-crop { overflow: hidden; aspect-ratio: var(--behold-crop-ratio); }
.wp-block-behold-gallery-content:not(.behold-masonry-ready):not(.behold-justified-ready) > .has-image-crop { position: relative; }
.wp-block-behold-gallery-content > .has-image-crop img {
 position: absolute;
 width: var(--behold-crop-width) !important;
 height: var(--behold-crop-height) !important;
 max-width: none !important;
 left: var(--behold-crop-left);
 top: var(--behold-crop-top);
 aspect-ratio: var(--behold-crop-ratio) !important;
 border-radius: 0 !important;
 object-fit: fill;
}

/* Transform only the image in frontend and editor previews,
 * preserving crop geometry and Masonry/Justified positioning on the figure. */
@media (hover: hover) and (pointer: fine) {
	.wp-block-behold-gallery-content[data-hover-effect="rotate-zoom"] > .behold-gallery-grid__image:hover img {
		transform: scale(1.16) rotate(2deg);
	}
	.wp-block-behold-gallery-content[data-hover-effect="pan"] > .behold-gallery-grid__image img {
		transform: scale(1.12) translateX(-2%);
	}
	.wp-block-behold-gallery-content[data-hover-effect="pan"] > .behold-gallery-grid__image:hover img {
		transform: scale(1.12) translateX(2%);
	}
	/* Hovering a gap does not blur the gallery. */
	.wp-block-behold-gallery-content[data-hover-effect="focus"] > .behold-gallery-grid__image img {
		filter: blur(0px) grayscale(0);
	}
	.wp-block-behold-gallery-content[data-hover-effect="focus"][data-hover-grayscale="true"]:hover > .behold-gallery-grid__image img,
	.wp-block-behold-gallery-content[data-hover-effect="focus"][data-hover-grayscale="true"]:has(> .behold-gallery-grid__image:hover) > .behold-gallery-grid__image img {
		filter: blur(0px) grayscale(1);
	}
	.wp-block-behold-gallery-content[data-hover-effect="focus"][data-hover-grayscale="true"]:has(> .behold-gallery-grid__image:hover) > .behold-gallery-grid__image:hover img {
		filter: blur(0px) grayscale(0);
	}
	.wp-block-behold-gallery-content[data-hover-effect="focus"]:has(> .behold-gallery-grid__image:hover) > .behold-gallery-grid__image:not(:hover) img {
		filter: blur(3px) grayscale(0);
	}
	.wp-block-behold-gallery-content[data-hover-effect="focus"][data-hover-grayscale="true"]:has(> .behold-gallery-grid__image:hover) > .behold-gallery-grid__image:not(:hover) img {
		filter: blur(3px) grayscale(1);
	}

}
@media (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-effect="rotate-zoom"] > .behold-gallery-grid__image img,
	.wp-block-behold-gallery-content[data-hover-effect="pan"] > .behold-gallery-grid__image img {
		transition: transform var(--behold-appearance-duration, 420ms) ease-out, filter var(--behold-appearance-duration, 280ms) ease-out;
	}
	.wp-block-behold-gallery-content[data-hover-effect="focus"] > .behold-gallery-grid__image img {
		transition: transform var(--behold-appearance-duration, 180ms) ease-out, filter var(--behold-appearance-duration, 420ms) cubic-bezier(0.22, 1, 0.36, 1);
	}
	/* A separate pseudo-element keeps the existing color overlay and icon usable. */
	.wp-block-behold-gallery-content[data-hover-shine="true"] > .behold-gallery-grid__image::before {
		content: '';
		position: absolute;
		inset: 0;
		background: var(--behold-shine-background, linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 30%) 50%, transparent 70%));
		transform: var(--behold-shine-start, translateX(-150%));
		opacity: var(--behold-shine-opacity, 1);
		pointer-events: none;
		z-index: 2;
	}
	.wp-block-behold-gallery-content[data-hover-shine="true"] .behold-gallery-expand-icon { z-index: 6; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-shine="true"] > .behold-gallery-grid__image:hover::before { animation: var(--behold-shine-animation, behold-gallery-shine) var(--behold-appearance-duration, 700ms) ease-out both; }
}
@keyframes behold-gallery-shine {
	from { transform: translateX(-150%); }
	to { transform: translateX(150%); }
}
/* Shine variants share the same inert layer and respect reduced motion. */
.wp-block-behold-gallery-content[data-hover-shine-type="double"] {
 --behold-shine-background: linear-gradient(110deg, transparent 20%, rgb(255 255 255 / 30%) 32%, transparent 42%, transparent 48%, rgb(255 255 255 / 23%) 60%, transparent 72%);
}
/* A broad, low-intensity band fades gently towards both edges. */
.wp-block-behold-gallery-content[data-hover-shine-type="soft-diagonal"] {
 --behold-shine-background: linear-gradient(110deg, transparent 10%, rgb(255 255 255 / 3%) 25%, rgb(255 255 255 / 9%) 40%, rgb(255 255 255 / 16%) 50%, rgb(255 255 255 / 9%) 60%, rgb(255 255 255 / 3%) 75%, transparent 90%);
}
/* Two soft diagonal bands retain the gentle intensity of the single sweep. */
.wp-block-behold-gallery-content[data-hover-shine-type="soft-double-diagonal"] {
 --behold-shine-background: linear-gradient(110deg, transparent 5%, rgb(255 255 255 / 3%) 14%, rgb(255 255 255 / 9%) 23%, rgb(255 255 255 / 16%) 32%, rgb(255 255 255 / 9%) 41%, rgb(255 255 255 / 3%) 50%, transparent 55%, rgb(255 255 255 / 3%) 60%, rgb(255 255 255 / 8%) 69%, rgb(255 255 255 / 13%) 78%, rgb(255 255 255 / 8%) 87%, rgb(255 255 255 / 3%) 94%, transparent 100%);
}
/* Touch zoom stays inside the frame; desktop Tilt rotates the entire frame. */
@media (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] > .behold-gallery-grid__image img {
		transition: transform var(--behold-appearance-duration, 150ms) ease-out, filter var(--behold-appearance-duration, 180ms) ease-out;
	}
	.wp-block-behold-gallery-content:is([data-hover-effect="tilt-3d"], [data-hover-effect="parallax"]) > .behold-gallery-grid__image.behold-gallery-pressed img {
		transform: scale(1.03);
	}
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] {
		perspective: 700px;
		perspective-origin: var(--behold-tilt-origin-x, 50%) var(--behold-tilt-origin-y, 50%);
		transition: perspective-origin var(--behold-appearance-duration, 300ms) cubic-bezier(0.25, 0.1, 0.25, 1);
		isolation: isolate;
	}
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] > .behold-gallery-grid__image {
		/* Individual rotation composes with the layout engines' FLIP transforms. */
		rotate: none;
		transition: rotate var(--behold-appearance-duration, 450ms) cubic-bezier(0.22, 1, 0.36, 1), translate var(--behold-appearance-duration, 180ms) ease-out, box-shadow var(--behold-appearance-duration, 180ms) ease-out;
	}
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] > .behold-gallery-grid__image.behold-gallery-tilting {
		rotate: var(--behold-tilt-axis-x, 0) var(--behold-tilt-axis-y, 1) 0 var(--behold-tilt-angle, 0deg);
		transition-duration: var(--behold-appearance-duration, 300ms), var(--behold-appearance-duration, 180ms), var(--behold-appearance-duration, 180ms);
		transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1), ease-out, ease-out;
		z-index: 10;
	}
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] > .behold-gallery-grid__image.behold-gallery-tilt-returning {
		rotate: var(--behold-tilt-axis-x, 0) var(--behold-tilt-axis-y, 1) 0 0deg;
		z-index: 10;
	}
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-behold-gallery-content[data-hover-effect="tilt-3d"] > .behold-gallery-grid__image { rotate: none; transition: none; }
	.wp-block-behold-gallery-content[data-hover-effect="rotate-zoom"] > .behold-gallery-grid__image:hover img { transform: none; }
	.wp-block-behold-gallery-content[data-hover-effect="pan"] > .behold-gallery-grid__image img,
	.wp-block-behold-gallery-content[data-hover-effect="pan"] > .behold-gallery-grid__image:hover img { transform: none; }
}

/* Separate decoration layers allow all switches to combine with Shine and color. */
.behold-gallery-curtain, .behold-gallery-vignette, .behold-gallery-outline {
	display: none;
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	box-sizing: border-box;
}
@media (hover: hover) and (pointer: fine) {
	.wp-block-behold-gallery-content[data-hover-vignette="true"] > .behold-gallery-grid__image > .behold-gallery-vignette {
		display: block;
		background: radial-gradient(ellipse at center, transparent 35%, rgb(0 0 0 / 45%) 100%);
		opacity: 0;
		z-index: 1;
	}
	.wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image > .behold-gallery-outline {
		display: block;
		border: 0 solid var(--behold-gallery-outline-color, #ffffffd9);
		inset: var(--behold-gallery-outline-inset, 0px);
		padding: calc(var(--behold-gallery-outline-width, 2px) / 2);
		color: var(--behold-gallery-outline-color, #ffffffd9);
		opacity: 0;
		z-index: 5;
	}
	.wp-block-behold-gallery-content[data-hover-vignette="true"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) > .behold-gallery-vignette,
	.wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) > .behold-gallery-outline { opacity: 1; }
	.wp-block-behold-gallery-content[data-hover-outline="true"] .behold-gallery-expand-icon { z-index: 6; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-effect="parallax"] > .behold-gallery-grid__image img {
		transform: scale(1.2) translate(var(--behold-parallax-x, 0%), var(--behold-parallax-y, 0%));
		transition: transform var(--behold-appearance-duration, 300ms) cubic-bezier(0.25, 0.1, 0.25, 1), filter var(--behold-appearance-duration, 180ms) ease-out;
	}
	.wp-block-behold-gallery-content[data-hover-effect="curtain-reveal"] > .behold-gallery-grid__image > .behold-gallery-curtain {
		display: block;
		overflow: hidden;
		z-index: 1;
	}
	.behold-gallery-curtain > span {
		position: absolute;
		top: 0;
		bottom: 0;
		width: 50%;
		background: rgb(0 0 0 / 30%);
		transition: transform var(--behold-appearance-duration, 420ms) cubic-bezier(0.25, 0.1, 0.25, 1);
	}
	.behold-gallery-curtain > span:first-child { left: 0; transform-origin: left center; }
	.behold-gallery-curtain > span:last-child { right: 0; transform-origin: right center; }
	.wp-block-behold-gallery-content[data-hover-effect="curtain-reveal"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) > .behold-gallery-curtain > span { transform: scaleX(0); }
	.behold-gallery-vignette { transition: opacity var(--behold-appearance-duration, 280ms) ease-out; }
	.wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image > .behold-gallery-outline { box-shadow: none; transition: opacity var(--behold-appearance-duration, 120ms) ease-out; }
	.behold-gallery-outline .behold-gallery-outline-trace { stroke-dasharray: 1; stroke-dashoffset: 1; }
	.wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) > .behold-gallery-outline .behold-gallery-outline-trace { animation: behold-outline-draw var(--behold-appearance-duration, 320ms) cubic-bezier(0.65, 0, 0.35, 1) forwards; }
}


.behold-gallery-outline svg { display: block; width: 100%; height: 100%; overflow: visible; }
.behold-gallery-outline .behold-gallery-outline-line { fill: none; stroke: currentColor; stroke-width: var(--behold-gallery-outline-width, 2px); vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
/* Draw in SVG coordinates inside a mask, keeping the visible stroke a fixed width.
 * Non-scaling strokes otherwise distort normalized dash lengths on stretched SVGs. */
.behold-gallery-outline .behold-gallery-outline-trace { fill: none; stroke: #fff; stroke-width: calc(var(--behold-gallery-outline-width, 2px) * 2); stroke-linecap: round; stroke-linejoin: round; }
@keyframes behold-outline-draw {
 from { stroke-dashoffset: 1; }
 to { stroke-dashoffset: 0; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.wp-block-behold-gallery-content[data-hover-outline-animation="orbit"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) .behold-gallery-outline-trace {
		animation-duration: var(--behold-appearance-duration, 320ms);
	}
	.wp-block-behold-gallery-content[data-hover-outline-animation="light-wave"] .behold-gallery-outline-trace { stroke-dasharray: none; stroke-dashoffset: 0; }
	.wp-block-behold-gallery-content[data-hover-outline-animation="light-wave"] .behold-gallery-outline svg { clip-path: inset(0 50% 0 50%); }
	.wp-block-behold-gallery-content[data-hover-outline-animation="light-wave"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) .behold-gallery-outline-trace { animation: none; }
	.wp-block-behold-gallery-content[data-hover-outline-animation="light-wave"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) > .behold-gallery-outline svg {
		animation: behold-outline-wave var(--behold-appearance-duration, 320ms) cubic-bezier(0.65, 0, 0.35, 1) forwards;
	}
	.wp-block-behold-gallery-content[data-hover-outline-animation="corners"] > .behold-gallery-grid__image:is(:hover, :has(:focus-visible)) .behold-gallery-outline-trace {
		animation-duration: var(--behold-appearance-duration, 320ms);
		animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
	}
}
@keyframes behold-outline-wave {
	0% { clip-path: inset(0 50% 0 50%); }
	100% { clip-path: inset(0); }
}

/* Tap feedback never intercepts links or native scrolling. */
@media (prefers-reduced-motion: no-preference) {
 .wp-block-behold-gallery-content[data-hover-shine="true"] > .behold-gallery-grid__image.behold-gallery-touch-shine::before { animation: var(--behold-shine-animation, behold-gallery-shine) var(--behold-appearance-duration, 300ms) ease-out both; }
 .wp-block-behold-gallery-content[data-hover-color="true"] > .behold-gallery-grid__image.behold-gallery-pressed::after { opacity: 1; }
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image.behold-gallery-pressed > .behold-gallery-outline { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image > .behold-gallery-outline {
  display: block;
  color: var(--behold-gallery-outline-color, #ffffffd9);
  inset: var(--behold-gallery-outline-inset, 0px);
  padding: calc(var(--behold-gallery-outline-width, 2px) / 2);
  opacity: 0;
  z-index: 5;
 }
 .behold-gallery-outline .behold-gallery-outline-trace { stroke-dasharray: none; stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: no-preference) and (hover: none), (prefers-reduced-motion: no-preference) and (pointer: coarse) {
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image > .behold-gallery-outline { transition: opacity var(--behold-appearance-duration, 120ms) ease-out; }
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image.behold-gallery-pressed > .behold-gallery-outline { opacity: 1; }
 .wp-block-behold-gallery-content[data-hover-effect="parallax"] > .behold-gallery-grid__image img { transition: transform var(--behold-appearance-duration, 150ms) ease-out; }
}
/* Touch input on hybrid laptops also uses the tap treatment, without sticky hover. */
@media (prefers-reduced-motion: no-preference) {
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image.behold-gallery-touch-feedback > .behold-gallery-outline {
  display: block;
  color: var(--behold-gallery-outline-color, #ffffffd9);
  inset: var(--behold-gallery-outline-inset, 0px);
  padding: calc(var(--behold-gallery-outline-width, 2px) / 2);
  opacity: 0;
  z-index: 5;
  transition: opacity var(--behold-appearance-duration, 120ms) ease-out;
 }
 .wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image.behold-gallery-touch-feedback.behold-gallery-pressed > .behold-gallery-outline { opacity: 1; }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image.behold-gallery-touch-feedback .behold-gallery-outline-trace { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image.behold-gallery-touch-feedback > .behold-gallery-outline svg { animation: none; clip-path: none; }
}

/* Cover information shares the image frame and never intercepts image actions. */
.wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info {
 position: absolute;
 inset: auto 0 0;
 z-index: 4;
 display: flex;
 flex-direction: column;
 gap: 6px;
 margin: 0;
 padding: 16px;
 max-height: 100%;
 box-sizing: border-box;
 overflow: hidden;
 color: #fff;
 background: linear-gradient(transparent, rgba(0, 0, 0, .75));
 text-align: left;
 pointer-events: none;
 overflow-wrap: anywhere;
 -webkit-backdrop-filter: var(--behold-info-backdrop, none);
 backdrop-filter: var(--behold-info-backdrop, none);
}
.behold-gallery-hover-info > span { display: block; margin: 0; white-space: pre-line; }
@media (hover: hover) and (pointer: fine) {
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info { opacity: 0; }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image:hover > .behold-gallery-hover-info,
 .wp-block-behold-gallery-content:not(:has(> .behold-gallery-grid__image:hover)) > .behold-gallery-grid__image:has(:focus-visible) > .behold-gallery-hover-info { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info { transition: opacity var(--behold-appearance-duration, 180ms) ease-out; }
}

.wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-align="center"] { text-align: center; }
.wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-vertical="top"] {
 inset: 0 0 auto;
 --behold-info-bottom-padding: 32px;
 padding: 16px 16px 32px;
 background: linear-gradient(rgba(0, 0, 0, .75), transparent);
}
.wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-vertical="center"] {
 inset: 50% 0 auto;
 transform: translateY(-50%);
 padding: 16px;
 background: rgba(0, 0, 0, .5);
}

/* Keep slide translation separate from the transform used to center the group. */
@media (hover: hover) and (pointer: fine) {
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-appearance="slide"] {
  --behold-info-slide-x: 0%;
  --behold-info-slide-y: 100%;
  opacity: 1;
  visibility: hidden;
  translate: var(--behold-info-slide-x) var(--behold-info-slide-y);
 }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-appearance="slide"][data-info-vertical="top"] { --behold-info-slide-y: -100%; }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-appearance="slide"][data-info-vertical="center"][data-info-align="left"] {
  --behold-info-slide-x: -100%;
  --behold-info-slide-y: 0%;
 }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image:hover > .behold-gallery-hover-info[data-info-appearance="slide"],
 .wp-block-behold-gallery-content:not(:has(> .behold-gallery-grid__image:hover)) > .behold-gallery-grid__image:has(:focus-visible) > .behold-gallery-hover-info[data-info-appearance="slide"] {
  visibility: visible;
  translate: 0% 0%;
 }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
 .wp-block-behold-gallery-content > .behold-gallery-grid__image > .behold-gallery-hover-info[data-info-appearance="slide"] { transition: translate var(--behold-appearance-duration, 240ms) ease-out, visibility 0s linear var(--behold-appearance-duration, 240ms); }
 .wp-block-behold-gallery-content > .behold-gallery-grid__image:hover > .behold-gallery-hover-info[data-info-appearance="slide"],
 .wp-block-behold-gallery-content:not(:has(> .behold-gallery-grid__image:hover)) > .behold-gallery-grid__image:has(:focus-visible) > .behold-gallery-hover-info[data-info-appearance="slide"] { transition-delay: 0s; }
}

/* Reserve the complete outline width and inset around the Info content. */
.wp-block-behold-gallery-content[data-hover-outline="true"] > .behold-gallery-grid__image > .behold-gallery-hover-info {
 padding-left: calc(16px + var(--behold-gallery-outline-width, 2px) + var(--behold-gallery-outline-inset, 0px));
 padding-right: calc(16px + var(--behold-gallery-outline-width, 2px) + var(--behold-gallery-outline-inset, 0px));
 padding-bottom: calc(var(--behold-info-bottom-padding, 16px) + var(--behold-gallery-outline-width, 2px) + var(--behold-gallery-outline-inset, 0px));
}

