/* Shared form controls: the search field (.search-control) with its clear button, and
   filter pills (.filter-pill). Used by pages/search.html, the conjugation index
   (partials/conjugation_hub.html), and the verb page filters
   (partials/conjugation_toolbar.html).

   Filter pills: Canvas when unselected, Ink with White when selected. A pill that
   belongs to a colored section (.filter-pill--fill) takes that section's fill when
   selected instead. Disabled pills use the disabled text color. */

.search-control {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--color-control-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: box-shadow var(--motion-fast);
}

.search-control:focus-within {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 1px var(--color-focus);
}

.search-control > svg {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--color-text);
}

.search-control input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.3;
}

/* The field's own focus treatment replaces the ring on the inner input. */
.search-control input:focus {
  outline: none;
}

.search-control input::placeholder {
  color: var(--color-text-muted);
}

.search-control input::-webkit-search-decoration,
.search-control input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-control__clear {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  margin: -0.3rem -0.4rem -0.3rem 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.search-control__clear svg {
  width: 1.15rem;
  height: 1.15rem;
}

.search-control__clear:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.search-control__clear[hidden] {
  display: none;
}

/* Filter pills */

.filter-pill {
  min-width: 2rem;
  padding: 0.32rem 0.62rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--motion-fast);
}

.filter-pill:hover {
  border-color: var(--color-text);
}

.filter-pill[aria-pressed="true"],
.filter-pill.voice-tab--active {
  border-color: transparent;
  background: var(--color-selected);
  color: var(--color-on-selected);
  font-weight: 700;
}

.filter-pill--fill[aria-pressed="true"],
.filter-pill.mood-nav-link--active {
  background: var(--fill);
  color: var(--color-text);
}

.filter-pill:disabled,
.filter-pill[aria-disabled="true"] {
  border-color: transparent;
  color: var(--color-text-disabled);
  cursor: default;
}
