:root {
    --carousel-transparent-percentage: 10%;
}

.custom-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-track-wrapper {
    overflow: visible;
    padding: 0;
    margin: 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.carousel-slide {
    position: relative;
    flex: 0 0 60%;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
    perspective: 2000px;
    padding: 3em;
    border-radius: 2em;
}

.carousel-slide img {
    width: 100%;
    display: block;
    transition: opacity 0.5s ease, transform 1.5s ease;
    transform: rotateX(20deg);
    box-shadow: 0 4px 8px rgba(200, 200, 200, 0.3), 0 6px 20px rgba(200, 200, 200, 0.2);
    transform-style: preserve-3d; /* wichtig für tiefe Wirkung */
    border-radius: 2em;
}

.carousel-slide.active {
    opacity: 1;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
}

.carousel-slide.active img:hover
{
    transform: rotateX(0deg) scale(1.25) translateX(-3em);
}

.carousel-slide.active img:focus
{
    transform: rotateX(0deg) scale(1.25) translateX(-3em);
}

.carousel-slide.left {
    opacity: 1;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
}

.carousel-slide.right {
    opacity: 1;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
}

.carousel-slide.left.hidden {
    opacity: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity 0.5s ease;
}

.carousel-slide.right.hidden {
    opacity: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0) var(--carousel-transparent-percentage));
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: opacity 0.5s ease;
}

.carousel-slide.hidden-final {
    visibility: hidden;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    margin-top: 5em;
}

.carousel-nav-btn {
    position: relative;
    flex: 0 0 auto;
    min-width: 7em;
    text-align: center;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--inactive-grey);
}

.carousel-nav-btn h4{
    margin-left: 2em;
    margin-right: 2em;
    font-family: 'IBrand', sans-serif;
    letter-spacing: 0.2em;
}

/* Der Unterstrich */
.carousel-nav-btn::after {
    content: "";
    position: absolute;
    bottom: -0.5em;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--inactive-grey); /* Standardfarbe */
}

/* Aktiver Button */
.carousel-nav-btn.active::after {
    background-color: var(--white); /* Aktive Farbe */
}

.carousel-nav-btn:hover {
    background: var(--highlight-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* optional: auch für Firefox */
    background-clip: text;
    color: transparent;
}

.carousel-nav-btn.active {
    background: var(--highlight-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* optional: auch für Firefox */
    background-clip: text;
    color: transparent;
    font-weight: bold;
}

.carousel-nav-btn.active h4 {
    font-weight: bold;
    font-size: 1.1em;
}

.carousel-description {
    position: relative;
    text-align: center;
    margin-top: 3em;
    height: 30em; /* verhindert Layout-Springen */
    width: 100%;
}

.carousel-description-text {
    opacity: 0;
    transition: opacity 0.5s ease;
    position: absolute;
    width: 60%;
    left: 50%;
    top: 0;
    pointer-events: none;
    color: var(--dark-white);
    white-space: pre-line;
    line-height: 1.5em;
    transform: translate(-50%, -10%);
}

.carousel-description-text p {
    font-size: 1.5em;
    margin: 0;
    font-family: 'IBrand', sans-serif;
    letter-spacing: 0.2em;
    line-height: 1.5em;
}

.carousel-description-text.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.carousel-description-text-icon-container {
    display: flex;
    width: 100%;
    height: fit-content;
    gap: 4em; /* optional für gleichmäßige Abstände */
}

.carousel-description-text-icon-container .icon {
    width: 33%;    
    padding: 0.5em;
    backdrop-filter: blur(25px) saturate(151%);
    -webkit-backdrop-filter: blur(25px) saturate(151%);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 2em;
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.carousel-description-text-icon-container .icon span {
    font-size: 2.5em;
    color: var(--dark-white)
}

.carousel-description-text-icon-container .icon h5 {
    font-size: 1.1em;
    color: var(--dark-white);
    margin: 0;
    margin-bottom: 0.1em;
    height: 2em;
}

.carousel-description-text-icon-container .icon p {
    font-size: 1.0em;
    color: var(--inactive-grey);
    margin: 0;
    height: 6em;
    font-family: 'Mono', sans-serif;
    letter-spacing: 0.0em;
}
@media screen and (max-width: 1920px) {
    .carousel-description-text {
        width: 80%;
    }

    .carousel-slide {
        position: relative;
        flex: 0 0 80%;
        cursor: pointer;
        transition: transform 0.5s ease, opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
        perspective: 2000px;
        padding: 2em;
        border-radius: 1em;
    }
}

@media screen and (max-width: 1500px) {
    .carousel-description-text {
        width: 70%;
    }
}

@media screen and (max-width: 1200px) {

    .carousel-description {
        position: relative;
        text-align: center;
        margin-top: 3em;
        height: 45em; /* verhindert Layout-Springen */
        width: 100%;
    }

    .carousel-description-text {
        opacity: 0;
        transition: opacity 0.5s ease;
        position: absolute;
        width: 96%;
        left: 50%;
        top: 2em;
        pointer-events: none;
        color: var(--dark-white);
        white-space: pre-line;
        line-height: 1.5em;
        transform: translate(-50%, -10%);
        bottom: 0;
    }
    
    .carousel-description-text-icon-container {
        gap: 4em; /* optional für gleichmäßige Abstände */
    }

    .carousel-description-text-icon-container .icon {
        width: 100%;
        padding: 0.5em;
        backdrop-filter: blur(25px) saturate(151%);
        -webkit-backdrop-filter: blur(25px) saturate(151%);
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 2em;
        border: 1px solid rgba(255, 255, 255, 0.125);
        height: 20em;
    }

    .carousel-slide {
        position: relative;
        flex: 0 0 80%;
        cursor: pointer;
        transition: transform 0.5s ease, opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
        perspective: 2000px;
        padding: 2em;
        border-radius: 1em;
    }
}

@media screen and (max-width: 768px) {
    
    .carousel-description {
        position: relative;
        text-align: center;
        margin-top: 3em;
        height: 75em; /* verhindert Layout-Springen */
        width: 100%;
    }
    
    .carousel-description-text {
        opacity: 0;
        transition: opacity 0.5s ease;
        position: absolute;
        width: 96%;
        left: 50%;
        top: 4em;
        pointer-events: none;
        color: var(--dark-white);
        white-space: pre-line;
        line-height: 1.5em;
        transform: translate(-50%, -10%);
        bottom: 0;
    }

    .carousel-description-text-icon-container {
        gap: 1em; /* optional für gleichmäßige Abstände */
        flex-direction: column;
    }

    .carousel-slide {
        position: relative;
        flex: 0 0 100%;
        cursor: pointer;
        transition: transform 0.5s ease, opacity 0.5s ease, -webkit-mask-image 0.5s ease, mask-image 0.5s ease;
        perspective: 2000px;
        padding: 2em;
        border-radius: 1em;
    }

    .carousel-description-text-icon-container .icon {
        width: 100%;
        padding: 0.5em;
        backdrop-filter: blur(25px) saturate(151%);
        -webkit-backdrop-filter: blur(25px) saturate(151%);
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 2em;
        border: 1px solid rgba(255, 255, 255, 0.125);
        height: 15em;
        font-size: 1.3em;
    }
}

