#hidden-gallery-sources{
  display: none;
}
#gallery-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  transition: backdrop-filter 0.3s ease;
}

#gallery-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-sans);
}

.dialog-content {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 90vh;
  position: relative;
}

#dialog-dynamic-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  overflow: hidden;
  outline: none;
  transition: opacity 0.15s ease-in-out;
  opacity: 1;
}

#dialog-dynamic-content img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
#dialog-dynamic-content.is-fading {
  opacity: 0;
}
#dialog-dynamic-content figcaption {
  margin-top: 15px;
  font-size: 1.1rem;
  color: #e2e8f0;
  font: 400 1rem var(--font-sans);
}

#prev-btn,
#next-btn {
  position: absolute;
  bottom: 20px;
  background: transparent;
  color:var(--bright-primary);
  border: 2px solid var(--bright-primary);
  padding: 16px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: normal;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  transition: all 0.2s ease-in-out;
  user-select: none;
  z-index: 10;
}
#prev-btn { left: 25px; }
#next-btn { right: 25px; }

#prev-btn:hover,
#next-btn:hover {
  opacity: 0.9;
}

#prev-btn:focus,
#next-btn:focus {
  outline: 2px solid #38bdf8; /* Fokus-Ring für Barrierefreiheit */
  outline-offset: 4px;
}

#close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: var(--bright-primary);
  border: 2px solid var(--bright-primary);
  padding: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 20;
}

#close-btn:hover {
  transform: rotate(90deg);
}
.image-lazy-wrapper {
  position: relative;
  display: block;
}
.image-lazy-wrapper.is-loading figcaption{
  display: none;
}
.image-lazy-wrapper.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--bright-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (min-width: 768px) {
  #gallery-dialog {
    max-width: 90vw;
  }

  .dialog-content {
    grid-template-columns: 80px 1fr 80px;
    grid-template-rows: 1fr;
    gap: 20px;
    width: 90vw;
    box-sizing: border-box;
  }

  #prev-btn, #next-btn {
    position: static;
  }

  #dialog-dynamic-content img {
    max-height: 70vh;
    display: block;
  }
  #dialog-dynamic-content figcaption {
    font: 400 1.25rem var(--font-sans);
  }

}
