/**
 * Chamber Membership — Business Directory front-end styles.
 *
 * Same theme-aware CSS custom property pattern used throughout this
 * plugin, and the same "premium" visual language as events.css:
 * soft layered shadows, generous rounded corners, confident type,
 * restrained motion. Matches events.css/dashboard.css/registration.css.
 */

.chamber-membership-business-directory {
	--chamber-primary: var(--e-global-color-primary, var(--wp--preset--color--primary, var(--wp--preset--color--contrast, #0f4c81)));
	--chamber-primary-soft: color-mix(in srgb, var(--chamber-primary) 12%, transparent);
	--chamber-primary-softer: color-mix(in srgb, var(--chamber-primary) 6%, transparent);
	--chamber-text: var(--wp--preset--color--contrast, #1e1e1e);
	--chamber-background: var(--wp--preset--color--base, #ffffff);
	--chamber-border: #e5e7eb;
	--chamber-muted: #6b7280;
	--chamber-success: #1a7f37;
	--chamber-warning: #9a6700;
	--chamber-danger: #b32d2e;
	--chamber-radius-sm: 8px;
	--chamber-radius: 14px;
	--chamber-radius-pill: 999px;
	--chamber-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
	--chamber-shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 12px 24px -6px rgba(15, 23, 42, 0.12);
	--chamber-shadow-lg: 0 8px 16px rgba(15, 23, 42, 0.06), 0 24px 48px -12px rgba(15, 23, 42, 0.18);
	--chamber-ease: cubic-bezier(0.16, 1, 0.3, 1);

	color: var(--chamber-text);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

.chamber-membership-business-directory h1,
.chamber-membership-business-directory h2,
.chamber-membership-business-directory h3 {
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.chamber-membership-business-directory h2 {
	font-size: 1.5rem;
	margin: 0 0 16px;
}

.chamber-membership-business-directory a {
	color: var(--chamber-primary);
}

.chamber-membership-business-directory a:focus-visible,
.chamber-membership-business-directory button:focus-visible,
.chamber-membership-business-directory input:focus-visible,
.chamber-membership-business-directory select:focus-visible,
.chamber-membership-business-directory textarea:focus-visible {
	outline: 2px solid var(--chamber-primary);
	outline-offset: 2px;
	border-radius: var(--chamber-radius-sm);
}

/*
 * Button system — matches events.css exactly (shared design language
 * across every public page this plugin renders). Covers the
 * directory's search/filter buttons and the Add Listing form's
 * submit button.
 */
.chamber-membership-business-directory .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--chamber-background);
	color: var(--chamber-text);
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-sm);
	padding: 11px 22px;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s var(--chamber-ease), border-color 0.2s var(--chamber-ease),
		filter 0.2s var(--chamber-ease), transform 0.15s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease);
}

.chamber-membership-business-directory .button:hover {
	background: var(--chamber-primary-softer);
	border-color: var(--chamber-primary);
	color: var(--chamber-text);
	transform: translateY(-1px);
}

.chamber-membership-business-directory .button:active {
	transform: translateY(0);
}

.chamber-membership-business-directory .button.button-primary {
	background: var(--chamber-primary);
	border-color: var(--chamber-primary);
	color: #ffffff !important;
	box-shadow: var(--chamber-shadow-sm);
}

.chamber-membership-business-directory .button.button-primary:hover {
	filter: brightness(0.92);
	color: #ffffff !important;
	box-shadow: var(--chamber-shadow-md);
	transform: translateY(-1px);
}

.chamber-membership-business-directory .button:disabled,
.chamber-membership-business-directory .button[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Page header — centered */
.cm-directory-header {
	text-align: center;
	max-width: 620px;
	margin: 0 auto 32px;
}

.chamber-membership-business-directory h1 {
	font-size: 2.1rem;
}

.cm-directory-subtitle {
	color: var(--chamber-muted);
	font-size: 1.05rem;
	margin: 0;
}

.cm-directory-category-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.cm-directory-category-pills a {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-pill);
	text-decoration: none;
	color: var(--chamber-text);
	font-size: 0.9rem;
	font-weight: 600;
	transition: border-color 0.2s var(--chamber-ease), color 0.2s var(--chamber-ease), background-color 0.2s var(--chamber-ease);
}

.cm-directory-category-pills a.is-active,
.cm-directory-category-pills a:hover {
	border-color: var(--chamber-primary);
	background: var(--chamber-primary-softer);
	color: var(--chamber-primary);
}

.cm-directory-search-input-wrap {
	position: relative;
}

.cm-directory-search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1rem;
	opacity: 0.5;
	pointer-events: none;
}

.cm-directory-search-form {
	margin: 0 0 20px;
	padding: 20px;
	background: var(--chamber-background);
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius);
	box-shadow: var(--chamber-shadow-sm);
}

.cm-directory-search-input {
	width: 100%;
	padding: 14px 18px 14px 44px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-sm);
	background: var(--chamber-background);
	color: var(--chamber-text);
	font-size: 1.05rem;
	margin-bottom: 14px;
	transition: border-color 0.2s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease);
}

