/* Process Step - [uaf_process_step]
   Per-instance values arrive as CSS variables on .uaf-pstep (see process_step_shortcode.php);
   the fallbacks here match the builder defaults. */

.uaf-pstep {
	position: relative;
	/* Room above the card for the half of the number circle that sticks out of its top edge. */
	padding-top: calc(var(--uaf-pstep-num-size, 46px) / 2);
}

/* Equal Height: fill the column so every step in a row lines up (and the conclusion boxes sit
   on one line). Only when the step is the column's sole element - stretching a column that also
   holds other elements would push them. */
.uaf-pstep--equal {
	height: 100%;
}
.col-inner:has(> .uaf-pstep--equal:only-child) {
	height: 100%;
}

.uaf-pstep .uaf-pstep-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: calc(var(--uaf-pstep-num-size, 46px) / 2 + var(--uaf-pstep-padding, 22px) * .6) var(--uaf-pstep-padding, 22px) var(--uaf-pstep-padding, 22px);
	background: var(--uaf-pstep-bg, rgba(255, 255, 255, .6));
	border: 1px solid var(--uaf-pstep-border, #efe7e1);
	/* Large top radius + small bottom radius = the arch shape. If the top corners would overlap,
	   the browser scales all corners down proportionally, so the arch stays round. */
	border-radius: var(--uaf-pstep-radius-top, 120px) var(--uaf-pstep-radius-top, 120px) var(--uaf-pstep-radius-bottom, 16px) var(--uaf-pstep-radius-bottom, 16px);
	text-align: center;
	transition: box-shadow .3s;
}

.uaf-pstep--align-left .uaf-pstep-card {
	align-items: flex-start;
	text-align: left;
}
.uaf-pstep--align-right .uaf-pstep-card {
	align-items: flex-end;
	text-align: right;
}

/* Number circle: centred on the card's top edge, always centred whatever the text alignment. */
.uaf-pstep .uaf-pstep-num {
	position: absolute;
	top: calc(var(--uaf-pstep-num-size, 46px) / -2);
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--uaf-pstep-num-size, 46px);
	height: var(--uaf-pstep-num-size, 46px);
	margin-left: calc(var(--uaf-pstep-num-size, 46px) / -2);
	border-radius: 50%;
	background: var(--uaf-pstep-num-bg, #3f5641);
	color: var(--uaf-pstep-num-color, #fff);
	font-family: inherit;
	font-size: calc(var(--uaf-pstep-num-size, 46px) * .5);
	font-weight: 500;
	line-height: 1;
}

/* Icon circle */
.uaf-pstep .uaf-pstep-icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--uaf-pstep-icon-bg-size, 136px);
	height: var(--uaf-pstep-icon-bg-size, 136px);
	max-width: 100%;
	margin-bottom: 18px;
	border-radius: var(--uaf-pstep-icon-radius, 50%);
	background: var(--uaf-pstep-icon-bg, #e2e5dc);
}

.uaf-pstep .uaf-pstep-icon-img {
	display: block;
	width: var(--uaf-pstep-icon-size, 64px);
	height: var(--uaf-pstep-icon-size, 64px);
	max-width: none;
	object-fit: contain;
}

