/* Mobile Galerie: immer zwei Spalten. */
@media (max-width: 767px) {
  .gug-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem;
  }

  .gug-gallery__item {
    min-width: 0;
  }

  .gug-gallery__link,
  .gug-gallery__image {
    width: 100%;
  }
}

/* Mobile Lightbox: ausschließlich manuelles Wischen, keine Pfeile. */
.gug-lightbox[hidden] {
  display: none !important;
}

.gug-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: block;
  background: rgba(0, 0, 0, 0.96);
  color: #fff;
  opacity: 0;
  transition: opacity 180ms ease;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

.gug-lightbox.is-open {
  opacity: 1;
}

.gug-lightbox__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding:
    calc(54px + env(safe-area-inset-top, 0px))
    8px
    calc(46px + env(safe-area-inset-bottom, 0px));
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gug-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity;
}

.gug-lightbox.is-loading .gug-lightbox__image {
  opacity: 0.35;
}

.gug-lightbox__close {
  position: absolute;
  z-index: 2;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font: inherit;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gug-lightbox__counter {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  font-size: 13px;
  line-height: 1.2;
  pointer-events: none;
}

html.gug-lightbox-open,
body.gug-lightbox-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  .gug-lightbox {
    transition: none;
  }
}
