/* Multithumb – Grundgestaltung. Farben und Abstände über die Variablen anpassen. */

:root {
  --mt-backdrop: rgba(0, 0, 0, .85);
  --mt-fg: #fff;
  --mt-button-bg: rgba(0, 0, 0, .5);
  --mt-gap: .5rem;
}

.mt-magnify,
.mt-expand {
  cursor: zoom-in;
}

.mt-expand.mt-expanded {
  cursor: zoom-out;
  max-width: 100%;
  height: auto;
}

.mt-hidden {
  display: none;
}

.mt-hidden:has(.more_images) {
  display: inline;
}

/* Beschriftung */
.mt-caption {
  display: inline-flex;
  flex-direction: column;
  margin: 0;
}

.mt-caption img {
  display: block;
  max-width: 100%;
}

.mt-caption-top    { flex-direction: column-reverse; }
.mt-caption-right  { flex-direction: row; align-items: center; }
.mt-caption-left   { flex-direction: row-reverse; align-items: center; }

/* Galerie */
.mt-gallery {
  display: grid;
  grid-template-columns: repeat(var(--mt-cols, 3), minmax(0, 1fr));
  gap: var(--mt-gap);
  align-items: end;
  justify-items: center;
}

.mt-gallery img {
  max-width: 100%;
  height: auto;
  float: none;
}

@media (max-width: 36em) {
  .mt-gallery {
    grid-template-columns: repeat(min(var(--mt-cols, 3), 2), minmax(0, 1fr));
  }
}

/* Lightbox */
.mt-box {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-fg);
  overflow: hidden;
}

.mt-box::backdrop {
  background: var(--mt-backdrop);
}

.mt-box-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3rem 4rem;
  box-sizing: border-box;
}

.mt-box-img {
  max-width: 100%;
  max-height: calc(100% - 3rem);
  object-fit: contain;
  box-shadow: 0 0 2rem rgba(0, 0, 0, .6);
}

.mt-box-text {
  margin-top: .75rem;
  text-align: center;
  font-size: .95rem;
}

.mt-box-counter {
  display: block;
  opacity: .7;
  font-size: .85em;
}

.mt-box button {
  position: absolute;
  border: 0;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--mt-button-bg);
  color: var(--mt-fg);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.mt-box button:focus-visible {
  outline: 2px solid var(--mt-fg);
  outline-offset: 2px;
}

.mt-box-close { top: .75rem; right: .75rem; }
.mt-box-prev  { left: .75rem; top: 50%; transform: translateY(-50%); }
.mt-box-next  { right: .75rem; top: 50%; transform: translateY(-50%); }

.mt-box[data-single] .mt-box-prev,
.mt-box[data-single] .mt-box-next {
  display: none;
}

@media (max-width: 36em) {
  .mt-box-stage { padding: 3.5rem .5rem; }
  .mt-box-prev, .mt-box-next { top: auto; bottom: .75rem; transform: none; }
}

/* Beschriftetes Bild mitten im Fließtext (als <span> ausgegeben) */
span.mt-caption {
  vertical-align: top;
}

.mt-figcaption {
  display: block;
}
