body {
    overflow-x: hidden;
}

html {
    scroll-padding-top: 100px; /* Passt den Offset für Sektionen an */
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: opacity 0.3s ease;
    opacity: 0.7;
}

.scroll-to-top:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Projekt Intro Bereich */
.project-intro {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide img {
    position: fixed;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moving-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300%;
    font-size: 8vw;
    font-weight: 800;
    color: white;
    white-space: nowrap;
    animation: moveTitle 30s linear infinite;
    text-align: center;
}

@keyframes moveTitle {
    0% { transform: translate(-16.66%, -50%); }
    100% { transform: translate(-83.33%, -50%); }
}

.content-wrapper {
    position: relative;
    z-index: 1;
    background-color: white;
}

/* Fade Animation */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

/* Container für einheitliche Randabstände */
.project-container {
    padding-top: 50px;
}

/* Sektionsbeschreibung */
.section-description {
    margin-bottom: 2rem;
    text-align: center;
}

/* Sektionsnavigation */
.section-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 4rem;
}

.section-nav a {
    width: calc(33.33% - 20px);
    max-width: 250px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    color: #fff;
    background-color: #f4f4f4;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.section-nav a img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-nav a span {
    position: relative;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    text-align: center;
}

.project-section {
    margin-bottom: 4rem;
}

.project-section h2 {
    margin: 0 auto;
    max-width: 2000px;
    padding: 10px;
}

.section-nav a.active {
    background-color: #333;
    color: #fff;
}

/* Bildergalerie */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    max-width: 2000px; /* Maximale Breite für sehr große Bildschirme */
    margin: 0 auto; /* Zentriert die Galerie */
}

.image-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.image-container.horizontal {
    flex-basis: calc(33.33% - 10px);
    padding-top: calc(22.22% - 6.67px); /* 3:2 Verhältnis */
}

.image-container.vertical {
    flex-basis: calc(16.66% - 10px);
    padding-top: calc(25% - 5px); /* 2:3 Verhältnis */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.lightbox-open {
    display: block;
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.lightbox-content {
    max-width: calc(100% - 100px);
    max-height: calc(100% - 100px);
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: #bbb;
}

.lightbox .prev,
.lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    padding: 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.lightbox .prev {
    left: 20px;
}

.lightbox .next {
    right: 20px;
}

.lightbox .prev:hover,
.lightbox .next:hover {
    background-color: rgba(255,255,255,0.4);
}

/* Responsive Anpassungen */
@media (max-width: 1600px) {
    .image-container.horizontal {
        flex-basis: calc(50% - 10px);
        padding-top: calc(33.33% - 6.67px);
    }
    .image-container.vertical {
        flex-basis: calc(25% - 10px);
        padding-top: calc(37.5% - 7.5px);
    }
}

@media (max-width: 1200px) {
    .image-container.horizontal {
        flex-basis: calc(66.66% - 10px);
        padding-top: calc(44.44% - 6.67px);
    }
    .image-container.vertical {
        flex-basis: calc(33.33% - 10px);
        padding-top: calc(50% - 5px);
    }
}

@media (max-width: 768px) {

    .project-intro {
        flex-direction: column;
    }

    .slideshow-container,
    .project-title {
        flex: none;
        width: 100%;
        height: auto;
    }

    .slideshow-container {
        height: 50vh;
    }

    .image-container.horizontal,
    .image-container.vertical {
        flex-basis: calc(50% - 10px);
    }
    .image-container.horizontal {
        padding-top: calc(33.33% - 6.67px);
    }
    .image-container.vertical {
        padding-top: calc(75% - 7.5px);
    }
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .image-container.horizontal,
    .image-container.vertical {
        flex-basis: 100%;
    }
    .image-container.horizontal {
        padding-top: 66.67%;
    }
    .image-container.vertical {
        padding-top: 150%;
    }
}