/* ==========================================================================
   Community OS – members, experts and onboarding
   Builds on communityos.css (tokens, cards, chips); only WoltLab style
   variables plus the space identity color (`--communityos-space-color`).
   ========================================================================== */

.communityosMemberTopic,
.communityosInterestCard {
	--communityos-accent: var(--communityos-space-color, var(--wcfButtonPrimaryBackground));
}

/* --- Directory: filter bar ------------------------------------------------- */
.communityosMemberFilter {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s);
	margin-bottom: var(--communityos-gap-l);
}

.communityosMemberFilter__search {
	flex: 1 1 260px;
	min-width: 0;
	position: relative;
}

.communityosMemberFilter__searchIcon {
	color: var(--wcfInputPlaceholder);
	left: 14px;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.communityosMemberFilter__input {
	background-color: var(--wcfInputBackground);
	border: 1px solid var(--wcfInputBorder);
	border-radius: var(--communityos-radius-pill);
	color: var(--wcfInputText);
	font-size: var(--wcfFontSizeDefault);
	padding: 8px 16px 8px 40px;
	width: 100%;
}

.communityosMemberFilter__input:focus {
	border-color: var(--wcfInputBorderActive);
}

.communityosMemberFilter__community,
.communityosMemberFilter__space {
	flex: 0 1 240px;
	min-width: 0;
}

.communityosMemberTopic__community {
	opacity: 0.8;
}

.communityosMemberFilter__select {
	max-width: 100%;
	width: 100%;
}

.communityosMemberFilter__submit {
	flex: 0 0 auto;
}

.communityosMemberToolbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-m);
	justify-content: space-between;
	margin-bottom: var(--communityos-gap-l);
}

.communityosMemberDirectory__count {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
	margin-bottom: var(--communityos-gap-s);
}

.communityosMemberDirectory__privacy {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
	margin-top: var(--communityos-gap-xl);
}

/* --- Directory: person cards ----------------------------------------------- */
.communityosMemberGrid {
	display: grid;
	gap: var(--communityos-gap-l);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosMemberCard {
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-m);
}

.communityosMemberCard__header {
	align-items: center;
	display: flex;
	gap: var(--communityos-gap-m);
	min-width: 0;
}

.communityosMemberCard__avatar img {
	border-radius: 50%;
	display: block;
}

.communityosMemberCard__identity {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-xs);
	min-width: 0;
}

.communityosMemberCard__name {
	font-size: var(--wcfFontSizeHeadline);
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.communityosMemberCard__empty {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.communityosMemberCard__stats {
	margin-top: auto;
}

.communityosMemberCard__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s);
}

/* Topic chip in the color of its space. */
.communityosMemberTopic {
	background-color: var(--wcfButtonBackground);
	background-color: color-mix(in srgb, var(--communityos-accent) 12%, var(--communityos-card-background));
	border-color: color-mix(in srgb, var(--communityos-accent) 35%, transparent);
	color: var(--wcfContentText);
}

.communityosMemberTopic__icon {
	color: var(--communityos-accent);
	display: inline-flex;
}

.communityosMemberTopic__icon fa-icon {
	color: inherit;
}

a.communityosMemberTopic:hover,
a.communityosMemberTopic:focus-visible {
	border-color: var(--communityos-accent);
	color: var(--wcfContentText);
}

/* Trust level badge, the same scale as on the profile. */
.communityosTrustBadge {
	align-items: center;
	background-color: var(--wcfButtonBackground);
	border: 1px solid transparent;
	border-radius: var(--communityos-radius-pill);
	color: var(--wcfButtonText);
	display: inline-flex;
	font-size: var(--wcfFontSizeSmall);
	gap: var(--communityos-gap-xs);
	line-height: 1.4;
	padding: 1px 8px;
}

.communityosTrustBadge fa-icon {
	color: inherit;
}

.communityosTrustBadge--3 {
	background-color: var(--wcfStatusInfoBackground);
	border-color: var(--wcfStatusInfoBorder);
	color: var(--wcfStatusInfoText);
}

.communityosTrustBadge--4 {
	background-color: var(--wcfStatusSuccessBackground);
	border-color: var(--wcfStatusSuccessBorder);
	color: var(--wcfStatusSuccessText);
}

