/*
 * ERF Member Directory: directory cards, search form, page links and the login form.
 * Matches the live UPME look, from ERF's UPME custom CSS (read from the copy, 2026-11-16):
 * white card header, company name 24px in #106eb5, labels in a 34%-wide uppercase
 * #106eb5 column, round logo. Colours and fonts otherwise come from the theme.
 */

.erfmd-directory,
.erfmd-login,
.erfmd-private,
.erfmd-search-box,
.erfmd-pages,
.erfmd-edit {
	--erfmd-blue: #106eb5; /* ERF's label/heading blue, from the UPME custom CSS */
}

.erfmd-directory {
	margin: 0 0 2em;
}

.erfmd-directory a:focus-visible {
	outline: 2px solid var(--erfmd-blue);
	outline-offset: 2px;
}

.erfmd-card {
	margin: 0 0 30px;
	background-color: #fff;
}

.erfmd-card__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 0 0 20px;
	padding: 30px 20px;
	background-color: #fafafa; /* Keith, 2026-11-17 */
}

/* 200px wide, square corners, height from the logo's own shape (Keith, 2026-11-17). */
.erfmd-card__logo {
	width: 200px;
	max-width: 100%;
	height: auto;
	border-radius: 0;
	flex: 0 0 auto;
}

.erfmd-card__title {
	margin: 0;
	padding-top: 12px;
	font-size: 24px;
	line-height: 1.2; /* live uses 24px; unitless keeps wrapped names readable */
	color: var(--erfmd-blue);
}

.erfmd-card__bio {
	padding: 0 20px 15px;
}

.erfmd-card__fields {
	margin: 0;
	padding: 0 20px 20px;
}

.erfmd-field {
	display: flex;
	flex-wrap: wrap;
	padding: 4px 0;
}

.erfmd-field__label {
	flex: 0 0 34%;
	margin: 0;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--erfmd-blue);
}

.erfmd-field__value {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

.erfmd-hidden-note {
	display: inline-block;
	margin: 0 0 0 0.5em;
	padding: 0 6px;
	border: 1px solid currentColor;
	border-radius: 3px;
	font-size: 0.8em;
	font-style: italic;
}

.erfmd-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

p.erfmd-hidden-note {
	margin: 0;
}

/* Login form ([upme_login], and inside [upme_private] for visitors). */
.erfmd-login .login-username label,
.erfmd-login .login-password label {
	display: block;
	margin-bottom: 4px;
}

.erfmd-login .input {
	width: 100%;
	max-width: 360px;
	border: 1px solid #767676; /* 4.5:1 on white, above the 3:1 needed for field borders */
}

.erfmd-login a:focus-visible,
.erfmd-login input:focus-visible,
.erfmd-logout:focus-visible {
	outline: 2px solid var(--erfmd-blue);
	outline-offset: 2px;
}

.erfmd-login__error {
	padding: 10px 14px;
	border-left: 4px solid #b32d2e;
	background-color: #fcf0f1;
	color: #1e1e1e;
}

/* Logged-in box: own logo, company name, "View my listing" ([upme_login]). */
.erfmd-me {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 0 0 12px;
}

.erfmd-me__logo {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
}

.erfmd-me__name {
	margin: 0;
	font-size: 24px;
	line-height: 1.2;
	color: var(--erfmd-blue);
}

.erfmd-me__links {
	flex-basis: 100%;
	margin: 0;
}

.erfmd-my-listing__actions {
	margin: 0 0 12px;
}

/* Logged-in box: "View my listing", "Go to the Members' Lounge" and "Log out" as buttons
   (Keith, 2026-11-17). Only inside the box: [upme_logout] elsewhere stays a plain link. */
.erfmd-lounge,
.erfmd-login--in .erfmd-login__logout {
	margin: 0 0 12px;
}

.erfmd-login a.erfmd-lounge__button,
.erfmd-login--in a.erfmd-me__view,
.erfmd-login--in a.erfmd-logout {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 5px;
	background: var(--erfmd-blue); /* white on #106eb5: 5.2:1 */
	color: #fff;
	font-size: 15px;
	line-height: 1.4;
	text-decoration: none;
}

.erfmd-login a.erfmd-lounge__button:hover,
.erfmd-login--in a.erfmd-me__view:hover,
.erfmd-login--in a.erfmd-logout:hover {
	background: #0b5288;
	color: #fff;
}

/* "Edit my listing" form. */
.erfmd-notice {
	padding: 10px 14px;
	border-left: 4px solid #00a32a;
	background-color: #edfaef;
	color: #1e1e1e;
}

.erfmd-edit {
	max-width: 720px;
	margin: 0 0 2em;
	padding: 20px;
	background-color: #fff;
}

.erfmd-edit__field,
.erfmd-edit__group {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.erfmd-edit__field > label,
.erfmd-edit__label,
.erfmd-edit__group > legend {
	display: block;
	margin-bottom: 4px;
	padding: 0;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--erfmd-blue);
}

.erfmd-edit__req {
	text-transform: none;
	font-weight: 400;
	color: #50575e;
}

.erfmd-edit input[type="text"],
.erfmd-edit input[type="url"],
.erfmd-edit textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #767676;
}