.cm-directory-search-input:focus {
	border-color: var(--chamber-primary);
	box-shadow: 0 0 0 3px var(--chamber-primary-soft);
	outline: none;
}

.cm-directory-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.cm-directory-search-form input[type="search"],
.cm-directory-search-form input[type="text"],
.cm-directory-search-form select {
	padding: 11px 14px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-sm);
	background: var(--chamber-background);
	color: var(--chamber-text);
	font-size: 0.95rem;
	transition: border-color 0.2s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease);
}

.cm-directory-search-form input:focus,
.cm-directory-search-form select:focus {
	border-color: var(--chamber-primary);
	box-shadow: 0 0 0 3px var(--chamber-primary-soft);
	outline: none;
}

.cm-directory-filter-row input[type="text"] {
	flex: 1 1 140px;
}

.cm-directory-filter-row select {
	flex: 1 1 160px;
}

.cm-directory-clear-filters {
	font-size: 0.9rem;
	font-weight: 600;
}

.cm-directory-result-count {
	color: var(--chamber-muted);
	font-size: 0.9rem;
	font-weight: 600;
	margin: 0 0 16px;
}

.cm-directory-empty {
	color: var(--chamber-muted);
	text-align: center;
	padding: 48px 24px;
	background: var(--chamber-primary-softer);
	border-radius: var(--chamber-radius);
}

.cm-directory-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 24px;
	margin: 16px 0 32px;
}

/* Business card */
.cm-business-card {
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius);
	background: var(--chamber-background);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: var(--chamber-shadow-sm);
	transition: box-shadow 0.3s var(--chamber-ease), transform 0.3s var(--chamber-ease), border-color 0.3s var(--chamber-ease);
}

.cm-business-card:hover {
	box-shadow: var(--chamber-shadow-lg);
	transform: translateY(-4px);
	border-color: transparent;
}

.cm-business-card-image-wrap {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.cm-business-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s var(--chamber-ease);
}

.cm-business-card:hover .cm-business-card-image {
	transform: scale(1.06);
}

.cm-business-card-logo-wrap {
	padding: 20px 20px 0;
}

.cm-business-card-logo {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--chamber-radius-sm);
	display: block;
	box-shadow: var(--chamber-shadow-sm);
}

.cm-business-card-heading {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.cm-business-card-logo-badge {
	flex-shrink: 0;
	margin-top: -44px;
	border-radius: var(--chamber-radius-sm);
	overflow: hidden;
	box-shadow: var(--chamber-shadow-md);
	border: 3px solid var(--chamber-background);
	background: var(--chamber-background);
}

.cm-business-card-logo-badge .cm-business-card-logo {
	width: 48px;
	height: 48px;
	box-shadow: none;
	border-radius: 0;
}

.cm-business-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.cm-business-card-category {
	display: inline-flex;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: var(--chamber-radius-pill);
	background: var(--chamber-primary-soft);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--chamber-primary);
}

.cm-business-card-title {
	margin: 2px 0 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--chamber-text);
}

.cm-business-card-location {
	margin: 0;
	font-size: 0.9rem;
	color: var(--chamber-muted);
}

.cm-business-card-excerpt {
	margin: 2px 0 0;
	font-size: 0.92rem;
	color: var(--chamber-muted);
}

.cm-business-card-cta {
	margin-top: 14px;
	align-self: flex-start;
	padding: 10px 20px;
	border-radius: var(--chamber-radius-sm);
	background: var(--chamber-primary);
	color: #ffffff !important;
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none !important;
	display: inline-block;
	box-shadow: var(--chamber-shadow-sm);
	transition: filter 0.2s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease), transform 0.15s var(--chamber-ease);
}

.cm-business-card-cta:hover {
	filter: brightness(0.92);
	color: #ffffff !important;
	box-shadow: var(--chamber-shadow-md);
	transform: translateY(-1px);
}

.cm-directory-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin: 36px 0 8px;
}

.cm-directory-page-link {
	font-weight: 600;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: var(--chamber-radius-sm);
	transition: background-color 0.2s var(--chamber-ease);
}

.cm-directory-page-link:hover {
	background: var(--chamber-primary-softer);
}

.cm-directory-page-status {
	color: var(--chamber-muted);
	font-size: 0.9rem;
	font-weight: 600;
}

/* Business profile */
.cm-business-profile-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 20px;
	padding: 8px 16px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-pill);
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	transition: border-color 0.2s var(--chamber-ease), background-color 0.2s var(--chamber-ease);
}