/* --- "Ask an expert" -------------------------------------------------------- */
.communityosAskExperts {
	align-items: center;
	background-color: var(--communityos-card-background);
	border: 1px dashed var(--communityos-card-border);
	border-radius: var(--communityos-radius);
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-m) var(--communityos-gap-xl);
	justify-content: space-between;
	margin-bottom: var(--communityos-gap-l);
	padding: var(--communityos-gap-m) var(--communityos-gap-l);
}

.communityosAskExperts__text {
	flex: 1 1 220px;
	min-width: 0;
}

.communityosAskExperts__title {
	color: var(--wcfContentHeadlineText);
	font-weight: 600;
}

.communityosAskExperts__description {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.communityosAskExperts__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s) var(--communityos-gap-l);
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosAskExperts__item {
	align-items: center;
	display: flex;
	gap: var(--communityos-gap-s);
	min-width: 0;
}

.communityosAskExperts__item img {
	border-radius: 50%;
}

.communityosAskExperts__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.communityosSpaceExperts__ask {
	flex: 0 0 auto;
}

.communityosSpaceExperts__more {
	margin-top: var(--communityos-gap-m);
}

.communityosTopicSpaces__suggested {
	align-items: center;
	color: var(--wcfContentDimmedText);
	display: inline-flex;
	font-size: var(--wcfFontSizeSmall);
	gap: var(--communityos-gap-s);
	margin-top: var(--communityos-gap-xs);
}

.communityosExpertise__ask {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s) var(--communityos-gap-m);
	margin: var(--communityos-gap-l) 0;
}

.communityosExpertise__askHint {
	color: var(--wcfContentDimmedText);
}

/* --- Welcome bar ------------------------------------------------------------ */
.communityosWelcome {
	align-items: center;
	background-color: var(--communityos-card-background);
	background-image: linear-gradient(
		135deg,
		color-mix(in srgb, var(--wcfButtonPrimaryBackground) 14%, transparent),
		transparent 70%
	);
	border: 1px solid var(--communityos-card-border);
	border-radius: calc(var(--communityos-radius) * 1.5);
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-m) var(--communityos-gap-l);
	margin-bottom: var(--communityos-gap-xl);
	padding: var(--communityos-gap-l) var(--communityos-gap-xl);
}

.communityosWelcome__icon,
.communityosOnboarding__icon {
	align-items: center;
	background-color: var(--wcfButtonBackground);
	background-color: color-mix(in srgb, var(--wcfButtonPrimaryBackground) 16%, transparent);
	border-radius: var(--communityos-radius);
	color: var(--wcfButtonPrimaryBackground);
	display: inline-flex;
	flex: 0 0 auto;
	height: 56px;
	justify-content: center;
	width: 56px;
}

.communityosWelcome__icon fa-icon,
.communityosOnboarding__icon fa-icon {
	color: inherit;
}

.communityosWelcome__text {
	flex: 1 1 260px;
	min-width: 0;
}

.communityosWelcome__title {
	color: var(--wcfContentHeadlineText);
	font-size: var(--wcfFontSizeHeadline);
	font-weight: 600;
}

.communityosWelcome__description {
	color: var(--wcfContentDimmedText);
	margin-top: var(--communityos-gap-xs);
}

.communityosWelcome__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s);
}

/* --- "First steps" checklist ------------------------------------------------ */
.communityosJourney {
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-m);
	margin-bottom: var(--communityos-gap-xl);
}

.communityosJourney__header {
	align-items: flex-start;
	display: flex;
	gap: var(--communityos-gap-m);
	justify-content: space-between;
}

.communityosJourney__title {
	color: var(--wcfContentHeadlineText);
	font-size: var(--wcfFontSizeHeadline);
	font-weight: 600;
}

