/**
 * Image Mask Assist — front-end styles.
 *
 * @author Divi Assist
 */

.dia-image-mask-assist {
	width: var( --dia-mask-module-width, 100% );
	max-width: var( --dia-mask-module-max-width, 600px );
}
.dia-mask-align-center { margin-left: auto; margin-right: auto; }
.dia-mask-align-right { margin-left: auto; }

/* ----- Wrap + shape ------------------------------------------------------ */
.dia-mask-wrap {
	position: relative;
	width: var( --dia-mask-width, 100% );
	margin: 0 auto;
}

.dia-mask-shape {
	position: relative;
	width: 100%;
	height: var( --dia-mask-height, 420px );
	overflow: hidden;
	transform: rotate( var( --dia-mask-rotate, 0deg ) ) scaleX( calc( var( --dia-mask-scale, 1 ) * var( --dia-flip-x, 1 ) ) ) scaleY( calc( var( --dia-mask-scale, 1 ) * var( --dia-flip-y, 1 ) ) );
	transform-origin: center;
	transition: clip-path var( --dia-mask-transition-duration, 500ms ) var( --dia-mask-transition-easing, ease ), transform var( --dia-hover-duration, 400ms ) ease;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}
.dia-mask-has-aspect .dia-mask-shape { height: auto; aspect-ratio: var( --dia-mask-aspect, 4 / 3 ); }
.dia-mask-flip-h { --dia-flip-x: -1; }
.dia-mask-flip-v { --dia-flip-y: -1; }

/* ----- Image ------------------------------------------------------------- */
/* Absolutely filled so the image covers the whole shape — a percentage height
   can't resolve against an aspect-ratio box, so `inset: 0` is what guarantees a
   full cover with no empty gap. Targeting the shape's img (not just the
   `.dia-mask-image` class) also covers the builder's native image element. */
.dia-mask-image,
.dia-mask-shape img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var( --dia-image-fit, cover );
	object-position: var( --dia-image-position, center );
	opacity: var( --dia-image-opacity, 1 );
	transition: transform var( --dia-hover-duration, 400ms ) ease;
	will-change: transform;
}
.dia-image-mask-assist:hover .dia-mask-image,
.dia-image-mask-assist:hover .dia-mask-shape img {
	transform: scale( var( --dia-image-hover-scale, 1.08 ) ) rotate( var( --dia-image-hover-rotate, 0deg ) );
}
.dia-image-mask-assist:hover .dia-mask-shape {
	transform: rotate( var( --dia-mask-rotate, 0deg ) ) scaleX( calc( var( --dia-mask-scale, 1 ) * var( --dia-mask-hover-scale, 1 ) * var( --dia-flip-x, 1 ) ) ) scaleY( calc( var( --dia-mask-scale, 1 ) * var( --dia-mask-hover-scale, 1 ) * var( --dia-flip-y, 1 ) ) );
}
.dia-mask-image-link { display: block; }

/* ----- Overlay ----------------------------------------------------------- */
.dia-mask-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: rgba( 0, 0, 0, 0.35 );
	opacity: var( --dia-overlay-opacity, 1 );
	mix-blend-mode: var( --dia-overlay-blend, normal );
	transition: background var( --dia-hover-duration, 400ms ) ease;
}
.dia-image-mask-assist:hover .dia-mask-overlay { background: rgba( 0, 0, 0, 0.5 ); }

/* ----- Content box ------------------------------------------------------- */
.dia-mask-content {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: var( --dia-content-align, center );
	justify-content: var( --dia-content-justify, center );
	gap: 10px;
	padding: 24px;
	text-align: var( --dia-content-text-align, center );
	box-sizing: border-box;
	pointer-events: none;
}
/* Content box padding + border radius are the native Content Box Spacing / Border groups. */
.dia-mask-content-box {
	max-width: var( --dia-content-max-width, 100% );
	background: transparent;
	-webkit-backdrop-filter: blur( var( --dia-content-blur, 0px ) );
	backdrop-filter: blur( var( --dia-content-blur, 0px ) );
	pointer-events: auto;
}
.dia-mask-content-box > :last-child { margin-bottom: 0; }
.dia-mask-visibility-hidden .dia-mask-content { display: none; }
.dia-mask-visibility-on-hover .dia-mask-content,
.dia-mask-visibility-on-focus .dia-mask-content { opacity: 0; transition: opacity var( --dia-hover-duration, 400ms ) ease; }
.dia-mask-visibility-on-hover .dia-image-mask-assist:hover .dia-mask-content,
.dia-mask-visibility-on-hover:hover .dia-mask-content,
.dia-mask-visibility-on-focus:hover .dia-mask-content,
.dia-mask-visibility-on-focus:focus-within .dia-mask-content { opacity: 1; }


