/* =========================
   Galerie Container
========================= */
.bildergalerie {
    max-width: 600px;
    margin: 20px auto;
    border: 2px solid #ccc;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    background-color: #fdfdfd;
    border-radius: 12px;
    position: relative;
}

/* Hauptbild */
.bildergalerie .slideshow {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
}

.bildergalerie .slideshow img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

/* Thumbnails */
.bildergalerie .thumbnails {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.bildergalerie .thumbnails img {
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #aaa;
    transition: border 0.3s;
}

.bildergalerie .thumbnails img.active,
.bildergalerie .thumbnails img:hover {
    border-color: #007bff;
}

/* =========================
   Fullscreen Modal
========================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    text-align: center;
    color: #fff;
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-title {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.modal-date {
    font-size: 1em;
    margin-bottom: 10px;
    color: #ccc;
}

.modal-entry-text {
    margin-bottom: 15px;
}

/* Modal Bild */
.modal-image {
    max-width: 100%;
    max-height: 70vh;
    margin-bottom: 10px;
}

/* Modal Controls */
.modal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-controls button {
    padding: 8px 12px;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
}

.modal-controls button:hover {
    background: #0056b3;
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
}

/* =========================
   Responsive Media Queries
========================= */
@media (max-width: 768px) {
    .bildergalerie {
        max-width: 90%;
    }

    .bildergalerie .slideshow {
        height: 250px;
    }

    .bildergalerie .thumbnails img {
        height: 50px;
    }

 	/* --- Sanfte Überblendung der Diashow-Bilder --- */
	.modal-image {
      max-height: 60vh;
 	  transition: opacity 0.6s ease-in-out, transform 0.3s ease;
	  opacity: 1;
	}

	.modal-image.fade-out {
	  opacity: 0;
	}
}

@media (max-width: 480px) {
    .bildergalerie .slideshow {
        height: 200px;
    }

    .bildergalerie .thumbnails img {
        height: 40px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-controls button {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .modal-title {
        font-size: 1.2em;
    }

    .modal-date {
        font-size: 0.9em;
    }
}

/* --- Galerie Buttons & Responsive Fixes --- */
.modal-image-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.prev-image, .next-image {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}

.prev-image:hover, .next-image:hover {
  background: rgba(0, 0, 0, 0.7);
}

.prev-image { left: 1rem; }
.next-image { right: 1rem; }

.modal-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pause-play, .close-modal {
  padding: 0.5rem 1rem;
  border: none;
  background: #444;
  color: #fff;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

.pause-play:hover, .close-modal:hover {
  background: #666;
}

@media (max-width: 600px) {
  .prev-image, .next-image {
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
  }
  .modal-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* --- Pause-Button fix über dem Bild halten --- */
.pause-play {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 20; /* über dem Bild */
}

@media (max-width: 600px) {
  .pause-play {
    bottom: 0.5rem;
    right: 0.5rem;
  }
}