/**
 * ThePMA Corporate Directory styles.
 * BEM convention: .thepma-{block}__{element}--{modifier}
 */

/* Filter bar */
.thepma-directory-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin: 0 0 1.5rem;
	padding: 0.75rem 1rem;
	background: #f6f7f9;
	border: 1px solid #e3e5ea;
	border-radius: 8px;
}

.thepma-directory-filters__label {
	font-weight: 600;
	margin: 0;
}

.thepma-directory-filters__input {
	flex: 2 1 240px;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid #c8ccd4;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 16px;
}

.thepma-directory-filters__select {
	flex: 1 1 200px;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid #c8ccd4;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 16px;
}

.thepma-directory-filters__submit {
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: 6px;
	background: #1c4d8f;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
}

.thepma-directory-filters__submit:hover,
.thepma-directory-filters__submit:focus {
	background: #143a6c;
}

.thepma-directory-filters__reset {
	padding: 0.5rem 0.5rem;
	color: #1c4d8f;
	text-decoration: underline;
	font-size: 16px;
}

/* Grid */
.thepma-directory.pmpro_member_directory {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	margin: 0 0 1.5rem;
}

@media (min-width: 600px) {
	.thepma-directory.pmpro_member_directory {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.thepma-directory.pmpro_member_directory {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1200px) {
	.thepma-directory.pmpro_member_directory {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Card */
.thepma-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem;
	background: #fff;
	border: 1px solid #e3e5ea;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.thepma-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.thepma-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1 1 auto;
	height: 100%;
}

/* Logo */
.thepma-card__field--logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 96px;
	padding: 0 0.75rem;
	margin-bottom: 0.25rem;
}

.thepma-card__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.thepma-card__logo img {
	max-width: 100%;
	max-height: 96px;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* Logo linked to member website */
.thepma-card__logo--link {
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.thepma-card__logo--link:hover,
.thepma-card__logo--link:focus {
	opacity: 0.85;
	transform: scale(1.03);
}

.thepma-card__logo--link:focus-visible {
	outline: 2px solid #1c4d8f;
	outline-offset: 3px;
	border-radius: 4px;
}

/* No-logo placeholder that links to the member website */
.thepma-card__logo-placeholder--link {
	text-decoration: none;
	cursor: pointer;
	color: #1c4d8f;
	border-style: solid;
	border-color: #cdd7e6;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.thepma-card__logo-placeholder--link:hover,
.thepma-card__logo-placeholder--link:focus {
	background: #eef3fb;
	border-color: #1c4d8f;
	color: #143a6c;
}

.thepma-card__logo-placeholder--link:focus-visible {
	outline: 2px solid #1c4d8f;
	outline-offset: 3px;
}

.thepma-card__logo-placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 82px;
	background: #f0f2f5;
	border: 1px dashed #c7ccd4;
	border-radius: 8px;
	color: #8a919d;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Title */
.thepma-card__title {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1.125rem;
	line-height: 1.3;
	font-weight: 700;
	color: #1a1a1a;
}

/* Label/value */
.thepma-card__label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b6f76;
}

.thepma-card__data {
	font-size: 0.95rem;
	color: #2c2f36;
	word-wrap: break-word;
}

.thepma-card__field--membership_name .thepma-card__data {
	display: inline-block;
	padding: 0.15rem 0.55rem;
	background: #eef3fb;
	color: #1c4d8f;
	font-weight: 600;
	border-radius: 999px;
	font-size: 0.8rem;
}

.thepma-card__field--business_type .thepma-card__data,
.thepma-card__field--company_type .thepma-card__data,
.thepma-card__field--secondary_company_type .thepma-card__data {
	color: #4b5563;
}

.thepma-card__field--membership_name {
	margin-bottom: 0.25rem;
}

.thepma-card__field--business_type {
	margin-bottom: 0.75rem;
}

/* Link */
.thepma-card__field--company_link {
	margin-top: auto;
	padding-top: 0.75rem;
}

.thepma-card__link {
	display: inline-block;
	padding: 0.5rem 0.9rem;
	background: #1c4d8f;
	color: #fff !important;
	border-radius: 6px;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.6;
	font-weight: 600;
}

.thepma-card__link:hover,
.thepma-card__link:focus {
	background: #143a6c;
}

/* Actions row at bottom of card (View Profile) */
.thepma-card__actions {
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid #eef0f3;
}

.thepma-card__actions a {
	color: #1c4d8f;
	text-decoration: none;
	font-weight: 600;
}

.thepma-card__actions a:hover {
	text-decoration: underline;
}

/* PMPro Member Directory v1.1 default template styling. */
.pmpro_member_directory.pmpro_member_directory-3col {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin: 1.5rem 0;
}

@media (min-width: 700px) {
	.pmpro_member_directory.pmpro_member_directory-3col {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.pmpro_member_directory.pmpro_member_directory-3col {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory-item {
	float: none !important;
	width: auto !important;
	min-height: 300px;
	margin: 0 !important;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	background: #fff;
	border: 1px solid #e3e5ea;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_display-name {
	margin: 0.75rem 0 0.75rem;
	font-size: 1.125rem;
	line-height: 1.3;
	font-weight: 700;
	color: #1a1a1a;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_level {
	order: 2;
	margin: 0 0 0.75rem;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_level strong {
	display: none;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_level {
	display: inline-block;
	padding: 0.15rem 0.6rem;
	background: #eef3fb;
	color: #1c4d8f;
	font-size: 0.8rem;
	font-weight: 600;
	border-radius: 999px;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_name {
	display: none;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_business_type,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_type,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_secondary_company_type {
	margin: 0.25rem 0;
	color: #4b5563;
	font-size: 0.95rem;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_business_type strong,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_type strong,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_secondary_company_type strong {
	display: none;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_logo {
	order: -1;
	min-height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 0.75rem;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_logo strong,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_logo .pmpromd_filename {
	display: none;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_logo img {
	max-width: 100%;
	max-height: 100px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_link {
	margin-top: auto;
	padding-top: 1rem;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_link strong {
	display: none;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_link a {
	display: inline-block;
	padding: 0.5rem 0.9rem;
	background: #1c4d8f;
	color: #fff !important;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
}

.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_link a:hover,
.pmpro_member_directory.pmpro_member_directory-3col .pmpro_member_directory_company_link a:focus {
	background: #143a6c;
}

.pmpro_member_directory_search {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.pmpro_member_directory_search .search-field {
	min-height: 36px;
	padding: 0.35rem 0.6rem;
	border: 1px solid #c8ccd4;
	border-radius: 4px;
}

.pmpro_member_directory_search .search-submit {
	min-height: 36px;
	padding: 0.35rem 0.75rem;
	border: 0;
	border-radius: 4px;
	background: #1c4d8f;
	color: #fff;
}

/* Restored PMA override card spacing. These rules intentionally come last to
   beat the legacy PMPro v1.1 layout styles above. */
.thepma .thepma-directory.pmpro_member_directory {
	gap: 1rem 1.25rem;
	margin: 1rem 0 1.25rem;
}

.thepma .thepma-directory.pmpro_member_directory .thepma-card {
	min-height: 235px;
	padding: 1rem;
	gap: 0.5rem;
}

.thepma .thepma-card__body {
	gap: 0.35rem;
}

.thepma .thepma-card__field--logo {
	height: 82px;
	min-height: 82px;
	padding: 0 0.75rem;
	margin-bottom: 0.15rem;
}

.thepma .thepma-card__logo img {
	max-width: 90%;
	max-height: 82px;
}

.thepma .thepma-card__title {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1rem;
	line-height: 1.25;
}

.thepma .thepma-card__field--membership_name {
	margin: 0.15rem 0 0.2rem;
}

.thepma .thepma-card__field--business_type {
	margin: 0.1rem 0 0.45rem;
}

.thepma .thepma-card__field--company_link {
	margin-top: auto;
	padding-top: 0.35rem;
}

.thepma .thepma-card__link {
	padding: 0.45rem 0.85rem;
}
