body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
}

/* --- Galerie-Layout (Miniaturbilder) --- */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* --- Lightbox-Layout (Vollbild) --- */
.lightbox {
    display: none; 
    position: fixed; /* Fixiert auf dem gesamten Bildschirm */
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
    transition: opacity 0.3s ease-in-out; 
    opacity: 0; 
}

/* Aktiviert die Sichtbarkeit der Lightbox */
.lightbox.active {
    display: flex; /* Für Zentrierung */
    align-items: center; 
    justify-content: center; 
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 3px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
}

/* --- Korrigierte Navigationspfeile --- */
.prev, .next {
    cursor: pointer;
    position: absolute; /* Muss absolut sein */
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 25px;
    transition: 0.6s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.5); 
    z-index: 1001; /* Stellt sicher, dass die Pfeile über dem Bild sind */
}

/* Positioniert den "Zurück"-Pfeil ganz links */
.prev {
    left: 0; 
    border-radius: 0 3px 3px 0;
}

/* Positioniert den "Weiter"-Pfeil ganz rechts */
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* Ändert den Hintergrund beim Darüberfahren */
.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

@media only screen and (max-width: 700px) {
  .lightbox-content {
    width: 100%;
  }
}