/* Elegant Icon Box - [uaf_elegant_icon_box]
   Per-instance values arrive as CSS variables on .uaf-eib (see elegant_icon_box_shortcode.php),
   the fallbacks here match the builder defaults. */

.uaf-eib {
	position: relative;
}

/* Equal Height: fill the column so every box in a row lines up. Only when the box is the
   column's sole element - stretching a column that also holds other elements would push them. */
.uaf-eib--equal {
	height: 100%;
}
.col-inner:has(> .uaf-eib--equal:only-child) {
	height: 100%;
}

.uaf-eib .uaf-eib-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--uaf-eib-bg, #fbf6f3);
	border-radius: var(--uaf-eib-radius, 10px);
	transition: transform .3s, box-shadow .3s;
}

.uaf-eib--lift .uaf-eib-card:hover {
	transform: translateY(-6px);
}

/* Photo */
.uaf-eib .uaf-eib-media {
	display: block;
	flex: none;
	height: 200px;
	overflow: hidden;
}

.uaf-eib .uaf-eib-media .uaf-eib-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--uaf-eib-img-pos, center center);
	transition: transform .6s ease;
}

.uaf-eib--zoom .uaf-eib-card:hover .uaf-eib-img {
	transform: scale(1.06);
}

/* Icon badge: pulled up by half its size so it sits across the photo's bottom edge. */
.uaf-eib .uaf-eib-badge {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: var(--uaf-eib-circle, 64px);
	height: var(--uaf-eib-circle, 64px);
	margin-top: calc(var(--uaf-eib-circle, 64px) / -2);
	align-self: center;
	border-radius: 50%;
	background: var(--uaf-eib-accent, #7b3062);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.uaf-eib--ring .uaf-eib-badge {
	box-shadow: 0 0 0 var(--uaf-eib-ring-width, 3px) var(--uaf-eib-ring-color, #fff), 0 4px 12px rgba(0, 0, 0, .15);
}

.uaf-eib--align-left .uaf-eib-badge {
	align-self: flex-start;
	margin-left: var(--uaf-eib-padding, 24px);
}

.uaf-eib--align-right .uaf-eib-badge {
	align-self: flex-end;
	margin-right: var(--uaf-eib-padding, 24px);
}

.uaf-eib .uaf-eib-icon {
	display: block;
	width: var(--uaf-eib-icon, 32px);
	height: var(--uaf-eib-icon, 32px);
	max-width: none;
	margin: 0;
	object-fit: contain;
}

/* Icon Color: the uploaded file is used as a mask and filled with a flat color. */
.uaf-eib .uaf-eib-icon--mask {
	background-color: var(--uaf-eib-icon-color, #fff);
	-webkit-mask: var(--uaf-eib-icon-mask) center / contain no-repeat;
	mask: var(--uaf-eib-icon-mask) center / contain no-repeat;
}

/* Text */
.uaf-eib .uaf-eib-body {
	flex: 1 1 auto;
	padding: 14px var(--uaf-eib-padding, 24px) var(--uaf-eib-padding, 24px);
}

.uaf-eib--align-center .uaf-eib-body { text-align: center; }
.uaf-eib--align-left .uaf-eib-body   { text-align: left; }
.uaf-eib--align-right .uaf-eib-body  { text-align: right; }

/* Content colors. Element + two classes on purpose: beats Flatsome's .dark h3 / .dark p (one
   class + one tag), so content stays readable on the light card inside a Dark column. A color set
   on a Text element inside still wins, since Flatsome applies it with an #id selector. */
.uaf-eib .uaf-eib-body,
.uaf-eib .uaf-eib-body :is(p, li, td, label) {
	color: var(--uaf-eib-content-color, #4a4a4a);
}

.uaf-eib .uaf-eib-body :is(h1, h2, h3, h4, h5, h6) {
	color: var(--uaf-eib-heading-color, #4a1f3d);
}

.uaf-eib .uaf-eib-body > :last-child {
	margin-bottom: 0;
}

/* Buttons at Bottom (Equal Height only): the content area becomes a column and the trailing
   button group (.uaf-eib-actions, wrapped server-side) takes the leftover space above it, so
   every card's buttons sit on the same line. Side-by-side buttons stay side by side inside the
   group, and keep following the box's Text Align. */
.uaf-eib--btn-bottom .uaf-eib-body {
	display: flex;
	flex-direction: column;
}

.uaf-eib--btn-bottom .uaf-eib-actions {
	margin-top: auto;
}