.communityosJourney__progressText {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.communityosJourney__bar {
	background-color: var(--wcfButtonBackground);
	border-radius: var(--communityos-radius-pill);
	height: 6px;
	overflow: hidden;
}

.communityosJourney__barFill {
	background-color: var(--wcfStatusSuccessText);
	border-radius: inherit;
	display: block;
	height: 100%;
	transition: width var(--communityos-transition);
}

.communityosJourney__steps {
	display: grid;
	gap: var(--communityos-gap-s);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosJourney__step {
	align-items: flex-start;
	border: 1px solid var(--wcfContentBorderInner);
	border-radius: var(--communityos-radius);
	display: flex;
	gap: var(--communityos-gap-s);
	padding: var(--communityos-gap-s) var(--communityos-gap-m);
}

.communityosJourney__check {
	align-items: center;
	background-color: var(--wcfButtonBackground);
	border-radius: 50%;
	color: var(--wcfButtonText);
	display: inline-flex;
	flex: 0 0 auto;
	height: 28px;
	justify-content: center;
	width: 28px;
}

.communityosJourney__check fa-icon {
	color: inherit;
}

.communityosJourney__step--done .communityosJourney__check {
	background-color: var(--wcfStatusSuccessBackground);
	color: var(--wcfStatusSuccessText);
}

.communityosJourney__step--done .communityosJourney__stepTitle {
	color: var(--wcfContentDimmedText);
	text-decoration: line-through;
}

.communityosJourney__stepText {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.communityosJourney__stepTitle {
	font-weight: 600;
}

.communityosJourney__stepDescription {
	color: var(--wcfContentDimmedText);
}

.communityosJourney__counter {
	color: var(--wcfContentDimmedText);
	flex: 0 0 auto;
	font-size: var(--wcfFontSizeSmall);
	font-variant-numeric: tabular-nums;
}

/* --- Onboarding page --------------------------------------------------------- */
.communityosOnboarding {
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-l);
	margin: 0 auto;
	max-width: 960px;
}

.communityosStepper__list {
	counter-reset: none;
	display: flex;
	gap: var(--communityos-gap-s);
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosStepper__item {
	flex: 1 1 0;
	min-width: 0;
}

.communityosStepper__link {
	align-items: center;
	border-bottom: 3px solid var(--wcfContentBorderInner);
	color: var(--wcfContentDimmedText);
	display: flex;
	gap: var(--communityos-gap-s);
	padding: var(--communityos-gap-s) 0;
}

.communityosStepper__link:hover {
	color: var(--wcfContentText);
}

.communityosStepper__number {
	align-items: center;
	background-color: var(--wcfButtonBackground);
	border-radius: 50%;
	color: var(--wcfButtonText);
	display: inline-flex;
	flex: 0 0 auto;
	font-weight: 600;
	height: 28px;
	justify-content: center;
	width: 28px;
}

.communityosStepper__number fa-icon {
	color: inherit;
}

.communityosStepper__label {
	font-weight: 600;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.communityosStepper__item.active .communityosStepper__link {
	border-bottom-color: var(--wcfButtonPrimaryBackground);
	color: var(--wcfContentHeadlineText);
}

.communityosStepper__item.active .communityosStepper__number {
	background-color: var(--wcfButtonPrimaryBackground);
	color: var(--wcfButtonPrimaryText);
}

.communityosStepper__item.done .communityosStepper__link {
	border-bottom-color: var(--wcfStatusSuccessBorder);
}

.communityosStepper__item.done .communityosStepper__number {
	background-color: var(--wcfStatusSuccessBackground);
	color: var(--wcfStatusSuccessText);
}

.communityosOnboarding__panel {
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-l);
	padding: var(--communityos-gap-xl);
}

.communityosOnboarding__header {
	align-items: center;
	display: flex;
	gap: var(--communityos-gap-l);
}

.communityosOnboarding__title {
	color: var(--wcfContentHeadlineText);
	font-size: var(--wcfFontSizeTitle);
	font-weight: 600;
	line-height: 1.25;
}

.communityosOnboarding__text {
	color: var(--wcfContentDimmedText);
	margin-top: var(--communityos-gap-xs);
	max-width: 65ch;
}

.communityosOnboarding__footer {
	align-items: center;
	border-top: 1px solid var(--wcfContentBorderInner);
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s);
	justify-content: space-between;
	padding-top: var(--communityos-gap-l);
}

.communityosOnboarding__navigation {
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-s);
	margin-inline-start: auto;
}

.communityosOnboarding__profileTip {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-m);
	justify-content: space-between;
}