/* Recolored icon: the uploaded file is used as a mask over a solid color. */
.uaf-pstep .uaf-pstep-icon-img--mask {
	background: var(--uaf-pstep-icon-color, #2b2b2b);
	-webkit-mask: var(--uaf-pstep-icon-mask) center / contain no-repeat;
	mask: var(--uaf-pstep-icon-mask) center / contain no-repeat;
}

/* Title + divider */
.uaf-pstep .uaf-pstep-title {
	/* A centered flex item sizes to its longest word and overflows both sides - cap it at the
	   card width so the wrapping rules below actually apply. */
	max-width: 100%;
	margin: 0 0 12px;
	color: var(--uaf-pstep-title-color, #262626);
	font-size: var(--uaf-pstep-title-size, 19px);
	line-height: 1.3;
	/* Long single words (e.g. "ACCOMPAGNEMENT") in narrow 6-per-row cards: hyphenate using the
	   page language, and break as a last resort rather than spill past the card. */
	-webkit-hyphens: auto;
	hyphens: auto;
	overflow-wrap: break-word;
}
.uaf-pstep--upper .uaf-pstep-title {
	text-transform: uppercase;
	letter-spacing: .02em;
}

.uaf-pstep .uaf-pstep-divider {
	display: block;
	flex: none;
	width: 46px;
	height: 1px;
	margin: 0 0 16px;
	background: var(--uaf-pstep-divider, #c4a59b);
}

/* Text (drop zone - a Flatsome Text element by default) */
.uaf-pstep .uaf-pstep-body {
	width: 100%;
	color: var(--uaf-pstep-text-color, #3d3d3d);
}
.uaf-pstep .uaf-pstep-body > :last-child,
.uaf-pstep .uaf-pstep-body > :last-child > :last-child {
	margin-bottom: 0;
}

/* Conclusion box: pushed to the bottom of the card, so with Equal Height the boxes of a whole
   row sit on one line. */
.uaf-pstep .uaf-pstep-note {
	width: 100%;
	margin-top: auto;
	padding: 10px 14px;
	border-radius: var(--uaf-pstep-note-radius, 6px);
	background: var(--uaf-pstep-note-bg, #e2e5dc);
	color: var(--uaf-pstep-note-color, #2b2b2b);
	line-height: 1.4;
	text-align: center;
}
.uaf-pstep .uaf-pstep-body + .uaf-pstep-note {
	/* margin-top:auto collapses to 0 when the card isn't stretched - keep a gap anyway. */
	border-top: 18px solid transparent;
	background-clip: padding-box;
}

/* ---------------------------------------------------------------------------------------------
   Connector. uaf-process-step.js draws an SVG at the exact gap length (nothing stretched), sets
   the holder's position/length inline and a data-dir on the step - "right", or "down" (the
   holder is rotated 90deg about its start point). Hidden until then, and for the last step /
   the end of a wrapping row. Shapes use currentColor = the Connector Color option.
   ------------------------------------------------------------------------------------------- */
.uaf-pstep .uaf-pstep-conn {
	position: absolute;
	z-index: 2;
	display: none;
	height: 24px;
	margin-top: -12px;
	color: var(--uaf-pstep-conn-color, #3f5641);
	pointer-events: none;
	transform-origin: 0 50%;
}
.uaf-pstep[data-dir] .uaf-pstep-conn {
	display: block;
}
.uaf-pstep[data-dir="down"] .uaf-pstep-conn {
	transform: rotate(90deg);
}
.uaf-pstep .uaf-pstep-conn svg {
	display: block;
	overflow: visible;
}
.uaf-pstep-conn .uaf-pc-anim {
	transform-box: fill-box;
	transform-origin: center;
}

/* Style 1 - graduated dots (growing + brightening toward the head) with a slim rounded arrowhead;
   a soft swell travels along the dots toward the next step. */
.uaf-pstep-conn--dots .uaf-pc-dot {
	animation: uaf-pc-swell 2.8s ease-in-out infinite;
}
@keyframes uaf-pc-swell {
	0%, 60%, 100% { transform: scale(1); }
	30% { transform: scale(1.45); }
}

/* Style 2 - three slim chevrons lighting up in sequence. Resting opacity is set per chevron
   (light to strong) via the --o variable written by the JS. */
.uaf-pstep-conn--chevrons .uaf-pc-chev {
	opacity: var(--o, 1);
	animation: uaf-pc-chev 2.4s ease-in-out infinite;
}
@keyframes uaf-pc-chev {
	0%, 55%, 100% { opacity: var(--o, 1); }
	25% { opacity: 1; }
}

/* Style 3 ("Path") - a fine curved line from a hollow ring to a solid dot with a breathing halo. */
.uaf-pstep-conn--nodes .uaf-pc-halo {
	animation: uaf-pc-halo 3s ease-in-out infinite;
}
@keyframes uaf-pc-halo {
	0%, 100% { transform: scale(.7); opacity: .35; }
	50% { transform: scale(1.25); opacity: .08; }
}

@media (prefers-reduced-motion: reduce) {
	.uaf-pstep-conn .uaf-pc-dot,
	.uaf-pstep-conn .uaf-pc-chev,
	.uaf-pstep-conn .uaf-pc-halo {
		animation: none;
	}
}
