.#{$n}-modal {
  @include boxSizing;

  & {
    display: flex;
    position: fixed;
    z-index: 99;
    inset: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    padding: $spacer;
    transform: scale(1);
    opacity: 1;
    background-color: rgba($chat-bg, 0.8);
  }
}

.#{$n}-modal__float {
  position: relative;
  width: 100%;
  max-width: 80rem;
  height: 100%;
  padding: $spacer * 0.25;
  border: $thin-border solid $grey-b;
  border-radius: $borderradius;
  outline: 0;
  background-color: $chat-bg;
  box-shadow: $boxshadow-soft;
}

.#{$n}-modal__inner {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: $spacer * 0.5;
}

.#{$n}-modal__image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  border: $thin-border solid $grey-b;
}

.#{$n}-modal__close {
  appearance: none;
  display: flex;
  position: absolute;
  top: $spacer;
  right: $spacer;
  align-items: center;
  gap: $spacer * 0.5;
  min-height: $buttonsize;
  padding: $spacer * 0.25 $spacer * 0.75;
  border: 0 none;
  border-radius: $borderradius-small;
  background-color: $interaction;
  color: set-text-color($interaction);
  font-weight: $fontweight-bold;

  .#{$n}-icon {
    flex: 0 0 $iconsize-small;
    width: $iconsize-small;
    height: $iconsize-small;

    svg {
      width: inherit;
      height: inherit;
    }

    svg path {
      transition: fill $transition;
      fill: $white;
    }
  }
}

.#{$n}-modal__enlarge {
  appearance: none;
  display: flex;
  position: absolute;
  right: $spacer;
  bottom: $spacer;
  align-items: center;
  justify-content: center;
  width: $buttonsize;
  height: $buttonsize;
  padding: 0;
  border: 0 none;
  border-radius: 50%;
  background-color: $white;
  color: transparent;
  font-size: 0;

  .#{$n}-icon svg path {
    fill: $interaction;
  }
}
