.bf-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1); /* Start: voll schwarz */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;

  /* Smooth: GPU-optimiert über transform */
  transform: translateY(-100%);
  animation: bfCurtain 6s ease-out forwards;
}

/* Vorhang-Effekt (per transform statt top) */
@keyframes bfCurtain {
  0% {
    transform: translateY(-100%);
    background: rgba(0, 0, 0, 1);
  }
  50% {
    transform: translateY(0);
    background: rgba(0, 0, 0, 1);
  }
  100% {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0); /* Schwarz weg, Bild bleibt */
  }
}

/* Bewegung reduzieren → keine Animation, kein dunkler Schleier */
@media (prefers-reduced-motion: reduce) {
  .bf-overlay {
    animation: none;
    transform: translateY(0);
    background: rgba(0, 0, 0, 0);
  }
}

/* Bild-Container: Desktop 500px, mobil max 90vw */
.bf-image-container {
  position: relative;
  display: inline-block;
  width: 500px;
  max-width: 90vw;
  /* Höhe nicht fest verdrahten, das Bild bestimmt die Höhe */
}

/* Bild skaliert sich mit der Breite */
.bf-main-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Close-Button oben rechts über dem Bild */
.bf-close-button {
  position: absolute;
  top: -36px;
  right: 0;
  font-size: 24px;
  color: #fff;
  border: none;
  cursor: pointer;
  background: transparent; /* kein Hintergrund */
  display: none;           /* wird nach Animation eingeblendet */
  z-index: 20;
}

/* Auf sehr schmalen Bildschirmen etwas „reinziehen“ */
@media (max-width: 600px) {
  .bf-close-button {
    top: -30px;
    right: 5px;
  }
}

/* Close-Button erst nach Ende der Animation anzeigen */
.bf-overlay.bf-transparent .bf-close-button {
  display: block;
}