/* Shared overlay chassis: modal, drawer and popover foundations */

html.str-modal-open,
body.str-modal-open,
html.str-overlay-open,
body.str-overlay-open {
  overflow: hidden;
}

.str-overlay,
.str-modal,
.str-drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: var(--str-z-modal);
}

.str-overlay.is-open,
.str-modal.is-open,
.str-drawer.is-open {
  display: block;
}

.str-overlay__backdrop,
.str-modal__backdrop,
.str-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--str-color-overlay);
}

.str-modal__dialog,
.str-overlay__dialog {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  border-radius: var(--str-radius-lg);
  background: var(--str-color-surface);
  box-shadow: var(--str-shadow-xl);
}

.str-modal__dialog--large,
.str-overlay__dialog--large {
  width: min(840px, calc(100vw - 32px));
}

.str-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100%;
  overflow: auto;
  background: var(--str-color-surface);
  box-shadow: var(--str-shadow-xl);
}

.str-popover {
  position: absolute;
  z-index: calc(var(--str-z-modal) + 1);
  width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--str-color-border);
  border-radius: var(--str-radius-md);
  background: var(--str-color-surface);
  box-shadow: var(--str-shadow-lg);
  color: var(--str-color-text);
}

.str-modal__close,
.str-overlay__close,
.str-drawer__close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--str-color-danger-soft);
  border-radius: var(--str-radius-sm);
  background: var(--str-color-surface);
  color: var(--str-color-danger);
  cursor: pointer;
}
