@use 'sass:color';
@use 'colours';
@use 'responsive';
@use 'layout';

.overlay {
  align-items: center;
  background-color: color.adjust(colours.$black, $alpha: -0.3);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: layout.$model-index;
}

.modal {
  background-color: #fff;
  border: 1px solid #ececec;
  box-shadow: 0 2px 5px color.adjust(colours.$black, $alpha: -0.74);
  color: #212121;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - #{layout.$spacing-height * 2});
  max-width: 52em;
  overflow: scroll;
  padding: 1em;
  width: calc(100vw - 3em);

  &:focus-visible {
    outline: none;
  }

  @include responsive.respond-to(very-small) {
    max-height: 100vh;
    width: 100vw;
  }
}

.header {
  align-items: flex-start;
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.content {
  flex-grow: 1;
}

.title {
  margin: 0 1em 0 0;

  &::before {
    margin-right: 0.5em;
  }
}

.modelOpen {
  overflow: hidden;
}
