
#projektebutton {
    text-decoration: none;
}

/* titel  */
body {
    background-image: none;
  }

h2 {
    display: flex;          /* Verwenden von Flexbox */
    flex-direction: column; /* Vertikale Anordnung der Elemente */
    justify-content: flex-start; /* Inhalt am Anfang der Seite (relativ oben) ausrichten */
    align-items: center;    /* Horizontal zentrieren */
    padding-top: 0px;
    margin-bottom: 20px; 
    margin-top: 30px;
    font-size: 2rem;    
    
}


h4 {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.6; /* Bessere Lesbarkeit */
    margin-bottom:40px ;
    margin-top: 40px;
}



.button-container {
    display: flex;
    justify-content: center;  /* Button zentrieren */
    align-items: center;
    margin-top: 40px;
    margin-bottom: 50px;  /* Genug Abstand zum Footer */
    width: 100%; 
}


.image-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 50px;  /* Genug Abstand nach oben */
    margin-bottom: 100px;  /* Abstand nach unten, damit es nicht den Footer überlappt */
    width: 100%;
    overflow: hidden;
    position: relative;
    max-height: auto;
}


.gallery-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Bilder pro Reihe */
    gap: 20px;
    max-width: 80%;
    max-width: 90%;
    width: 100%;
    margin: 0 auto; 
    max-height: auto;
}

.gallery-container img {
    width: 100%; /* Füllt die jeweilige Spalte */
    max-width: 500px; /* Maximale Breite der Bilder */
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
    object-fit: cover;
}

/* Hover-Effekt */
.gallery-container img:hover {
    transform: scale(1.05);
}

/* Responsives Design handy */
@media (max-width: 768px) {


    h2 {
        margin-top: 80px;
        text-align: center;
    }

    .gallery-container {
        grid-template-columns: repeat(1, 1fr); /* 1 Bild pro Zeile auf kleinen Screens */
    }

    .image-gallery {
        margin-bottom: 50px;
    }
    
    .bodyelements {
        max-height: 40vh;
    }


    .gallery-container img {
        max-width: 100%; /* Bilder füllen die gesamte Breite */
    }

    #lightbox {
        display: none !important;
    }

    /* Klick auf Bilder verhindern */
    .gallery-container img {
        pointer-events: none;
    }
}

/* Desktop-Ansicht (größer als 768px) */
@media (min-width: 769px) {
    
    .gallery-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* Drei Bilder pro Reihe */
        grid-template-rows: auto auto; /* Zwei Reihen */
        gap: 20px;
        max-width: 70%; /* Gesamtbreite etwas kleiner */
        width: 100%;
        margin: 0 auto;
    }

    .gallery-container img {
        width: 100%;
        height: auto;
        border-radius: 8px;
        transition: transform 0.3s ease-in-out;
        object-fit: cover;
    }

    /* Hover-Effekt: Nur der Bildinhalt vergrößert sich */
    .gallery-item {
        overflow: hidden; /* Verhindert, dass das Bild über den Rand hinausgeht */
        border-radius: 8px; /* Abgerundete Ecken bleiben erhalten */
        width: 100%;
        height: 100%;
    }

    .gallery-item img:hover {
        transform: scale(1.1); /* Vergrößert nur das Bild, aber nicht den Rahmen */
    }
}


/* Lightbox-Hintergrund */
.lightbox {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Leicht abgedunkelter Hintergrund */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

/* Vergrößertes Bild in der Lightbox */
#lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 10px;
    transition: transform 0.3s ease-in-out;
}

/* Schließen-Button */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* Navigation-Pfeile */
.lightbox-controls {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 15px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Cursor zu Hand ändern bei Hover auf Schließen-Button und Pfeile */
.close,
.lightbox-btn {
    cursor: pointer;
}

/* Animation für das Bild */
.lightbox img {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