.cm-business-profile-back:hover {
	border-color: var(--chamber-primary);
	background: var(--chamber-primary-softer);
}

.cm-business-profile-header {
	display: flex;
	gap: 20px;
	align-items: center;
	margin: 24px 0 28px;
	padding: 24px;
	background: var(--chamber-primary-softer);
	border-radius: var(--chamber-radius);
}

.cm-business-profile-logo {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: var(--chamber-radius);
	box-shadow: var(--chamber-shadow-md);
	flex-shrink: 0;
	background: var(--chamber-background);
}

.cm-business-profile-header h1 {
	margin: 6px 0 4px;
}

.cm-business-profile-image {
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: 420px;
	object-fit: cover;
	border-radius: var(--chamber-radius);
	margin-bottom: 24px;
	box-shadow: var(--chamber-shadow-md);
}

.cm-business-profile-location {
	margin: 4px 0 0;
	color: var(--chamber-muted);
}

.cm-business-profile-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.cm-business-quick-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: var(--chamber-radius-pill);
	background: var(--chamber-background);
	border: 1px solid var(--chamber-border);
	color: var(--chamber-text);
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
	box-shadow: var(--chamber-shadow-sm);
	transition: border-color 0.2s var(--chamber-ease), transform 0.15s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease);
}

.cm-business-quick-action:hover {
	border-color: var(--chamber-primary);
	color: var(--chamber-primary);
	box-shadow: var(--chamber-shadow-md);
	transform: translateY(-1px);
}

.cm-business-profile-short-description {
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.5;
}

.cm-business-profile-description {
	margin: 24px 0;
	font-size: 1.02rem;
}

.cm-business-profile-services {
	color: var(--chamber-text);
	line-height: 1.7;
}

.cm-business-profile-section {
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid var(--chamber-border);
}

.cm-business-profile-contact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.cm-business-contact-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-sm);
	background: var(--chamber-background);
}

.cm-business-contact-icon {
	font-size: 1.2rem;
	line-height: 1;
	flex-shrink: 0;
}

.cm-business-contact-label {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--chamber-muted);
	margin-bottom: 2px;
}

.cm-business-contact-value {
	display: block;
	font-weight: 600;
	color: var(--chamber-text);
	text-decoration: none;
	word-break: break-word;
}

a.cm-business-contact-value:hover {
	color: var(--chamber-primary);
}

.cm-business-profile-social-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cm-business-profile-social-list li a {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-pill);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	transition: border-color 0.2s var(--chamber-ease), background-color 0.2s var(--chamber-ease), color 0.2s var(--chamber-ease);
}

.cm-business-profile-social-list li a:hover {
	border-color: var(--chamber-primary);
	background: var(--chamber-primary-softer);
}

/* Add Listing form */
.cm-business-add-listing-form {
	max-width: 560px;
}

.cm-business-add-listing-form p {
	margin: 0 0 18px;
}

.cm-business-add-listing-form label {
	font-weight: 600;
	display: block;
	margin-bottom: 6px;
	font-size: 0.92rem;
}

.cm-business-add-listing-form input[type="text"],
.cm-business-add-listing-form input[type="email"],
.cm-business-add-listing-form input[type="url"],
.cm-business-add-listing-form select,
.cm-business-add-listing-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius-sm);
	background: var(--chamber-background);
	color: var(--chamber-text);
	font-size: 0.95rem;
	font-family: inherit;
	transition: border-color 0.2s var(--chamber-ease), box-shadow 0.2s var(--chamber-ease);
}

.cm-business-add-listing-form input:focus,
.cm-business-add-listing-form select:focus,
.cm-business-add-listing-form textarea:focus {
	border-color: var(--chamber-primary);
	box-shadow: 0 0 0 3px var(--chamber-primary-soft);
	outline: none;
}

.cm-business-add-listing-form h2 {
	margin-bottom: 6px;
}

.cm-business-add-listing-form h3 {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--chamber-border);
	font-size: 1.05rem;
}

.cm-business-form-submit {
	margin-top: 12px;
}

.cm-business-form-errors {
	margin: 0 0 20px;
	padding: 14px 18px;
	border: 1px solid var(--chamber-danger);
	border-radius: var(--chamber-radius-sm);
	background: color-mix(in srgb, var(--chamber-danger) 6%, var(--chamber-background));
	color: var(--chamber-danger);
}

.cm-business-form-errors p {
	margin: 0;
	font-weight: 600;
}

.cm-business-form-success,
.cm-business-form-blocked {
	padding: 24px;
	border: 1px solid var(--chamber-border);
	border-radius: var(--chamber-radius);
	background: var(--chamber-primary-softer);
	box-shadow: var(--chamber-shadow-sm);
}

.cm-business-form-success h2,
.cm-business-form-blocked h2 {
	margin-top: 0;
}
