.gallery-card {
  /*flex: 0 0 min(600px, calc(100vw - 60px));   Max 600px, responsiv auf Mobile */
  /* width: min(600px, calc(100vw - 60px)); */
  flex: 0 0 99%;
  width: 99%;
  /* flex: 0 0 var(--cardWidth); */
  background: var(--pagebackgroundcolor);
  border: 1px solid var(--maincolor);
  border-radius: 15px;
  box-shadow: 2px 2px var(--accentcolor);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  max-height: 90vh; 
  height: auto;  
  justify-content: center;
  justify-self: center;
  justify-items: center;
}

.gallery-card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px; 
}

.gallery-full {
  flex: 1;  
  min-height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--foregroundcolor);
}

.gallery {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.gallery-text-box {
  flex-shrink: 0;
  padding: 15px;
  background: var(--foregroundcolor);
  border-top: 1px solid var(--accentcolor);
  overflow-y: auto;
  max-height: 40vh;  
  font-size: 14px;
  line-height: 1.5;
  color: var(--maincolor);
}

.gallery-text-box h1 {
    text-align: center;
}

.gallery-text-box::-webkit-scrollbar {
  width: 6px;
}

.gallery-text-box::-webkit-scrollbar-thumb {
  background: var(--maincolor);
  border-radius: 3px;
}

/* End-Card */
#gallery-card-endcard-always-there {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

#gallery-card-endcard-always-there img {
  width: 150px;
  height: 150px;
  transition: transform 120s;
  margin-bottom: 10px;
}

#gallery-card-endcard-always-there img:hover {
  transform: rotate(129600deg);
}

@media (max-width: 768px) {
  .gallery-card {
    --cardWidth: calc(100vw - 60px);
    max-height: 85vh;
  }
  
  .gallery-text-box {
    max-height: 30vh;
  }
}

/* Lightbox Overlay */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
  cursor: default;  /* Bild selbst kein zoom-out Cursor */
  animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* Klick-Hinweis auf Card-Bild */
.gallery {
  cursor: zoom-in;
}
