
#projektebutton {
    text-decoration: none;
}

/* titel  */


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;    
    
}

body {
    background-image: none;
  }
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 */
@media (max-width: 768px) {


    h2 {
        margin-top: 80px;
    }

    .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: 1fr 1fr; /* Zwei gleich große Spalten */
        grid-template-rows: auto auto auto; /* Drei Zeilen */
        gap: 20px;
        max-width: 50%;
        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;
    }

    /* Erste Reihe: Porsche.jpg alleine */
    .gallery-container img:nth-child(1) {
        grid-column: span 2; /* Nimmt die gesamte Breite ein */
        max-width: 100%;
    }

    /* Zweite Reihe: SL Wald.jpg und Porschegrau.jpg gleich groß nebeneinander */
    .gallery-container img:nth-child(2),
    .gallery-container img:nth-child(3) {
        grid-column: span 1; /* Jeder nimmt eine Spalte */
        width: 100%;
        height: 100%; /* Beide Bilder haben gleiche Höhe */
        max-width: 100%;
    }

    /* Dritte Reihe: SL Tunnel allein, wieder volle Breite */
    .gallery-container img:nth-child(4) {
        grid-column: span 2; /* Wieder über die volle Breite */
        max-width: 100%;
    }
}



/* Lightbox-Hintergrund */
.lightbox {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Dunkler 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);
    }
}