/* ----- Badge / title / description / button ------------------------------ */
/* Badge text, background, border and padding are the native Badge group;
   title / description colour is the native Title / Description font group.
   These are the unset defaults those groups override. */
.dia-mask-badge {
	display: inline-block;
	align-self: var( --dia-content-align, center );
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #ffffff;
	background: #2563eb;
	border-radius: 4px;
}
.dia-mask-title { margin: 0; color: #ffffff; font-size: 26px; line-height: 1.2; transition: color 0.25s ease; }
.dia-image-mask-assist:hover .dia-mask-title { color: var( --dia-title-hover-color, #ffffff ); }
.dia-mask-description { margin: 0; color: rgba( 255, 255, 255, 0.9 ); font-size: 15px; line-height: 1.6; transition: color 0.25s ease; }
.dia-image-mask-assist:hover .dia-mask-description { color: var( --dia-desc-hover-color, rgba( 255, 255, 255, 0.9 ) ); }
.dia-mask-description :last-child { margin-bottom: 0; }

/* Button is Divi's native button element (Design → Button). */
.dia-mask-content .et_pb_button { margin-top: 4px; }

/* ----- Text mask --------------------------------------------------------- */
.dia-mask-type-text_mask .dia-mask-shape { overflow: visible; height: auto; display: flex; align-items: center; justify-content: center; }
.dia-mask-text {
	font-size: var( --dia-text-mask-size, 120px );
	font-weight: var( --dia-text-mask-weight, 800 );
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: transparent;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect( 1px, 1px, 1px, 1px ); clip-path: inset( 50% ); white-space: nowrap; }

/* ----- Geometric masks (clip-path) --------------------------------------- */
.dia-mask-type-circle .dia-mask-shape { clip-path: circle( 50% ); }
.dia-mask-type-oval .dia-mask-shape { clip-path: ellipse( 48% 38% ); }
.dia-mask-type-rounded_rectangle .dia-mask-shape { border-radius: 24px; }
.dia-mask-type-arch .dia-mask-shape { border-radius: 50% 50% 10px 10px / 42% 42% 10px 10px; }
.dia-mask-type-double_arch .dia-mask-shape { border-radius: 45% 45% 8px 8px / 60% 60% 8px 8px; }
.dia-mask-type-hexagon .dia-mask-shape { clip-path: polygon( 50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25% ); }
.dia-mask-type-diamond .dia-mask-shape { clip-path: polygon( 50% 0%, 100% 50%, 50% 100%, 0% 50% ); }
.dia-mask-type-triangle .dia-mask-shape { clip-path: polygon( 50% 2%, 100% 100%, 0% 100% ); }
.dia-mask-type-parallelogram .dia-mask-shape { clip-path: polygon( 22% 0%, 100% 0%, 78% 100%, 0% 100% ); }
.dia-mask-type-diagonal_cut .dia-mask-shape { clip-path: polygon( 0 0, 100% 0, 100% 82%, 0 100% ); }
.dia-mask-type-corner_cut .dia-mask-shape { clip-path: polygon( 0 0, 82% 0, 100% 18%, 100% 100%, 0 100% ); }
.dia-mask-type-frame_cutout .dia-mask-shape { border: 14px solid #ffffff; border-radius: 6px; box-sizing: border-box; }

/* Ticket (side notches via radial-gradient mask). */
.dia-mask-type-ticket .dia-mask-shape {
	border-radius: 12px;
	-webkit-mask: radial-gradient( circle 18px at 0 50%, transparent 97%, #000 100% ) left / 51% 100% no-repeat, radial-gradient( circle 18px at 100% 50%, transparent 97%, #000 100% ) right / 51% 100% no-repeat;
	mask: radial-gradient( circle 18px at 0 50%, transparent 97%, #000 100% ) left / 51% 100% no-repeat, radial-gradient( circle 18px at 100% 50%, transparent 97%, #000 100% ) right / 51% 100% no-repeat;
}

/* ----- Organic masks (SVG clipPath sprite) ------------------------------- */
.dia-mask-type-blob_1 .dia-mask-shape { clip-path: url( #dia-mask-blob-1 ); }
.dia-mask-type-blob_2 .dia-mask-shape { clip-path: url( #dia-mask-blob-2 ); }
.dia-mask-type-blob_3 .dia-mask-shape { clip-path: url( #dia-mask-blob-3 ); }
.dia-mask-type-organic_1 .dia-mask-shape { clip-path: url( #dia-mask-organic-1 ); }
.dia-mask-type-organic_2 .dia-mask-shape { clip-path: url( #dia-mask-organic-2 ); }
.dia-mask-type-organic_3 .dia-mask-shape { clip-path: url( #dia-mask-organic-3 ); }
.dia-mask-type-wave_top .dia-mask-shape { clip-path: url( #dia-mask-wave-top ); }
.dia-mask-type-wave_bottom .dia-mask-shape { clip-path: url( #dia-mask-wave-bottom ); }
.dia-mask-type-wave_both .dia-mask-shape { clip-path: url( #dia-mask-wave-both ); }
.dia-mask-type-brush_stroke .dia-mask-shape { clip-path: url( #dia-mask-brush ); }
.dia-mask-type-paint_splash .dia-mask-shape { clip-path: url( #dia-mask-paint ); }
.dia-mask-type-torn_paper .dia-mask-shape { clip-path: url( #dia-mask-torn ); }
.dia-mask-type-blob_4 .dia-mask-shape { clip-path: url( #dia-mask-blob-4 ); }
.dia-mask-type-blob_5 .dia-mask-shape { clip-path: url( #dia-mask-blob-5 ); }
.dia-mask-type-splash_2 .dia-mask-shape { clip-path: url( #dia-mask-splash-2 ); }
.dia-mask-type-ink_drop .dia-mask-shape { clip-path: url( #dia-mask-ink-drop ); }
.dia-mask-type-squircle .dia-mask-shape { clip-path: url( #dia-mask-squircle ); }
.dia-mask-type-leaf .dia-mask-shape { clip-path: url( #dia-mask-leaf ); }
.dia-mask-type-petal .dia-mask-shape { clip-path: url( #dia-mask-petal ); }
.dia-mask-type-teardrop .dia-mask-shape { clip-path: url( #dia-mask-teardrop ); }
.dia-mask-type-egg .dia-mask-shape { clip-path: url( #dia-mask-egg ); }
.dia-mask-type-flower .dia-mask-shape { clip-path: url( #dia-mask-flower ); }

/* ----- Modern geometric masks (clip-path polygon) ------------------------ */
.dia-mask-type-pentagon .dia-mask-shape { clip-path: polygon( 50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38% ); }
.dia-mask-type-octagon .dia-mask-shape { clip-path: polygon( 29% 0%, 71% 0%, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0% 71%, 0% 29% ); }
.dia-mask-type-star .dia-mask-shape { clip-path: polygon( 50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35% ); }
.dia-mask-type-starburst .dia-mask-shape { clip-path: polygon( 50% 0%, 60% 25%, 85% 15%, 75% 40%, 100% 50%, 75% 60%, 85% 85%, 60% 75%, 50% 100%, 40% 75%, 15% 85%, 25% 60%, 0% 50%, 25% 40%, 15% 15%, 40% 25% ); }
.dia-mask-type-shield .dia-mask-shape { clip-path: polygon( 0% 0%, 100% 0%, 100% 62%, 50% 100%, 0% 62% ); }
.dia-mask-type-chevron .dia-mask-shape { clip-path: polygon( 0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50% ); }
.dia-mask-type-gem .dia-mask-shape { clip-path: polygon( 25% 0%, 75% 0%, 100% 35%, 50% 100%, 0% 35% ); }
.dia-mask-type-house .dia-mask-shape { clip-path: polygon( 50% 0%, 100% 40%, 100% 100%, 0% 100%, 0% 40% ); }

/* Custom CSS clip-path. */
.dia-mask-has-custom-clip .dia-mask-shape { clip-path: var( --dia-mask-clip, none ); }

/* ----- Mask variations --------------------------------------------------- */
.dia-mask-variation-soft .dia-mask-shape { filter: none; border-radius: 18px; }
.dia-mask-variation-sharp .dia-mask-shape { border-radius: 0; }
.dia-mask-variation-skewed .dia-mask-shape { transform: rotate( var( --dia-mask-rotate, 0deg ) ) skewX( -6deg ) scale( var( --dia-mask-scale, 1 ) ); }
.dia-mask-variation-rounded .dia-mask-shape { border-radius: 40px; }
.dia-mask-variation-inverted .dia-mask-image { transform: scale( 1.02 ); filter: none; }
.dia-mask-variation-asymmetric .dia-mask-shape { border-radius: 60px 12px 60px 12px; }

/* ----- Hover mask morph -------------------------------------------------- */
.dia-mask-hover-morph .dia-mask-shape { transition: clip-path var( --dia-mask-transition-duration, 500ms ) var( --dia-mask-transition-easing, ease ), transform var( --dia-hover-duration, 400ms ) ease; }
.dia-mask-hover-circle:hover .dia-mask-shape { clip-path: circle( 50% ); }
.dia-mask-hover-arch:hover .dia-mask-shape { border-radius: 50% 50% 10px 10px / 42% 42% 10px 10px; clip-path: none; }
.dia-mask-hover-rounded_rectangle:hover .dia-mask-shape { border-radius: 24px; clip-path: none; }
.dia-mask-hover-diagonal_cut:hover .dia-mask-shape { clip-path: polygon( 0 0, 100% 0, 100% 82%, 0 100% ); }
.dia-mask-hover-blob_1:hover .dia-mask-shape { clip-path: url( #dia-mask-blob-1 ); }
.dia-mask-hover-blob_2:hover .dia-mask-shape { clip-path: url( #dia-mask-blob-2 ); }
.dia-mask-hover-organic_1:hover .dia-mask-shape { clip-path: url( #dia-mask-organic-1 ); }

/* Keep the shape below the content box (content is z-index 3). */
.dia-mask-wrap > .dia-mask-shape,
.dia-mask-wrap > .dia-mask-image-link { position: relative; z-index: 2; }

/* ----- Fallback (no clip-path support) ----------------------------------- */
.dia-no-clip-path .dia-mask-shape { clip-path: none !important; border-radius: var( --dia-image-radius, 18px ); }
.dia-no-clip-path .dia-mask-type-circle .dia-mask-shape,
.dia-no-clip-path.dia-mask-type-circle .dia-mask-shape { border-radius: 50%; }

/* ----- Responsive -------------------------------------------------------- */
@media ( max-width: 640px ) {
	.dia-mask-shape { height: var( --dia-mask-height, 320px ); }
	.dia-mask-type-text_mask .dia-mask-text { font-size: calc( var( --dia-text-mask-size, 120px ) * 0.6 ); }
}

/* ----- Reduced motion ---------------------------------------------------- */
@media ( prefers-reduced-motion: reduce ) {
	.dia-mask-reduce-motion .dia-mask-shape,
	.dia-mask-reduce-motion .dia-mask-image,
	.dia-mask-reduce-motion .dia-mask-overlay,
	.dia-mask-reduce-motion .dia-mask-content { transition: none !important; }
	.dia-mask-reduce-motion:hover .dia-mask-image { transform: none; }
}

/* Default heading-level sizes for the title/caption (overridable via the
   Title font group in the Design tab). Applies to whichever h1-h6 tag the
   chosen heading level renders. */
h1.dia-mask-title { font-size: 44px; }
h2.dia-mask-title { font-size: 34px; }
h3.dia-mask-title { font-size: 26px; }
h4.dia-mask-title { font-size: 22px; }
h5.dia-mask-title { font-size: 19px; }
h6.dia-mask-title { font-size: 17px; }
