@use 'forms';
@use '../layout';
@use '../colours';
@use '../accessibility';

.inputContainer {
  margin-top: layout.$spacing-height;
  min-width: 1em;
  width: 100%;
}

.inputLabel {
  display: block;
}

// based on https://moderncss.dev/custom-select-styles-with-pure-css/

.container {
  align-items: center;
  background-color: colours.$white;
  display: grid;
  flex-grow: 1;
  grid-template-areas: 'select';
  margin-top: 0.5em;
  width: 100%;

  &::after {
    background-color: colours.$off-black;
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    content: '';
    grid-area: select;
    height: 0.5em;
    justify-self: end;
    margin-right: 0.5em;
    width: 0.8em;
  }
}

.select {
  appearance: none;
  background-color: transparent;
  border: colours.$input-border;
  border-radius: 2px;
  grid-area: select;
  padding: 0.5em 1.5em 0.5em 0.5em;
  text-overflow: ellipsis;

  @include forms.standard-input-dimensions;

  &:not(:disabled) {
    @include accessibility.interactive($focus-color-change-percentage: 0%);
  }
}