.erfmd-edit [aria-invalid="true"] {
	border-color: #b32d2e;
}

.erfmd-edit__ticks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 4px 16px;
	max-height: 320px;
	overflow-y: auto;
	padding: 8px;
	border: 1px solid #dcdcde;
}

.erfmd-edit__check {
	display: block;
	min-height: 24px; /* target size */
}

.erfmd-edit__hide {
	margin-top: 6px;
	font-size: 0.9em;
}

.erfmd-edit__logo {
	display: block;
	width: 80px;
	height: 80px;
	margin-bottom: 8px;
	border-radius: 50%;
	object-fit: cover;
}

.erfmd-edit__readonly,
.erfmd-edit__help {
	margin: 0;
}

.erfmd-edit__help {
	font-size: 0.9em;
	color: #50575e;
}

.erfmd-edit__error {
	margin: 0 0 6px;
	font-weight: 600;
	color: #b32d2e;
}

.erfmd-edit__errors {
	margin: 0 0 20px;
	padding: 10px 14px;
	border-left: 4px solid #b32d2e;
	background-color: #fcf0f1;
	color: #1e1e1e;
}

.erfmd-edit a:focus-visible,
.erfmd-edit input:focus-visible,
.erfmd-edit textarea:focus-visible,
.erfmd-edit button:focus-visible {
	outline: 2px solid var(--erfmd-blue);
	outline-offset: 2px;
}

/* Admins: "Edit" on each card, and the wp-admin "ERF Directory" section. */
.erfmd-card__edit {
	margin: 0;
	padding: 0 20px 20px;
}

.erfmd-edit--wp-admin {
	padding: 0;
	background-color: transparent;
}

.erfmd-edit--wp-admin .erfmd-edit__check input {
	margin-right: 0.4em;
}

/* Search form ([upme_search]). */
.erfmd-search-box {
	margin: 0 0 2em;
}

.erfmd-search__title {
	color: var(--erfmd-blue);
}

/* One row of equal-height controls on one baseline. Betheme gives inputs a 20px bottom margin
   and buttons their own height and colours, so those are set here (Keith, 2026-11-17). */
.erfmd-search {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
}

.erfmd-search__field {
	flex: 1 1 200px;
	min-width: 0;
}

.erfmd-search__field--combined {
	flex-basis: 100%;
}

.erfmd-search__field label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
	line-height: 1.3;
}

.erfmd-search input[type="search"],
.erfmd-search input[type="text"],
.erfmd-search select {
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 12px;
	box-sizing: border-box;
	border: 1px solid #767676;
	border-radius: 0;
	background-color: #fff;
	color: #222;
	font-size: 15px;
	line-height: normal;
}

.erfmd-search select {
	padding-right: 32px;
	cursor: pointer;
}

.erfmd-search__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 20px;
}

.erfmd-search .erfmd-search__submit {
	height: 46px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: 5px;
	background: var(--erfmd-blue);
	color: #fff;
	font-size: 15px;
	line-height: 46px;
	cursor: pointer;
}

.erfmd-search .erfmd-search__submit:hover {
	background: #0b5288;
}

.erfmd-search__reset {
	line-height: 46px;
}

.erfmd-search a:focus-visible,
.erfmd-search input:focus-visible,
.erfmd-search button:focus-visible,
.erfmd-pages a:focus-visible {
	outline: 2px solid var(--erfmd-blue);
	outline-offset: 2px;
}

/* Page links with "Showing 1–30 of 218" to their right, above and below the listing. */
.erfmd-results-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 24px;
	margin: 0 0 20px;
}

.erfmd-results-bar--bottom {
	margin: 20px 0 0;
}

.erfmd-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.erfmd-results__count {
	margin: 0;
	color: #444;
}

.erfmd-pages a,
.erfmd-pages__current {
	display: inline-block;
	min-width: 24px; /* target size */
	padding: 6px 10px;
	text-align: center;
}

.erfmd-pages__current {
	font-weight: 600;
	background-color: var(--erfmd-blue);
	color: #fff;
}

/* Narrow screens: label above value. */
@media (max-width: 480px) {
	.erfmd-field__label {
		flex-basis: 100%;
	}
}
