body {
    font-family: system-ui, sans-serif;
    margin: 0;
    background: #f4f4f4;
    padding: 2rem;
  }

  h1 {
    text-align: center;
  }

  .popup-trigger {
    cursor: pointer;
    height: 100%;
    width: 100%;
    border-radius: 8px;
    transition: transform 0.2s;
  }
  .popup-trigger:hover {
    transform: scale(1.03);
  }

  /* --- Trigger-Bild mit Overlay-Text --- */
.popup-image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.popup-image-preview {
  cursor:pointer; 
  flex: 1 0 0%;
  object-fit:cover;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Beim Hover: leichte Vergrößerung & Abdunklung */
.popup-image-wrapper:hover .popup-image-preview {
  transform: scale(1.05);
  filter: brightness(0.8);
}

/* Overlay-Text */
.popup-image-text {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none; /* Text blockiert keine Klicks */
}

/* Default-Text: standardmäßig sichtbar */
.default-text {
  opacity: 1;
  transition: opacity 0.3s ease;
  font-size: 35px;
}

/* Hover-Text: standardmäßig unsichtbar */
.hover-text {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 25px;
  margin-top: 85px;
}

/* Beim Hover des Wrappers */
/*.popup-image-wrapper:hover .default-text {
  opacity: 0; 
}*/

.popup-image-wrapper:hover .hover-text {
  opacity: 1; /* Hover-Text einblenden */
}



/* --- POPUP STYLES --- */
  .popup {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }

  .popup.active {
    display: flex;
  }

  .popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 1000;
    pointer-events: auto;
  }

  .popup-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    width: 80vw;
    max-width: 80%;
    height: 80vh;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    animation: popupFade 0.25s ease;
    overflow: hidden;
    pointer-events: auto;
  }

  .popup-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
    min-height: 0;
    overscroll-behavior: contain;
    touch-action: auto;
    scrollbar-gutter: stable;
  }

  .popup-body::-webkit-scrollbar {
    width: 10px;
  }

  .popup-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
  }

  .popup-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    color: #000;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
  }

  /*ein Beitragsbild*/
  .popup-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    /*cursor: zoom-in;
    transition: transform 0.3s ease;*/
  }

  /*.popup-image:hover {
    transform: scale(1.5);
  }*/

  /*Galerie*/
  .popup-gallery {
    display: flex;
    gap: 10px; /* Abstand zwischen den Bildern */
    flex-wrap: wrap; /* Zeilenumbruch bei kleinerem Bildschirm */
    margin-bottom: 20px;
  }

  .popup-thumb {
    width: 200px; /* kleine Größe, anpassen nach Wunsch */
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s;
  }

  .popup-thumb:hover {
    transform: scale(1.1);
  }

  .popup-title {
    margin-top: 0;
    font-size: 1.5rem;
  }

  .popup-text {
    line-height: 1.6;
    font-size: 1.5rem;
  }
 * === Button unterhalb der Bilder === */
.popup-more-btn {
  display: inline-block;
  background-color: #07445f;     /* Füllfarbe */
  color: #fff;                   /* Textfarbe */
  padding: 10px 28px;            /* Innenabstand */
  border: 2px solid #07445f;     /* ovale Umrandung */
  border-radius: 50px;           /* Ovalform */
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.popup-more-btn:hover {
  background-color: transparent; /* invertiert beim Hover */
  color: #07445f;
}

/* Zentrierung im Popup-Inhalt */
.popup-body {
  text-align: center;
}

  @keyframes popupFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }

  @media (max-width: 600px) {
    .popup-content {
      width: 95vw;
      height: 85vh;
    }
    .popup-body {
      padding: 16px;
    }
  }
  @media (max-width: 600px) {
    .popup-image-wrapper {
      width: 100%;
    }
  }