/* Interests: spaces to follow */
.communityosInterestGrid {
	display: grid;
	gap: var(--communityos-gap-m);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosInterestCard {
	align-items: flex-start;
	border-top: 3px solid var(--communityos-accent);
	display: flex;
	flex-wrap: wrap;
	gap: var(--communityos-gap-m);
	padding: var(--communityos-gap-m);
}

.communityosInterestCard__main {
	flex: 1 1 140px;
	min-width: 0;
}

.communityosInterestCard__title {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.communityosInterestCard__description,
.communityosInterestCard__meta {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.communityosInterestCard__description {
	margin-top: 2px;
}

.communityosInterestCard__meta {
	display: inline-flex;
	gap: var(--communityos-gap-xs);
	margin-top: var(--communityos-gap-xs);
}

.communityosInterestCard__follow {
	flex: 0 0 auto;
	margin-inline-start: auto;
}

/* Introduction */
.communityosIntroForm {
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-s);
}

.communityosIntroForm__label {
	font-weight: 600;
}

.communityosIntroForm__input {
	min-height: 120px;
	resize: vertical;
	width: 100%;
}

.communityosIntroForm__hint {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

.communityosIntroForm__actions {
	display: flex;
	justify-content: flex-end;
}

.communityosIntroForm__result {
	border: 1px solid transparent;
	border-radius: var(--wcfBorderRadius);
	padding: var(--communityos-gap-s) var(--communityos-gap-m);
}

.communityosIntroForm__result--success {
	background-color: var(--wcfStatusSuccessBackground);
	border-color: var(--wcfStatusSuccessBorder);
	color: var(--wcfStatusSuccessText);
}

.communityosIntroForm__result--success a {
	color: var(--wcfStatusSuccessLink);
	text-decoration: underline;
}

.communityosIntroForm__result--error {
	background-color: var(--wcfStatusErrorBackground);
	border-color: var(--wcfStatusErrorBorder);
	color: var(--wcfStatusErrorText);
}

/* How it works */
.communityosHowTo {
	display: grid;
	gap: var(--communityos-gap-m);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.communityosHowTo__item {
	border: 1px solid var(--wcfContentBorderInner);
	border-radius: var(--communityos-radius);
	display: flex;
	flex-direction: column;
	gap: var(--communityos-gap-xs);
	padding: var(--communityos-gap-l);
}

.communityosHowTo__icon {
	color: var(--wcfButtonPrimaryBackground);
	margin-bottom: var(--communityos-gap-xs);
}

.communityosHowTo__icon fa-icon {
	color: inherit;
}

.communityosHowTo__title {
	color: var(--wcfContentHeadlineText);
	font-weight: 600;
}

.communityosHowTo__text {
	color: var(--wcfContentDimmedText);
	font-size: var(--wcfFontSizeSmall);
}

/* --- Small screens (375 px) -------------------------------------------------- */
@media (max-width: 544px) {
	.communityosMemberFilter__space,
	.communityosMemberFilter__submit {
		flex: 1 1 100%;
	}

	.communityosMemberToolbar .communityosSegmented {
		max-width: 100%;
	}

	.communityosWelcome {
		padding: var(--communityos-gap-l);
	}

	.communityosWelcome__actions,
	.communityosWelcome__actions .button {
		flex: 1 1 auto;
	}

	.communityosOnboarding__panel {
		padding: var(--communityos-gap-l);
	}

	.communityosOnboarding__header {
		align-items: flex-start;
	}

	.communityosOnboarding__icon {
		height: 44px;
		width: 44px;
	}

	.communityosStepper__label {
		display: none;
	}

	.communityosStepper__item.active .communityosStepper__label {
		display: block;
	}

	.communityosOnboarding__footer {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.communityosOnboarding__navigation {
		margin-inline-start: 0;
	}

	.communityosOnboarding__navigation .button,
	.communityosOnboarding__footer > .button {
		flex: 1 1 auto;
		justify-content: center;
	}

	.communityosAskExperts {
		padding: var(--communityos-gap-m);
	}
}

@media (prefers-reduced-motion: reduce) {
	.communityosJourney__barFill {
		transition: none;
	}
}
