/* Ausrichtung auf figure.image */
figure.image.left {
  display: block;
  float: left;
  padding: 0 1.3em 0.4em 0;
  margin: 0.25em 0 0.25em 0;
  max-width: 100%;
}

figure.image.right {
  display: block;
  float: right;
  padding: 0 0 0.4em 1.3em;
  margin: 0.25em 0 1em 0;
  max-width: 100%;
}

/* Mittig ausgerichtetes Figure (ohne Textfluss links/rechts) */
figure.image.center {
  display: block;
  float: none;
  margin-top: 0.25em;
  margin-bottom: 1.25em;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.3em 0.4em 1.3em;
  width: fit-content;
  max-width: 100%;
}

/* Bilder innerhalb regulärer figure.image-Blöcke folgen der Figure-Breite */
figure.image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Größenklassen .smaller05 bis .smaller80 für <figure> */
figure.image.main.smaller05,
figure.image.right.smaller05,
figure.image.left.smaller05 {
  width: 100%;
  max-width: 5%;
}

figure.image.center.smaller05 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 5%;
  max-width: 100%;
}

figure.image.main.smaller10,
figure.image.right.smaller10,
figure.image.left.smaller10 {
  width: 100%;
  max-width: 10%;
}

figure.image.center.smaller10 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 10%;
  max-width: 100%;
}

figure.image.main.smaller15,
figure.image.right.smaller15,
figure.image.left.smaller15 {
  width: 100%;
  max-width: 15%;
}

figure.image.center.smaller15 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 15%;
  max-width: 100%;
}

figure.image.main.smaller20,
figure.image.right.smaller20,
figure.image.left.smaller20 {
  width: 100%;
  max-width: 20%;
}

figure.image.center.smaller20 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 20%;
  max-width: 100%;
}

figure.image.main.smaller25,
figure.image.right.smaller25,
figure.image.left.smaller25 {
  width: 100%;
  max-width: 25%;
}

figure.image.center.smaller25 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 25%;
  max-width: 100%;
}

figure.image.main.smaller30,
figure.image.right.smaller30,
figure.image.left.smaller30 {
  width: 100%;
  max-width: 30%;
}

figure.image.center.smaller30 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 30%;
  max-width: 100%;
}

figure.image.main.smaller35,
figure.image.right.smaller35,
figure.image.left.smaller35 {
  width: 100%;
  max-width: 35%;
}

figure.image.center.smaller35 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 35%;
  max-width: 100%;
}

figure.image.main.smaller40,
figure.image.right.smaller40,
figure.image.left.smaller40 {
  width: 100%;
  max-width: 40%;
}

figure.image.center.smaller40 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 40%;
  max-width: 100%;
}

figure.image.main.smaller45,
figure.image.right.smaller45,
figure.image.left.smaller45 {
  width: 100%;
  max-width: 45%;
}

figure.image.center.smaller45 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 45%;
  max-width: 100%;
}

figure.image.main.smaller50,
figure.image.right.smaller50,
figure.image.left.smaller50 {
  width: 100%;
  max-width: 50%;
}

figure.image.center.smaller50 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
  max-width: 100%;
}

figure.image.main.smaller55,
figure.image.right.smaller55,
figure.image.left.smaller55 {
  width: 100%;
  max-width: 55%;
}

figure.image.center.smaller55 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 55%;
  max-width: 100%;
}

figure.image.main.smaller60,
figure.image.right.smaller60,
figure.image.left.smaller60 {
  width: 100%;
  max-width: 60%;
}

figure.image.center.smaller60 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 60%;
  max-width: 100%;
}

figure.image.main.smaller65,
figure.image.right.smaller65,
figure.image.left.smaller65 {
  width: 100%;
  max-width: 65%;
}

figure.image.center.smaller65 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 65%;
  max-width: 100%;
}

figure.image.main.smaller70,
figure.image.right.smaller70,
figure.image.left.smaller70 {
  width: 100%;
  max-width: 70%;
}

figure.image.center.smaller70 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 70%;
  max-width: 100%;
}

figure.image.main.smaller75,
figure.image.right.smaller75,
figure.image.left.smaller75 {
  width: 100%;
  max-width: 75%;
}

figure.image.center.smaller75 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 75%;
  max-width: 100%;
}

figure.image.main.smaller80,
figure.image.right.smaller80,
figure.image.left.smaller80 {
  width: 100%;
  max-width: 80%;
}

figure.image.center.smaller80 {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  width: 80%;
  max-width: 100%;
}

/* Zoom-Zustand / Zeiger */
img.zoomsmall {
  transform: translate(0, 0);
}

img.zoomsmall:hover {
  cursor: zoom-in;
}

.zoom-bottomleft.large {
  position: relative;
  z-index: 999;
}

/* Bildunterschriften */
figure figcaption {
  font-size: 0.75em;
  font-weight: bolder;
  font-family: "Open Sans", sans-serif;
  color: #3d4449;
  line-height: 1.2em;
  word-wrap: break-word;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  -o-hyphens: auto;
  hyphens: auto;
}

figure.large:hover {
  cursor: zoom-out;
}

/* Lightbox / Overlay */
figure.ovl {
  margin: 0;
  position: fixed;
  width: 0;
  height: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 1s linear;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

figure.ovl.large {
  width: 60%;
  height: 90%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

figure.ovl img {
  width: auto;
  height: 100%;
  border-radius: 0.7em;
}

figure.ovl img.fitVertically {
  width: 90%;
  height: auto;
  border-radius: 0.7em;
}

figure.ovl img.fitHorizontally {
  height: 90%;
  width: auto;
}

/* 'gallery' wird in kabl-convert_kabl-vorlage.php verwendet */
.gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 20px auto;
}

.gallery figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 1s linear;
  z-index: 100;
  margin-top: 0.25em;
  margin-bottom: 1.5em;
}

.gallery img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 5px;
  border: 2px solid cadetblue;
  display: block;
  width: 200px;
  height: auto;
}

.gallery figcaption {
  margin-top: 0.5em;
}

/* Responsive Anpassungen */
@media (max-width: 1000px) {
  .gallery figure {
    margin: 15px 15px 1.5em 15px;
    margin-top: 0.25em;
  }
}

@media (max-width: 700px) {
  .gallery figure {
    margin: 5px 5px 1em 5px;
    margin-top: 0.15em;
  }

  .gallery img {
    width: 125px;
  }
}

@media (max-width: 640px) {
  figure.image.left,
  figure.image.right,
  figure.image.center {
    float: none;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .gallery figure {
    margin: 5px;
  }
}
