/* =========================
   SLIMBOX – MODERN & MOBILE OPTIMIERT
   ========================= */

/* Thumbnail Hover */
.gallery-thumb {
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  filter: brightness(0.85);
}

/* Overlay */
#lbOverlay {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  cursor: pointer;
}

/* Container */
#lbCenter, #lbBottomContainer {
  position: absolute;
  z-index: 9999;
  overflow: hidden;
  background-color: transparent;
}

/* Bild */
#lbImage {
  position: absolute;
  left: 0;
  top: 0;
  border: none;
  background-repeat: no-repeat;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Navigation Links */
#lbPrevLink, #lbNextLink {
  display: block;
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  outline: none;
  background: none !important;
  cursor: pointer;
}

/* Pfeile */
#lbPrevLink::before,
#lbNextLink::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 35px;
  height: 35px;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
  opacity: 0.8;
  transform: translateY(-50%);
  /* Schatten für bessere Sichtbarkeit */
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
}

#lbPrevLink::before { left: 20px; transform: translateY(-50%) rotate(-135deg); }
#lbNextLink::before { right: 20px; transform: translateY(-50%) rotate(45deg); }

#lbPrevLink:hover::before,
#lbNextLink:hover::before { opacity: 1; }

/* =========================
   TOP BAR: Close + Caption + Number
   ========================= */
#lbBottom {
  position: fixed;
  top: 15px;
  left: 0;
  width: 100%;
  text-align: center;
  background: none;
  padding: 10px 0 0 0;
  box-sizing: border-box;
  border: none;
}

#lbNumber {
  display: block;
  color: #fff;
  font-weight: normal;
  margin-bottom: 2px;
  line-height: 1em;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

#lbCaption {
  display: block;
  color: #fff;
  font-weight: normal;
  font-size: 1.5rem;
  line-height: 1.8em;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* Close-X oben rechts */
#lbCloseLink {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  outline: none;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
}

#lbCloseLink::before,
#lbCloseLink::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 3px;
  background: #fff;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));
}

#lbCloseLink::before { transform: translate(-50%, -50%) rotate(45deg); }
#lbCloseLink::after { transform: translate(-50%, -50%) rotate(-45deg); }

#lbCloseLink:hover { background: rgba(0,0,0,0.3); }

/* Loading Spinner optional */
.lbLoading { background: #fff; }

/* =========================
   MOBILE OPTIMIERUNG (Pfeile sichtbar + touch) 
   ========================= */
@media (max-width: 768px) {
  #lbPrevLink, #lbNextLink {
    width: 50px;
    height: 100%;
    top: 0;
    position: fixed; /* Pfeile am Bildschirmrand */
    z-index: 10000;
  }

  #lbPrevLink { left: 10px; }
  #lbNextLink { right: 10px; }

  #lbPrevLink::before,
  #lbNextLink::before {
    width: 25px;
    height: 25px;
    border-top: 4px solid #fff;
    border-right: 4px solid #fff;
    top: 50%;
    transform: translateY(-50%);
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
  }

  #lbPrevLink::before { transform: translateY(-50%) rotate(-135deg); }
  #lbNextLink::before { transform: translateY(-50%) rotate(45deg); }
}

/* ========================= 
   MOBILE: Bild volle Breite + vertikal zentriert
   ========================= */

@media (max-width: 768px) {
  #lbImage {
    position: fixed !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100% !important;
    height: auto !important;
    max-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
  }

  /* Bild-Tag zentrieren */
  #lbImage img {
    display: block;
    max-width: 100%;
    max-height: 100vh;
    margin: 0 auto;
  }

  /* Overlay scrollen verhindern */
  #lbOverlay {
    overflow: hidden;
  }
}