/**
 * Anyfor role avatar rings.
 *
 * Identity is shown on a real brush-stroke asset across the lower portrait,
 * matching the approved reference while keeping the portrait itself circular.
 */

.anyfor-role-avatar {
	--anyfor-avatar-ring: #f4b400;
	--anyfor-avatar-label: #fff;
	position: relative !important;
	display: block !important;
	box-sizing: border-box !important;
	width: var(--anyfor-avatar-original-width, 100%) !important;
	height: auto !important;
	min-width: 44px !important;
	min-height: 44px !important;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	margin-inline: auto;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	overflow: visible !important;
	isolation: isolate;
	container-type: inline-size;
	flex: 0 0 auto;
}

.anyfor-role-avatar--freelancer {
	--anyfor-avatar-ring: #f4b400;
}

.anyfor-role-avatar--employer {
	--anyfor-avatar-ring: #b5267a;
}

.anyfor-role-avatar[class*="anyfor-role-avatar--"]::before {
	content: '';
	position: absolute;
	z-index: 2;
	inset: 3%;
	display: block;
	background: var(--anyfor-avatar-ring) !important;
	-webkit-mask-image: url('../images/avatar-brush-mask.svg') !important;
	mask-image: url('../images/avatar-brush-mask.svg') !important;
	-webkit-mask-mode: alpha !important;
	mask-mode: alpha !important;
	-webkit-mask-repeat: no-repeat !important;
	mask-repeat: no-repeat !important;
	-webkit-mask-position: center bottom !important;
	mask-position: center bottom !important;
	-webkit-mask-size: 100% 50% !important;
	mask-size: 100% 50% !important;
	opacity: 1 !important;
	animation: none !important;
	transition: none !important;
	transform: none !important;
	pointer-events: none;
}

.anyfor-role-avatar > img.anyfor-role-avatar__image {
	position: absolute !important;
	z-index: 1;
	top: 3% !important;
	right: auto !important;
	bottom: auto !important;
	left: 3% !important;
	display: block !important;
	box-sizing: border-box !important;
	width: 94% !important;
	height: 94% !important;
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	object-position: center !important;
	box-shadow:
		0 0 0 max(1px, 1cqi) rgba(255, 255, 255, 0.98),
		0 max(1px, 1.5cqi) max(3px, 5cqi) rgba(15, 23, 42, 0.18);
}

.anyfor-role-avatar__label {
	position: absolute;
	z-index: 3;
	inset: 0;
	display: block;
	color: var(--anyfor-avatar-label);
	font-family: inherit;
	font-size: clamp(5px, 8cqi, 14px);
	font-weight: 700;
	font-style: normal;
	line-height: 1;
	letter-spacing: -0.01em;
	text-transform: none;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
	pointer-events: none;
}

.anyfor-role-avatar__label-char {
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	width: 1ch;
	height: 1em;
	margin: 0;
	padding: 0;
	text-align: center;
	transform: translate(-50%, -50%) rotate(var(--anyfor-avatar-char-angle)) translateY(41cqi);
	transform-origin: 50% 50%;
}

/* Keep Workreap's online/offline indicator above the new ring. */
.anyfor-role-avatar > .wr-usertag,
.anyfor-role-avatar > .wr-user-tag,
.anyfor-role-avatar > figcaption[class*="wr-user"] {
	z-index: 4 !important;
	top: 13% !important;
	right: 5% !important;
	left: auto !important;
}

/* Inline images that did not originally have a figure receive a neutral frame. */
span.anyfor-role-avatar {
	display: inline-block !important;
	width: var(--anyfor-avatar-original-width, auto) !important;
	vertical-align: middle;
}

/* Homepage account avatar: compact 40px role portrait in the main header. */
body.home #profile-avatar-menue-icon > .anyfor-role-avatar {
	--anyfor-avatar-original-width: 40px !important;
	display: block !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
	min-height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	margin: 0 !important;
}

/*
 * Service detail sidebar.
 *
 * Workreap gives this portrait link the full sidebar width (about 344px) and
 * a fixed 250px height. Once the role frame makes the portrait square, that
 * combination creates a 344px circle which spills over the author details.
 * Keep the identity treatment, but use a deliberate profile-avatar scale and
 * let the surrounding author block resume its normal document flow.
 */
body.single-product .wr-topservicetask__content .wr-freeprostatus .wr-asideprostatus > a {
	display: flex !important;
	width: 100% !important;
	height: 160px !important;
	align-items: center !important;
	justify-content: center !important;
}

body.single-product .wr-topservicetask__content .wr-freeprostatus .wr-asideprostatus .anyfor-role-avatar {
	--anyfor-avatar-original-width: 160px !important;
	display: block !important;
	width: 160px !important;
	height: 160px !important;
	min-width: 160px !important;
	min-height: 160px !important;
	max-width: 160px !important;
	max-height: 160px !important;
	margin: 0 auto !important;
}

@media (max-width: 767px) {
	body.single-product .wr-topservicetask__content .wr-freeprostatus .wr-asideprostatus > a {
		height: 132px !important;
	}

	body.single-product .wr-topservicetask__content .wr-freeprostatus .wr-asideprostatus .anyfor-role-avatar {
		--anyfor-avatar-original-width: 132px !important;
		width: 132px !important;
		height: 132px !important;
		min-width: 132px !important;
		min-height: 132px !important;
		max-width: 132px !important;
		max-height: 132px !important;
	}
}

/* Dashboard/header avatars have explicit sizes supplied by Workreap. */
/* Never alter the approved large portraits in the Hand Picked Talent section. */
.elementor-element-f7dc1ca .anyfor-role-avatar,
[data-id="f7dc1ca"] .anyfor-role-avatar {
	background: transparent !important;
}

.elementor-element-f7dc1ca .anyfor-role-avatar::before,
[data-id="f7dc1ca"] .anyfor-role-avatar::before {
	display: none !important;
}

/*
 * Workreap renders a second copy of the user's portrait inside the sidebar
 * collapse button. That control is navigation, not identity, so show the
 * WordPress Site Icon there and leave the real profile portrait below intact.
 */
.wr-dashboard-sidebar-toggle-btn {
	position: relative;
}

.wr-dashboard-sidebar-toggle-btn > img.anyfor-dashboard-favicon {
	display: block !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	margin: 0 !important;
	padding: 2px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	object-fit: contain !important;
	object-position: center !important;
	box-shadow: none !important;
}

.wr-dashboard-sidebar-toggle-btn > img.anyfor-dashboard-favicon + .wr-icon-layout {
	position: absolute;
	right: -4px;
	bottom: -4px;
	display: inline-flex;
	width: 17px;
	height: 17px;
	align-items: center;
	justify-content: center;
	border: 1px solid #d9dee7;
	border-radius: 5px;
	background: #fff;
	color: #2d3340;
	font-size: 10px;
	line-height: 1;
}

@supports not (font-size: 1cqi) {
	.anyfor-role-avatar__label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.anyfor-role-avatar,
	.anyfor-role-avatar__label,
	.anyfor-role-avatar__label-char,
	.anyfor-role-avatar > img.anyfor-role-avatar__image {
		transition: none !important;
	}
}
