/**
 * SureMembers - Member List shortcode styles.
 *
 * @package suremembers
 * @since x.x.x
 */

.suremembers-member-list {
	margin: 24px 0;
	padding: 0;
	list-style: none;
}

.suremembers-member-list__item {
	margin: 0;
	color: inherit;
	background: rgba( 0, 0, 0, 0.02 ); /* Fallback for browsers without color-mix. */
	background: color-mix( in srgb, currentcolor 4%, transparent );
	border: 1px solid;
	border-color: rgba( 0, 0, 0, 0.12 );
	border-color: color-mix( in srgb, currentcolor 12%, transparent );
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.05 );
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.suremembers-member-list__item:hover {
	box-shadow: 0 6px 16px rgba( 0, 0, 0, 0.1 );
	transform: translateY( -2px );
}

.suremembers-member-list__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.06 ); /* Fallback for browsers without color-mix. */
	background: color-mix( in srgb, currentcolor 8%, transparent );
}

.suremembers-member-list__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

/* Initial badge shown when avatars are disabled. Derives from the theme's
   text colour so it picks up the active theme rather than a fixed brand colour. */
.suremembers-member-list__avatar--initial {
	font-size: 28px;
	font-weight: 600;
	line-height: 1;
	color: inherit;
	background: rgba( 0, 0, 0, 0.08 ); /* Fallback for browsers without color-mix. */
	background: color-mix( in srgb, currentcolor 14%, transparent );
}

.suremembers-member-list__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.suremembers-member-list__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
	word-break: break-word;
}

.suremembers-member-list__meta {
	font-size: 13px;
	line-height: 1.5;
	color: inherit;
	opacity: 0.65;
	word-break: break-word;
}

.suremembers-member-list__email {
	opacity: 0.8;
}

.suremembers-member-list__empty {
	padding: 16px;
	color: inherit;
	opacity: 0.7;
	font-style: italic;
}

/* ---------------------------------------------------------------------------
   Grid layout (default) - centered cards in an auto-fill grid.
--------------------------------------------------------------------------- */
.suremembers-member-list--grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 16px;
}

.suremembers-member-list--grid .suremembers-member-list__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 20px 16px;
	text-align: center;
}

.suremembers-member-list--grid .suremembers-member-list__body {
	align-items: center;
	gap: 4px;
}

/* ---------------------------------------------------------------------------
   List layout - horizontal rows, avatar left, details right.
--------------------------------------------------------------------------- */
.suremembers-member-list--list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.suremembers-member-list--list .suremembers-member-list__item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	text-align: left;
}

.suremembers-member-list--list .suremembers-member-list__avatar {
	width: 56px;
	height: 56px;
}

.suremembers-member-list--list .suremembers-member-list__avatar--initial {
	font-size: 22px;
}

.suremembers-member-list--list .suremembers-member-list__body {
	gap: 2px;
}

/* ---------------------------------------------------------------------------
   Pagination.
--------------------------------------------------------------------------- */
.suremembers-member-list__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: center;
	margin: 20px 0 0;
}

.suremembers-member-list__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	background: transparent;
	border: 1px solid;
	border-color: rgba( 0, 0, 0, 0.15 ); /* Fallback for browsers without color-mix. */
	border-color: color-mix( in srgb, currentcolor 18%, transparent );
	border-radius: 8px;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.suremembers-member-list__pagination a.page-numbers:hover {
	background: rgba( 0, 0, 0, 0.05 );
	background: color-mix( in srgb, currentcolor 8%, transparent );
	border-color: color-mix( in srgb, currentcolor 35%, transparent );
}

.suremembers-member-list__pagination .page-numbers.current {
	font-weight: 600;
	border-color: currentcolor;
	background: rgba( 0, 0, 0, 0.08 );
	background: color-mix( in srgb, currentcolor 12%, transparent );
}

.suremembers-member-list__pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------------------------------------------------------------------------
   Responsive.
--------------------------------------------------------------------------- */
@media ( max-width: 480px ) {
	.suremembers-member-list--grid {
		grid-template-columns: repeat( auto-fill, minmax( 140px, 1fr ) );
		gap: 12px;
	}

	.suremembers-member-list--grid .suremembers-member-list__avatar {
		width: 60px;
		height: 60px;
	}
}
