/* formstube · Beleg-Lightbox · Universal-Komponente
 * ════════════════════════════════════════════════════════════════
 * Zeigt PDFs (iframe) und Bilder (img) fullscreen im Brand-Look
 * statt target=_blank. Schließbar via ESC, Click-Outside, X-Button.
 *
 * Auto-Attach via [data-fs-lightbox] auf <a>-Tags.
 * Lädt fs-lightbox.js und greift dort den Klick ab.
 */

.fs-lb {
  position: fixed;
  inset: 0;
  z-index: 9998; /* unter fs-modal (9999) damit confirm-Dialoge davor liegen */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out, ease-out);
}
.fs-lb.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fs-lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.fs-lb-stage {
  position: relative;
  z-index: 1;
  width: min(94vw, 1100px);
  height: min(94vh, 1400px);
  background: var(--charcoal, #131418);
  border: 1px solid var(--graphite, #2A2C30);
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.28s var(--ease-out, ease-out);
}
.fs-lb.is-open .fs-lb-stage { transform: scale(1); }

.fs-lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--ink, #0A0A0C);
  border-bottom: 1px solid var(--graphite, #2A2C30);
  flex-shrink: 0;
}
.fs-lb-title {
  flex: 1;
  min-width: 0;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-lb-title strong {
  color: var(--accent, #D8FF3C);
  font-weight: 700;
  margin-right: 8px;
}
.fs-lb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.fs-lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: transparent;
  color: var(--fg-mute, #888);
  border: 1px solid var(--graphite, #2A2C30);
  border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.fs-lb-btn:hover {
  color: var(--accent, #D8FF3C);
  border-color: var(--accent, #D8FF3C);
}
.fs-lb-btn-close {
  background: rgba(255, 79, 94, 0.08);
  border-color: rgba(255, 79, 94, 0.4);
  color: #FF4F5E;
  width: 36px;
  padding: 7px 0;
  justify-content: center;
  font-size: 1rem;
}
.fs-lb-btn-close:hover {
  background: rgba(255, 79, 94, 0.18);
  border-color: #FF4F5E;
  color: #FF4F5E;
}

.fs-lb-content {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #2A2C30;
  overflow: hidden;
}
.fs-lb-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #FFFFFF; /* PDFs sind meistens weiß · sieht sauberer aus */
}
.fs-lb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fs-lb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #D8FF3C);
  font-family: 'Geist Mono', monospace;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink, #0A0A0C);
  z-index: 2;
}
.fs-lb-loading.is-hidden { display: none; }

/* Mobile · Lightbox füllt fast den ganzen Screen */
@media (max-width: 720px) {
  .fs-lb-stage {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border: 0;
  }
  .fs-lb-head { padding: 12px 14px; }
  .fs-lb-title { font-size: 0.72rem; }
  .fs-lb-btn { padding: 8px 10px; font-size: 0.68rem; }
  .fs-lb-btn-close { width: 40px; padding: 8px 0; }
}

/* Body-Lock wenn Lightbox offen · verhindert Hintergrund-Scroll */
body.fs-lb-open { overflow: hidden; }
