/* ==========================================================================
   WP Koumbit Directory — Frontend stylesheet
   ========================================================================== */

/* Wrapper */
.wpk-directory-wrap {
	width: 100%;
}

/* Controls bar (search + filter) */
.wpk-directory-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 20px;
}

/* Search input */
.wpk-dir-search {
	flex: 1 1 240px;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 8px 12px;
	font-size: 1rem;
	line-height: 1.5;
	background: #fff;
	color: #1d2327;
}

.wpk-dir-search:focus {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

/* Category filter buttons */
.wpk-dir-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpk-dir-filter {
	padding: 6px 14px;
	border: 1px solid #2271b1;
	border-radius: 999px;
	background: #fff;
	color: #2271b1;
	font-size: 0.875rem;
	cursor: pointer;
	line-height: 1.4;
}

.wpk-dir-filter:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.wpk-dir-filter--active {
	background: #2271b1;
	color: #fff;
}

/* Grid layout */
.wpk-directory--grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 20px;
}

/* List layout */
.wpk-directory--list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Member card */
.wpk-member-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	gap: 16px;
}

.wpk-member-card--featured {
	box-shadow: 0 2px 12px rgba( 0, 0, 0, .1 );
	border-color: #2271b1;
}

/* Hidden card (JS controlled) */
.wpk-member-hidden {
	display: none !important;
}

/* Photo / initials */
.wpk-member-photo {
	flex: 0 0 80px;
}

.wpk-member-photo img {
	border-radius: 50%;
	width: 80px;
	height: 80px;
	object-fit: cover;
	display: block;
}

.wpk-member-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var( --wpk-member-color, #2271b1 );
	color: #fff;
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1;
	flex-shrink: 0;
}

/* Card body */
.wpk-member-body {
	flex: 1;
	min-width: 0;
}

.wpk-member-name {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 600;
	color: #1d2327;
}

.wpk-member-role {
	margin: 0 0 4px;
	font-size: 0.875rem;
	color: #50575e;
}

.wpk-member-location {
	margin: 0 0 6px;
	font-size: 0.8125rem;
	color: #8c9196;
}

.wpk-member-bio {
	margin: 0 0 8px;
	font-size: 0.875rem;
	color: #50575e;
	overflow-wrap: break-word;
}

/* Social links */
.wpk-member-social {
	display: inline-flex;
	gap: 8px;
	margin: 8px 0 6px;
	padding: 0;
	list-style: none;
}

.wpk-member-social li {
	margin: 0;
}

.wpk-member-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #50575e;
	text-decoration: none;
	width: 28px;
	height: 28px;
	border-radius: 4px;
}

.wpk-member-social a:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Contact links */
.wpk-member-email,
.wpk-member-website {
	display: block;
	font-size: 0.8125rem;
	margin-top: 4px;
	word-break: break-all;
	color: #2271b1;
}

.wpk-member-email:focus-visible,
.wpk-member-website:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Pagination */
.wpk-dir-pagination {
	margin-top: 24px;
	text-align: center;
}

.wpk-dir-load-more {
	padding: 10px 28px;
	font-size: 1rem;
}

/* Empty state */
.wpk-directory-empty {
	color: #50575e;
	padding: 20px 0;
}

/* ==========================================================================
   Hover / focus transitions — respects prefers-reduced-motion
   ========================================================================== */
@media ( prefers-reduced-motion: no-preference ) {
	.wpk-dir-filter {
		transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	}

	.wpk-member-card {
		transition: box-shadow 0.2s ease, border-color 0.2s ease;
	}

	.wpk-member-card:hover {
		box-shadow: 0 2px 12px rgba( 0, 0, 0, .08 );
	}

	.wpk-member-social a {
		transition: color 0.15s ease, background-color 0.15s ease;
	}

	.wpk-member-social a:hover {
		color: #2271b1;
		background: #f0f4fa;
	}

	.wpk-member-visible {
		animation: wpk-fade-in 0.2s ease forwards;
	}

	@keyframes wpk-fade-in {
		from { opacity: 0; transform: translateY( 6px ); }
		to   { opacity: 1; transform: translateY( 0 ); }
	}
}

/* ==========================================================================
   List layout — photo + body side by side
   ========================================================================== */
.wpk-directory--list .wpk-member-card {
	flex-direction: row;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */
@media ( max-width: 600px ) {
	.wpk-directory--list .wpk-member-photo {
		flex: 0 0 56px;
	}

	.wpk-directory--list .wpk-member-photo img,
	.wpk-directory--list .wpk-member-initials {
		width: 56px;
		height: 56px;
		font-size: 1.125rem;
	}

	.wpk-directory-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.wpk-dir-search {
		width: 100%;
	}
}
