/* --- Wrapper / layout --- */

.coderra-tt-filter-wrap {
  margin-bottom: 30px;
}

/* Add a faint loading state hook if you want later */
.coderra-tt-filter-wrap.coderra-tt-loading {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Top bar wrapper */
.coderra-tt-filter-wrap .events-filter {
  margin-bottom: 30px;
}

.coderra-tt-filter-wrap .events-filter__wrapper {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 18px;
  padding-bottom: 30px;
}

form.coderra-tt-filters {
	display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

/* Each label/control block */

.coderra-tt-filter-wrap .events-filter__label {
  margin: 0;
  flex: 1 1 24%;
  min-width: 190px;
}

/* Nested wrapper for select “shell” */
.coderra-tt-filter-wrap .fancy-select-wrap {
  position: relative;
  padding-top: 0 !important;
  width: 100%;
}

/* Controls: input + select */
.coderra-tt-filter-wrap .events-filter__control {
  width: 100%;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 8px 14px;
  min-height: 40px;
  font-size: 14px;
  line-height: 1.4;
  background-color: #fff;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.coderra-tt-filter-wrap .events-filter__control::placeholder {
  opacity: 0.7;
}

/* Hover / focus states (feel similar to Salient inputs) */
.coderra-tt-filter-wrap .events-filter__control:focus,
.coderra-tt-filter-wrap .events-filter__control:active {
  outline: none;
  border-color: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}

/* --- Select2 integration (Salient uses it as well) --- */

.coderra-tt-filter-wrap .select2-container {
  width: 100% !important;
  font-size: 14px;
}

.coderra-tt-filter-wrap .select2-selection--single {
  border-radius: 999px !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  height: 40px !important;
  padding: 0 40px 0 14px;
  display: flex;
  align-items: center;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.coderra-tt-filter-wrap .select2-selection__rendered {
  line-height: 1.4 !important;
  padding-left: 0 !important;
  color: inherit;
}

.coderra-tt-filter-wrap .select2-selection__arrow {
  height: 100% !important;
  right: 10px !important;
}

.coderra-tt-filter-wrap .select2-selection__arrow b {
  border-color: rgba(0,0,0,0.6) transparent transparent transparent !important;
}

/* Hover / focus state on select2 */
.coderra-tt-filter-wrap .select2-container--default .select2-selection--single:focus,
.coderra-tt-filter-wrap .select2-container--default .select2-selection--single:hover {
  border-color: rgba(0,0,0,0.3) !important;
}

/* Dropdown menu tweaks */
.coderra-tt-filter-wrap .select2-dropdown {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Search input on top of dropdown (if shown) */
.coderra-tt-filter-wrap .select2-search--dropdown .select2-search__field {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 6px 10px;
}

/* Option styling */
.coderra-tt-filter-wrap .select2-results__option {
  padding: 6px 10px;
  font-size: 14px;
}

.coderra-tt-filter-wrap .select2-results__option--highlighted[aria-selected] {
  background-color: rgba(0,0,0,0.07);
  color: inherit;
}

/* --- Coderra TT filter colour fix --- */

/* Force dark text inside controls */
.coderra-tt-filter-wrap .events-filter__control {
  color: #111 !important;
}

/* Select2 rendered text */
.coderra-tt-filter-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #111 !important;
}

/* Placeholder text colour inside Select2 */
.coderra-tt-filter-wrap .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #777 !important;
}

/* Arrow colour */
.coderra-tt-filter-wrap .select2-selection__arrow b {
  border-color: #444 transparent transparent transparent !important;
}

/* Ensure our filter selects use their own colour, not inherited white */

/* Base colour context inside our wrapper */
.coderra-tt-filter-wrap {
  color: #111;
}

/* Override Salient's inherit !important for rendered Select2 text */
body[data-fancy-form-rcs="1"] .coderra-tt-filter-wrap
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #111 !important;
}

/* Highlighted option in dropdown */
body[data-fancy-form-rcs="1"] .coderra-tt-filter-wrap
  .select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  color: #111 !important;
}

/* Normal options */
body[data-fancy-form-rcs="1"] .coderra-tt-filter-wrap
  .select2-results__option {
  color: #111 !important;
}

/* Native <select> fallback */
.coderra-tt-filter-wrap .events-filter__control--date,
.coderra-tt-filter-wrap .events-filter__control--venue,
.coderra-tt-filter-wrap .events-filter__control--sort {
  color: #111 !important;
}

.coderra-no-results-message p {
	color: #fff !important;
}

.coderra-tt-filter-wrap .events-filter__control--search {
  height: 40px;
  line-height: 1.4;       /* normal line height */
  padding-top: 8px;
  padding-bottom: 8px;    /* same total as selects */
  box-sizing: border-box;
}


/* If you kept the dark-mode block earlier and it's fighting this, this will win: */
@media (prefers-color-scheme: dark) {
  .coderra-tt-filter-wrap .events-filter__control,
  .coderra-tt-filter-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #111 !important;
    background-color: #fff !important;
  }
}


/* --- Responsive adjustments --- */

/* On narrower screens, allow stacking */
@media (max-width: 768px) {
  .coderra-tt-filter-wrap .events-filter__label {
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  .coderra-tt-filter-wrap .events-filter__wrapper {
    gap: 8px 10px;
  }

  .coderra-tt-filter-wrap .events-filter__label {
    flex: 1 1 100%;
  }
}

@media only screen and (max-width: 690px) {
    .coderra-tt-grid-target .portfolio-items .col.span_4,
	.coderra-tt-grid-target .portfolio-items .col.span_3 {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
}

@media only screen and (min-width: 690px) and (max-width: 999px) {
    .coderra-tt-grid-target .portfolio-items .col.span_4,
	.coderra-tt-grid-target .portfolio-items .col.span_3 {
        width: 49.9% !important;
    }
}

@media (prefers-color-scheme: dark) {
  .coderra-tt-filter-wrap .events-filter__control,
  .coderra-tt-filter-wrap .select2-selection--single {
    background-color: #111;
    border-color: rgba(255,255,255,0.12);
    color: #f5f5f5;
    box-shadow: none;
  }

  .coderra-tt-filter-wrap .select2-dropdown {
    background-color: #111;
    border-color: rgba(255,255,255,0.12);
  }

  .coderra-tt-filter-wrap .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(255,255,255,0.1);
  }
}
