/*
 * JoinIt Attorney Search — shared "search card" design.
 *
 * Used by the directory filter form ([joinit_member_filters], 4 fields) and
 * the compact location search ([joinit_member_location_search], 2 fields).
 * Everything is namespaced under .joinit-attorney-search so it can be
 * overridden independently of the other plugin stylesheets. Colors mirror
 * the site's attorney-profile template; the Elementor global typography
 * variables fall back to Cinzel / the theme font when unavailable.
 */

.joinit-attorney-search {
	--jas-navy: #0b2d55;
	--jas-teal: #006477;
	--jas-teal-dark: #014a58;
	--jas-ink: #27313b;
	--jas-border: #aeb5b8;
	color: var(--jas-ink);
}

.joinit-attorney-search * {
	box-sizing: border-box;
}

/* The form sits directly on the page — no card background, padding, or box. */
.joinit-search-card {
	background: none;
}

.joinit-search-form {
	display: grid;
	gap: 14px;
	align-items: end;
	justify-content: start;
	margin: 0;
}

/* 200px fields, left-aligned. Directory form: Name / Practice Area / City / ZIP / actions. */
.joinit-search-form--filters {
	grid-template-columns: repeat(4, minmax(0, 200px)) 140px;
}

/* Compact form: ZIP-or-City / Practice Area / actions. */
.joinit-search-form--location {
	grid-template-columns: repeat(2, minmax(0, 200px)) 130px;
}

.joinit-field label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
}

.joinit-field input,
.joinit-field select {
	width: 100%;
	height: 45px;
	padding: 0 13px;
	border: 1px solid var(--jas-border);
	border-radius: 8px;
	background: #fff;
	color: var(--jas-ink);
	font-size: 15px;
	line-height: 1.4;
}

/* Strip native input chrome and override theme/Elementor rules that square off
   the text boxes, so they match the dropdowns' rounded corners. The extra
   wrapper class + !important are needed to beat equal-specificity theme styles. */
.joinit-attorney-search .joinit-field input {
	-webkit-appearance: none;
	appearance: none;
	border-radius: 8px !important;
}

.joinit-field input[type="search"]::-webkit-search-decoration,
.joinit-field input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.joinit-field input:focus,
.joinit-field select:focus {
	outline: none;
	border-color: var(--jas-teal);
	box-shadow: 0 0 0 3px rgba(0, 100, 119, 0.15);
}

/* The actions cell has no label above it, so align-items:end on the form
   lines the button up with the input boxes (not the labels). */
.joinit-search-actions {
	display: grid;
}

.joinit-search-actions button {
	width: 100%;
	height: 45px;
	border: 0;
	border-radius: 8px;
	background: var(--jas-teal);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
}

.joinit-search-actions button:hover {
	background: var(--jas-teal-dark);
}

/* Only the wide 4-field form needs the mid breakpoint; the compact
   location form is already small enough to stay on one row until mobile. */
@media (max-width: 900px) {
	.joinit-search-form--filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.joinit-search-form--filters .joinit-search-actions {
		grid-column: 2;
	}
}

@media (max-width: 640px) {
	.joinit-search-form--filters,
	.joinit-search-form--location {
		grid-template-columns: 1fr;
	}

	.joinit-search-form--filters .joinit-search-actions {
		grid-column: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.joinit-search-actions button {
		transition: none;
	}
}
