/* Foto-Lightbox — eigene Datei, damit Browser keinen alten Cache von style.css nutzen */

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(12, 18, 15, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.photo-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.photo-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.photo-lightbox__panel > * {
  pointer-events: auto;
}

.photo-lightbox__stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  touch-action: pan-y;
  min-height: 40vh;
}

.photo-lightbox__frame {
  position: relative;
  flex: 1 1 auto;
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  isolation: isolate;
}

.photo-lightbox__img {
  position: relative;
  z-index: 0;
  max-width: min(96vw, 1100px);
  max-height: min(92vh, 92dvh, 1200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
}

.photo-lightbox__overlay-bottom .photo-lightbox__actions:empty {
  display: none;
}

/* Steuerelemente: einheitliches Glas (wie Untertitel-Karte, transparenter) */
.photo-lightbox__nav,
.photo-lightbox__close {
  border: 1px solid rgba(185, 201, 192, 0.45);
  border-radius: 999px;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(226, 235, 230, 0.32) 100%
  );
  color: var(--accent-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 18px rgba(25, 55, 40, 0.1);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.photo-lightbox__nav:hover,
.photo-lightbox__nav:focus-visible,
.photo-lightbox__close:hover,
.photo-lightbox__close:focus-visible {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(26, 122, 82, 0.28) 100%
  );
  border-color: rgba(26, 122, 82, 0.38);
  color: var(--accent-deep);
  box-shadow: 0 6px 20px rgba(26, 90, 61, 0.18);
  outline: none;
}

.photo-lightbox__nav:focus-visible,
.photo-lightbox__close:focus-visible {
  box-shadow:
    0 0 0 2px rgba(26, 122, 82, 0.35),
    0 6px 20px rgba(26, 90, 61, 0.18);
}

.photo-lightbox__nav-icon,
.photo-lightbox__close-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.photo-lightbox__nav-icon path,
.photo-lightbox__close-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-lightbox__nav {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
}

.photo-lightbox__nav:hover,
.photo-lightbox__nav:focus-visible {
  transform: translateY(-1px);
}

.photo-lightbox__nav--prev {
  order: 1;
}

.photo-lightbox__nav--next {
  order: 3;
}

.photo-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  width: 2.85rem;
  height: 2.85rem;
}

.photo-lightbox__close:hover,
.photo-lightbox__close:focus-visible {
  transform: scale(1.04);
}

.photo-lightbox__overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 0.35rem 0.5rem 0.5rem;
  pointer-events: none;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  display: block;
}

.photo-lightbox__overlay-bottom .photo-lightbox__caption-wrap,
.photo-lightbox__overlay-bottom .photo-lightbox__actions {
  pointer-events: auto;
}

.photo-lightbox__caption-wrap {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0.4rem;
  padding: 0.55rem 0.75rem 0.5rem;
  text-align: left;
  vertical-align: top;
  background: linear-gradient(
    180deg,
    rgba(226, 235, 230, 0.78) 0%,
    rgba(212, 224, 216, 0.82) 100%
  );
  border: 1px solid rgba(185, 201, 192, 0.65);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(25, 55, 40, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.photo-lightbox__caption-wrap:not(.is-expanded) .photo-lightbox__caption {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.photo-lightbox__caption-wrap.is-expanded .photo-lightbox__caption {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  white-space: pre-wrap;
}

.photo-lightbox__caption {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.photo-lightbox__caption:empty {
  display: none;
}

.photo-lightbox__caption-toggle {
  margin: 0.35rem 0 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.photo-lightbox__caption-toggle:hover,
.photo-lightbox__caption-toggle:focus-visible {
  color: var(--accent-deep);
  outline: none;
}

.photo-lightbox__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  vertical-align: top;
}

.photo-lightbox__tour {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #2d9d6a 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.photo-lightbox__tour:hover,
.photo-lightbox__tour:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.photo-lightbox__counter {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.25rem;
}

body.photo-lightbox-open {
  overflow: hidden;
}
