.boobox-open {
  overflow: hidden;
}

.boobox-modal {
  --boobox-document-width: min(980px, 96vw);
  --boobox-document-height: min(86vh, 1386px);
  --boobox-transition-speed: 200ms;
}

.boobox-dialog {
  max-width: min(1180px, 96vw);
  margin-right: auto;
  margin-left: auto;
}

.boobox-modal--document .boobox-dialog {
  max-width: var(--boobox-document-width);
}

body.boobox-open .modal-backdrop.show {
  background-color: #fff;
  opacity: 0.94;
}

.boobox-content {
  position: relative;
  overflow: hidden;
  color: #111;
  background: #fff;
  border: 0;
  border-radius: 0.5rem;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.26);
}

.boobox-modal.boobox-modal--fullscreen .boobox-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

.boobox-content:fullscreen,
.boobox-modal.boobox-modal--fullscreen .boobox-content {
  display: flex;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  flex-direction: column;
  border-radius: 0;
  box-shadow: none;
}

.boobox-toolbar {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  min-height: 3rem;
  padding: 0.5rem;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
}

.boobox-count {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  color: rgba(17, 17, 17, 0.82);
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boobox-fullscreen,
.boobox-close {
  pointer-events: auto;
}

.boobox-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #111;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 0.25rem;
}

.boobox-fullscreen:hover,
.boobox-fullscreen:focus-visible {
  background: rgba(17, 17, 17, 0.08);
}

.boobox-body {
  display: grid;
  min-height: 220px;
  max-height: 88vh;
  padding: 0;
  place-items: center;
}

.boobox-content:fullscreen .boobox-body,
.boobox-modal.boobox-modal--fullscreen .boobox-body {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.boobox-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 220px;
  place-items: center;
  opacity: 1;
}

.boobox-content:fullscreen .boobox-stage,
.boobox-modal.boobox-modal--fullscreen .boobox-stage {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.boobox-stage--fade {
  transition: opacity var(--boobox-transition-speed) ease;
}

.boobox-stage--loading::before {
  width: 2rem;
  height: 2rem;
  content: "";
  border: 0.2rem solid rgba(17, 17, 17, 0.12);
  border-top-color: rgba(17, 17, 17, 0.55);
  border-radius: 50%;
  animation: boobox-spin 0.75s linear infinite;
}

.boobox-stage--loading > * {
  opacity: 0;
}

.boobox-stage--ready > * {
  opacity: 1;
}

.boobox-image {
  display: block;
  width: auto;
  max-width: 96vw;
  height: auto;
  max-height: 88vh;
  user-select: none;
}

.boobox-content:fullscreen .boobox-image,
.boobox-modal.boobox-modal--fullscreen .boobox-image {
  width: auto;
  max-width: 100vw;
  height: auto;
  max-height: 100vh;
  object-fit: contain;
}

.boobox-modal.boobox-modal--fullscreen.boobox-modal--has-caption .boobox-image {
  max-height: calc(100vh - 5rem);
}

.boobox-modal--document .boobox-body,
.boobox-modal--document .boobox-stage,
.boobox-modal--document .boobox-inline,
.boobox-modal--document .boobox-frame {
  height: var(--boobox-document-height);
  min-height: min(70vh, var(--boobox-document-height));
}

.boobox-inline,
.boobox-frame {
  display: block;
  width: 100%;
  color: #111;
  background: #fff;
  border: 0;
}

.boobox-inline {
  overflow: hidden;
}

.boobox-inline iframe,
.boobox-frame {
  width: 100%;
  height: 100%;
}

.boobox-content:fullscreen .boobox-inline,
.boobox-content:fullscreen .boobox-frame,
.boobox-modal.boobox-modal--fullscreen .boobox-inline,
.boobox-modal.boobox-modal--fullscreen .boobox-frame {
  height: 100%;
  max-height: 100%;
}

.boobox-nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 4rem;
  color: #111;
  font-size: 2.5rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.14);
  transform: translateY(-50%);
}

.boobox-nav:hover,
.boobox-nav:focus-visible {
  background: #fff;
}

.boobox-nav--prev {
  left: 0;
}

.boobox-nav--next {
  right: 0;
}

.boobox-caption {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.9rem 0.8rem;
  color: rgba(17, 17, 17, 0.88);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.boobox-caption strong,
.boobox-caption span {
  overflow-wrap: anywhere;
}

.boobox-caption span:empty {
  display: none;
}

.boobox-error {
  max-width: min(34rem, 90vw);
  padding: 2rem;
  color: #111;
  text-align: center;
}

.boobox-external {
  display: grid;
  gap: 1rem;
  width: min(32rem, 92vw);
  padding: 2rem;
  color: #111;
  text-align: center;
  background: #fff;
}

.boobox-external p {
  margin: 0;
  font-weight: 700;
}

.boobox-external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  color: #fff;
  text-decoration: none;
  background: #202020;
  border-radius: 0.25rem;
}

.boobox-external-link:hover,
.boobox-external-link:focus-visible {
  color: #fff;
  background: #444;
}

@keyframes boobox-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 575.98px) {
  .boobox-dialog {
    width: 100vw;
    max-width: 100vw;
    min-height: 100%;
    margin: 0;
  }

  .boobox-content {
    min-height: 100vh;
    border-radius: 0;
  }

  .boobox-body {
    max-height: calc(100vh - 4rem);
  }

  .boobox-image {
    max-width: 100vw;
    max-height: calc(100vh - 4rem);
  }

  .boobox-modal--document .boobox-body,
  .boobox-modal--document .boobox-stage,
  .boobox-modal--document .boobox-inline,
  .boobox-modal--document .boobox-frame {
    height: calc(100vh - 4rem);
  }

  .boobox-nav {
    width: 2.35rem;
    height: 3.25rem;
  }
}
