/**
 * Coveto Search — baseline styles.
 * Override in your theme or via Elementor widget controls.
 *
 * Mobile-first: card content stacks vertically on small screens,
 * switches to horizontal (content ↔ details button) at >= 600px.
 *
 * @package CovetoIntegration
 * @since   1.0.3
 */

.coveto-search-box {
	padding: 2rem;
	border-radius: 0.5rem;
	color: #fff;
}

.coveto-search-box h2 {
	margin: 0 0 1rem;
	text-align: center;
}

.coveto-keyword-wrap {
	position: relative;
	margin-bottom: 0.75rem;
}

.coveto-keyword-input-field,
.coveto-category-dropdown {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid #ccc;
	border-radius: 0.25rem;
	background: #fff;
	color: #15385b;
	font-size: 1rem;
	line-height: 1.25;
	box-sizing: border-box;
}

/* <select> specifically: browsers apply different baseline rules than <input>.
   Force consistent vertical alignment and remove any inherited line-height
   from the parent theme (Blocksy in this case). */
.coveto-category-dropdown {
	line-height: 1.25;
	vertical-align: middle;
}

/* High-specificity override — wins against Blocksy/Elementor form resets.
   Use the widget wrapper class AND the element class to boost specificity
   without resorting to !important. */
.coveto-search-box .coveto-keyword-input-field,
.coveto-search-box .coveto-category-dropdown,
.coveto-widget-scope select.coveto-category-dropdown,
.coveto-widget-scope input.coveto-keyword-input-field {
	line-height: 1.25;
	color: #15385b;
	font-size: 1rem;
}

/* Select-specific: when nothing is selected (value=""), the placeholder
   color is applied via a modifier class that JS toggles. Standard
   <option> elements aren't reliably styleable across browsers. */
.coveto-category-dropdown.is-placeholder {
	color: #9aa0a6;
}

/* Options themselves always get a normal dark text color so the opened
   dropdown list is readable. Elementor widget overrides the text color
   scoped to .is-placeholder via the Placeholder-Farbe control. */
.coveto-category-dropdown option {
	color: #15385b;
}

.coveto-keyword-suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 20;
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ccc;
	border-top: none;
	border-radius: 0 0 0.25rem 0.25rem;
	max-height: 16rem;
	overflow-y: auto;
}

.coveto-keyword-suggestion-item {
	padding: 0.5rem 1rem;
	cursor: pointer;
	color: #15385b;
}

.coveto-keyword-suggestion-item.is-active,
.coveto-keyword-suggestion-item:hover {
	background: #15385b;
	color: #fff;
}

.coveto-search-button {
	display: block;
	margin: 1rem auto 0;
	padding: 0.75rem 2rem;
	background: #f0f4f8;
	color: #15385b;
	border: 0;
	border-radius: 0.25rem;
	font-weight: 600;
	cursor: pointer;
}

.coveto-search-button:hover {
	background: #fff;
}

.coveto-search-feedback {
	margin-top: 1rem;
	text-align: center;
	min-height: 1.5em;
}

/* ----------- Result cards (mobile-first: stacked) --------------------- */

.coveto-job-list {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.coveto-job-item {
	display: flex;
	flex-direction: column;     /* Mobile: stack content above button */
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	background: #fff;
	border-radius: 0.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.coveto-job__content {
	width: 100%;
	min-width: 0; /* Allows children to wrap instead of overflowing */
}

.coveto-job__action {
	width: 100%;
}

.coveto-job__title {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.coveto-job__title a {
	color: #15385b;
	text-decoration: none;
}

.coveto-job__meta {
	margin: 0;
	color: #555;
	font-size: 0.9rem;
	line-height: 1.4;
}

.coveto-job-details-link {
	display: inline-block;
	padding: 0.6rem 1.25rem;
	background: #4caf50;
	color: #fff;
	border-radius: 0.25rem;
	text-decoration: none;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
}

.coveto-job-details-link:hover {
	background: #43a047;
	color: #fff;
}

/* Mobile: button fills full width for easier thumb-tap */
@media (max-width: 599px) {
	.coveto-job__action {
		display: flex;
	}
	.coveto-job-details-link {
		flex: 1;
	}
}

/* Desktop / tablet landscape: horizontal layout */
@media (min-width: 600px) {
	.coveto-job-item {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 1.5rem;
		padding: 1rem 1.5rem;
	}
	.coveto-job__action {
		width: auto;
		flex-shrink: 0;
	}
}

/* ----------- Utility --------------------------------------------------- */

.coveto-no-results,
.coveto-error {
	padding: 1rem;
	text-align: center;
	color: #555;
	background: #fff;
	border-radius: 0.25rem;
}

.coveto-error {
	color: #c62828;
}

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