/**
 * Member Directory for User Registration
 *
 * Everything is driven by custom properties so you can restyle per client
 * without touching this file — just override .ur-md variables in the theme.
 */

.ur-md {
	--ur-md-columns: 3;
	--ur-md-gap: 1.5rem;
	--ur-md-card-bg: #fff;
	--ur-md-card-border: #e3e6ea;
	--ur-md-card-radius: 6px;
	--ur-md-card-padding: 1.5rem;
	--ur-md-text-muted: #6b7280;
	--ur-md-accent: currentColor;

	margin-block: 1.5rem;
}

/* Search ---------------------------------------------------------------- */

.ur-md__search {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: var(--ur-md-gap);
}

.ur-md__search-input {
	flex: 1 1 16rem;
	min-width: 0;
}

.ur-md__search-submit {
	flex: 0 0 auto;
}

/* Province filter ------------------------------------------------------- */

.ur-md__search--province {
	align-items: center;
}

.ur-md__province-label {
	flex: 0 0 auto;
	font-weight: 600;
}

.ur-md__province-select {
	flex: 1 1 14rem;
	min-width: 0;
	max-width: 22rem;
}

/* With JS the dropdown submits on change, so the button is redundant. */
.ur-md[data-ur-md-ready] .ur-md__search--province .ur-md__search-submit {
	display: none;
}

/* Grid ------------------------------------------------------------------ */

.ur-md__grid {
	display: grid;
	grid-template-columns: repeat(var(--ur-md-columns), minmax(0, 1fr));
	gap: var(--ur-md-gap);
}

@media (max-width: 900px) {
	.ur-md__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.ur-md__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Card ------------------------------------------------------------------ */

.ur-md__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--ur-md-card-padding);
	background: var(--ur-md-card-bg);
	border: 1px solid var(--ur-md-card-border);
	border-radius: var(--ur-md-card-radius);
	overflow-wrap: anywhere;
}

.ur-md__avatar {
	margin-bottom: 0.875rem;
	line-height: 0;
}

.ur-md__avatar-img {
	width: var(--ur-md-avatar-size, 96px);
	height: var(--ur-md-avatar-size, 96px);
	max-width: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.ur-md__name {
	margin: 0 0 0.5rem;
	font-size: 1.1em;
	line-height: 1.3;
}

.ur-md__name a {
	color: var(--ur-md-accent);
	text-decoration: none;
}

.ur-md__name a:hover,
.ur-md__name a:focus {
	text-decoration: underline;
}

/* Fields ---------------------------------------------------------------- */

.ur-md__fields {
	margin: 0;
	width: 100%;
	font-size: 0.9em;
}

.ur-md__field + .ur-md__field {
	margin-top: 0.5rem;
}

.ur-md__field-label {
	margin: 0;
	font-weight: 600;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ur-md-text-muted);
}

.ur-md__field-value {
	margin: 0;
}

.ur-md__field-value p:last-child {
	margin-bottom: 0;
}

/* Pagination ------------------------------------------------------------ */

.ur-md__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.375rem;
	margin-top: var(--ur-md-gap);
}

.ur-md__pagination .page-numbers {
	display: inline-block;
	padding: 0.4em 0.75em;
	border: 1px solid var(--ur-md-card-border);
	border-radius: 4px;
	text-decoration: none;
	line-height: 1.2;
}

.ur-md__pagination .page-numbers.current {
	font-weight: 700;
	border-color: currentColor;
}

.ur-md__pagination .page-numbers.dots {
	border-color: transparent;
}

/* States ---------------------------------------------------------------- */

.ur-md__empty {
	margin: 0;
	padding: 1.5rem 0;
	color: var(--ur-md-text-muted);
}

.ur-md__results {
	position: relative;
	transition: opacity 150ms ease;
}

.ur-md.is-loading .ur-md__results {
	opacity: 0.45;
	pointer-events: none;
}

.ur-md :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

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

/* Screen-reader helper, in case the theme doesn't provide one ------------ */

.ur-md .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
