/* =========================================================
   Service Gallery
   ========================================================= */

.service-gallery {
  width: 100%;
}

.service-gallery-main img,
.service-gallery-item img {
  cursor: zoom-in;
}

/* =========================================================
   HERO IMAGE (entscheidend)
   ========================================================= */

.service-gallery-main {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* DAS ist der wichtigste Teil */
.service-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =========================================================
   THUMBNAIL STRIP
   ========================================================= */

.service-gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;

  overflow-x: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  
  scroll-snap-type: none;
  padding-bottom: 6px;
}

/* Thumbnail Items */
.service-gallery-item {
  flex: 1 1 100px;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  display: block;
}

.service-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
}

/* =========================================================
   Lightbox Overlay
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: none;
  z-index: 99999;
}

.lightbox.is-open {
  display: block;
}

/* UI oben */
.lightbox__ui {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 1002;
}

.lightbox__close {
  pointer-events: auto;
  font-size: 32px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
}

.lightbox__counter {
  pointer-events: auto;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
}

.lightbox__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  z-index: 1001;
  cursor: grab;
}

.lightbox__stage:active {
  cursor: grabbing;
}

.lightbox__track {
  display: flex;
  height: 100%;
  transition: transform 300ms ease;
}

.lightbox__slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__slide img {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
  transition: transform 200ms ease;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0,0,0);
}

/* Große Click-Zonen links/rechts */
.lightbox__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38vw;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 999;
  pointer-events: auto;
}

.lightbox.is-dragging .lightbox__zone {
  pointer-events: none;
}

.lightbox__zone--prev { left: 0; }
.lightbox__zone--next { right: 0; }

/* Sichtbare Pfeile */
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
}

.lightbox__arrow--prev { left: 14px; }
.lightbox__arrow--next { right: 14px; }

@media (hover:hover) {
  .lightbox__arrow:hover,
  .lightbox__close:hover {
    background: rgba(255,255,255,.20);
  }
}

/* =========================================================
   Toolbar
   ========================================================= */

.lightbox__toolbar {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 12px;
  z-index: 1003;
}

/* Desktop: bottom right, vertical */
@media (min-width: 900px) {
  .lightbox__toolbar {
    left: auto;
    right: 20px;
    transform: none;
    flex-direction: column;
    align-items: flex-end;
  }
}

.lightbox__btn {
  padding: 0 14px;
  height: 44px;
  border-radius: 12px;
  border: 0;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.lightbox__btn::before {
  content: attr(data-off);
}

.lightbox.is-zoomed .lightbox__btn--zoom::before {
  content: attr(data-on);
}

.lightbox.is-fullscreen .lightbox__btn--fs::before {
  content: attr(data-on);
}

/* Zoom-Modus, noch nicht reingezoomt */
.lightbox.is-zoomed:not(.is-zoomed-in) .lightbox__stage {
  cursor: zoom-in;
}

/* Zoom-Modus, Bild ist gezoomt */
.lightbox.is-zoomed.is-zoomed-in .lightbox__stage {
  cursor: zoom-out;
}

.lightbox.is-zoomed.is-zoomed-in .lightbox__stage:active {
  cursor: grabbing;
}

.lightbox__hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1004;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.lightbox__hint-icon {
  font-size: 18px;
  line-height: 1;
}

.lightbox__hint.is-visible {
  opacity: 1;
}

.lightbox__zoomLayer {
  display: flex;
  align-items: center;
  justify-content: center;

  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  transform: translateZ(0);
}

.lightbox.is-fullscreen .lightbox__slide img {
  max-width: 100vw;
  max-height: 100dvh;
}

.lightbox.is-fullscreen {
  width: 100vw;
  height: 100dvh; /* wichtig für iOS */
  inset: 0;
}
