.pbox {
  display: none;
  position: fixed;
  z-index: 1000;

  /* Größe richtet sich nach dem Inhalt (Bild) */
  width: fit-content;
  height: fit-content;
  max-width: 95vw;
  max-height: 95vh;

  overflow: auto;
  background: #fff;
  color: #000;
  border-radius: 4px;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.8);
  border: 9px solid rgb(142, 17, 33, 0.5);
  background-clip: padding-box;
}

.pbox .pbody {
  padding: 0; /* bei Bedarf z.B. 1em für Rand um das Bild */
}

/* Bild passt sich an Inhalt und Viewport an */
.pbox .pbody img {
  display: block;
  max-width: 100%;
  max-height: calc(95vh - 40px);
  width: auto;
  height: auto;
  margin: 0 auto;
}

.poverlay {
  opacity: 0;
  filter: alpha(opacity=0);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85) !important;
}

a.pboxclose {
  float: right;
  margin-top: 2px;
  margin-right: 2px;
  cursor: pointer;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 30px;
  background: rgb(142, 17, 33);
  font-family: Arial, serif;
  font-size: 30px;
  font-weight: bold;
  display: inline-block;
  line-height: 1px;
  padding: 11px 3px;
  z-index: 1001;
}
a.pboxclose {
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 32px;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
}

a.pboxclose:hover,
a.pboxclose:focus {
  background: rgb(110, 12, 25); /* etwas dunkler */
  transform: scale(1.1);
}

.pboxclose:before {
  content: "×";
}
.poverlay {
  z-index: 99998;
}

.pbox {
  z-index: 99999;
}

a.pboxclose {
  z-index: 100000;
}
@media (max-width: 32em) {
  .pbox {
    max-width: 94vw;
    border-width: 5px;
  }
  .pbox .pbody img {
    max-height: calc(90vh - 20px);
  }
}
@media (max-width: 32em) {
  .pbox {
    max-width: 94vw;
    border-width: 5px;
  }
  .pbox .pbody img {
    max-height: calc(90vh - 20px);
  }
}