/* ASB TEC Find Events plugin — layout-only CSS
 *
 * This file intentionally contains only minimal layout rules so the active
 * theme can provide all visual styling (colors, borders, spacing, etc).
 * It ensures the button and inputs align horizontally on larger viewports
 * (wider than 680px) and stack on small screens.
 */

/* Desktop / larger views: horizontal alignment */
@media (min-width: 681px) {
  .asb-find-events-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  /* Make the form a horizontal flex container so its children (input-group + button) sit inline */
  .asb-find-events-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .asb-find-events-input-group {
    display: flex;
    gap: 12px;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
  }

  /* Ensure the autocomplete host expands to use available space */
  .asb-place-autocomplete-wrapper {
    flex: 1 1 0;
    min-width: 0;
  }

  .asb-place-autocomplete-host {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Ensure the Place Autocomplete web-component fills the host */
  .asb-place-autocomplete-host gmp-place-autocomplete,
  .asb-place-autocomplete-host gmp-place-autocomplete * {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* Keep only positioning for the button — visual styles come from the theme. */
  .asb-find-events-button {
    flex: 0 0 auto;
    align-self: center;
    margin-left: 8px;
    white-space: nowrap;
  }
}

/* Mobile / small screens: stack vertically */
@media (max-width: 680px) {
  .asb-find-events-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .asb-find-events-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .asb-find-events-button {
    width: 100%;
  }
}

/* Ensure consistent box-sizing for layout calculations */
.asb-find-events-search,
.asb-find-events-form,
.asb-find-events-input-group,
.asb-find-events-input-control,
.asb-find-events-input,
.asb-find-events-button,
.asb-place-autocomplete-host {
  box-sizing: border-box;
}

/* ==========================================================================
   ASB TEC Search Bar ([asb_tec_search_bar])
   ========================================================================== */

.asb-search-bar {
	padding: 1rem 0;
	margin-bottom: 1.5rem;
}

.asb-search-bar__form {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: 0.75rem;
}

.asb-search-bar__inputs {
	display: flex;
	flex: 1 1 auto;
	gap: 0.75rem;
	min-width: 0;
}

.asb-search-bar__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1 1 0;
	min-width: 0;
}

.asb-search-bar__field--text {
	flex: 1 1 0;
}

.asb-search-bar__field--location {
	flex: 1 1 0;
}

.asb-search-bar__label {
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.asb-search-bar__input {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	border: 2px solid #ddd;
	border-radius: 0.375rem;
	background: #ffffff;
	min-height: 2.75rem;
}

.asb-search-bar__input:focus {
	outline: none;
	border-color: #299A44;
	box-shadow: 0 0 0 3px rgba(41, 154, 68, 0.2);
}

.asb-search-bar .asb-search-bar__button {
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	color: #ffffff;
	background: #2F8E42;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease;
	min-height: 2.75rem;
}

.asb-search-bar .asb-search-bar__button:hover,
.asb-search-bar .asb-search-bar__button:focus {
	background: #8CC63E;
}

.asb-search-bar__views {
	display: flex;
	gap: 0.5rem;
	margin-left: auto;
	align-items: center;
}

.asb-search-bar__view-link {
	padding: 0.5rem 1rem;
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	border-radius: 0.25rem;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.asb-search-bar__view-link:hover,
.asb-search-bar__view-link:focus {
	text-decoration: underline;
}

.asb-search-bar__view-link--active {
	font-weight: 700;
	text-decoration: underline;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
	.asb-search-bar__form {
		flex-wrap: wrap;
		flex-direction: column;
		align-items: stretch;
	}

	.asb-search-bar__inputs {
		flex-direction: column;
		max-width: none;
	}

	.asb-search-bar__field {
		max-width: none;
	}

	.asb-search-bar__button {
		width: 100%;
	}

	.asb-search-bar__views {
		margin-left: 0;
		justify-content: center;
		width: 100%;
	}
}
