/* ************************************* */
/*   Error, Warning, Pass annotations    */
/* ************************************* */

.annotation {
  position: relative;
  display: block;
}

.annotation-inline {
  position: relative;
  display: inline-block;
  text-align: end;
}

button {
  position: absolute;
  display: block;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 16px 0 #0000004f;
  transition: all 0.2s ease-in-out;

  &::after {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 36px;
    height: 36px;
    padding: 7px;
    content: "";
  }
}

/* Error */
.error-btn {
  z-index: 9999;
  background: 50% 50% var(--sa11y-error-svg) no-repeat;
  background-color: var(--sa11y-error);
  background-size: 22px;
  border: 1px solid var(--sa11y-error);

  &:hover,
  &:focus {
    background-color: var(--sa11y-error-hover);
  }
}

/* Pass button */
.good-btn {
  z-index: 9977;
  background: 50% 50% var(--sa11y-good) var(--sa11y-good-svg) no-repeat;
  background-color: var(--sa11y-good);
  background-size: 20px;
  border: 1px solid var(--sa11y-good);

  &:hover,
  &:focus {
    background-color: var(--sa11y-good-hover);
  }
}

/* Warning button */
.warning-btn {
  z-index: 9988;
  background: 50% 50% var(--sa11y-warning) var(--sa11y-warning-svg) no-repeat;
  background-color: var(--sa11y-warning);
  background-size: 24px;
  border: 1px solid var(--sa11y-warning);
  transform: scaleX(var(--sa11y-icon-direction));

  &:hover,
  &:focus {
    background-color: var(--sa11y-warning-hover);
  }
}

/* ************************************* */
/* Keyboard focus styles for annotations */
/* ************************************* */

button:active,
button:focus {
  outline: 0;
  box-shadow: 0 0 0 5px var(--sa11y-focus-color);
}

/* High Contrast Mode */
@media screen and (forced-colors: active) {
  button {
    border: 1px solid transparent !important;
    forced-color-adjust: none;
    outline: transparent solid 3px !important;
  }
}
