#popup-container,
#popup-preview {
  background-color: rgba(52, 73, 94, 0.7);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#popup-preview {
  display: flex;
}

#popup-container {
  display: none; /* Gets changed to the `flex` value by the popup script */
  position: fixed;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  top: 0;
  left: 0;
  z-index: 9999;
}

#popup-container > .popup,
#popup-preview > div {
  grid-template-areas: "overlay";
  position: relative;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
  border: 5px solid white;
}

#popup-container > .popup {
  display: none; /* Gets changed to the `grid` value by the popup script */
}

#popup-preview > div {
  display: grid;
}

.popup-image {
  grid-area: overlay;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: cover; /* or `contain` */
  z-index: 0;
}

.popup-content {
  grid-area: overlay;
  position: relative;
  z-index: 1;
  padding: 10px;
  text-align: center;
}

#popup-container > .popup .popup-close,
#popup-preview > div .popup-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  aspect-ratio: 1 / 1;
  text-align: center;
  background-color: white;
  color: black;
  border: 1px solid white;
  border-radius: 10px;
  cursor: pointer;
  z-index: 10001;
}

#popup-container > .popup p,
#popup-preview > div p {
  padding: 0 5px;
}

.popup.clickable {
  cursor: pointer;
}

.popup.unclickable {
  cursor: default;
}

#popup-container > .popup {
  text-decoration: none;
  color: inherit;
}

#popup-container > .popup .popup-content {
  text-decoration: revert;
  color: revert;
}

#popup_container_groupbox > br {
  display: none;
}