/**
 * Styles for the wrapping element and
 * the custom down arrow / background
 */
.a11y {
  background-color: #fff;
  position: relative;
}

.a11y:after,
.a11y:before {
  bottom: 0;
  content: "";
  pointer-events: none;
  position: absolute;
  top: 0;
}

.a11y:before {
  right: 0;
  width: 1.85em;
}

.a11y:after {
  border-bottom: 2px solid #2a2a2a;
  border-right: 2px solid #2a2a2a;
  height: .5em;
  margin: auto;
  right: .75em;
  transform-origin: center right;
  transform: rotate(45deg);
  width: .5em;
  z-index: 2;
}

.a11y:focus-within:before {
  background-color: #015f9f;
}

/**
 * Target only select elements that are
 * child elements of the custom style.
 * These styles could really mess up other
 * selects that aren't within the parent wrapper.
 */
.a11y select {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border: 1px solid #000;
  color: #2a2a2a;
  line-height: normal;
  max-width: 100%;
  padding: .75em 2em .75em .75em;
  width: 100%;
}

/*.a11y select:focus-visible*/
.a11y select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 #fff;
}

.a11y select:focus {
  border-color: #015f9f;
  box-shadow: inset 0 0 0 1px #015f9f, 0 0 0 2px #015f9f;
  outline: none;
}

.a11y select:disabled {
  color: rgba(255,255,255,.75);
  cursor: not-allowed;
  opacity: .75;
}

.a11y select:invalid {
  background: darkred;
}

/* firefox will change the background of options to
   match the select's background. */
.a11y select:invalid option {
  background: lightgrey;
}

/**
 * 1. remove background focus style from IE11 while keeping
 *    focus style available on option elements
 * 2. remove the default down arrow in IE/Edge
 */
.a11y select::-ms-value {
  background: transparent; /* 1 */
}

.a11y select::-ms-expand {
  display: none; /* 2 */
}


/**
 * Child elements of the select
 */
.a11y select:focus option:not(:disabled),
.a11y select:focus optgroup:not(:disabled) {
  color: #111;
  text-shadow: none;
}

.a11y option:disabled,
.a11y optgroup:disabled {
  color: rgba(50,50,50,.75);
}


/**
 * Support for rtl text, explicit support for Arabic and Hebrew
 * credit: https://twitter.com/aardrian/status/1075587790656675840
 */
[dir="rtl"] .a11y:before ,
:root:lang(ar) .a11y:before,
:root:lang(iw) .a11y:before {
  left: 0;
  right: auto;
}

[dir="rtl"] .a11y:after ,
:root:lang(ar) .a11y:after,
:root:lang(iw) .a11y:after {
  left: .5em;
  right: auto;
}


[dir="rtl"] .a11y select,
:root:lang(ar) .a11y select,
:root:lang(iw) .a11y select {
  padding: .75em .75em .75em 2em;
}
