/**
 * @file
 * Basic styles for the event search filter groups.
 * Adjust colors and spacing to the theme.
 */

.events-filters-group {
  margin-bottom: 1rem;
}

/* Group 1: quick date range radios displayed as buttons. */
.events-filters-group--quick .form-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.events-filters-group--quick .form-type-radio {
  position: relative;
  margin: 0;
}

/* Hide the radio visually but keep it focusable for keyboard users. */
.events-filters-group--quick input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.events-filters-group--quick input[type="radio"] + label {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  cursor: pointer;
}

.events-filters-group--quick input[type="radio"]:checked + label {
  background: #b52764;
  border-color: #b52764;
  color: #fff;
}

.events-filters-group--quick input[type="radio"]:focus-visible + label {
  outline: 2px solid red;
  /*outline-offset: 2px;*/
}

/* Top bar: quick ranges on the left, "Filters" button on the right. */
.events-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.events-filters-bar .events-filters-group--quick {
  margin-bottom: 0;
}

/* Right side of the top bar: "Filters" button and "Submit an event" link. */
.events-filters-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.events-submit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  background: #b5175d;
  color: #fff;
  text-decoration: none;
}

/* Plus sign in a circle. */
.events-submit-link::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.events-submit-link:hover,
.events-submit-link:focus-visible {
  background: #8f1249;
  color: #fff;
}

.events-submit-link:focus-visible {
  outline: 2px solid #8f1249;
  outline-offset: 2px;
}

.events-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* Chevron that turns when the panel is open. */
.events-filters-toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s;
}

.events-filters-toggle[aria-expanded="true"]::after {
  transform: translateY(25%) rotate(-135deg);
}

.events-filters-toggle:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

/* Panel: remaining filters side by side, the submit button at the end. */
.events-filters-group--search {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 0.5rem;
}

.events-filters-group--search[hidden] {
  display: none;
}

.events-filters-group--search .form-actions {
  margin: 0;
}
