/* ============================================================
   BASE STYLES
   ============================================================ */

body, html {
    margin: 0;
    padding: 0;
    background: #fff;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}


/* ============================================================
   VIDEO SECTIONS
   ============================================================ */

.video-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-video-section {
    width: 100%;
    position: relative;
    line-height: 0;
}

.simple-video-section video {
    width: 100%;
    height: auto;
    display: block;
}

/* Desktop: zeige Desktop, verstecke Mobile/Tablet */
.video-desktop  { display: block; }
.video-tablet   { display: none; }
.video-mobile   { display: none; }

.video-simple-desktop { display: block; }
.video-simple-mobile  { display: none; }


/* ============================================================
   SCROLL / STICKY CONTAINER
   ============================================================ */

.main__container {
    height: 180vh;
    position: sticky;
    background: #ffffff;
    overflow: visible;
}

.main__container-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 1200px;
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

.content-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    text-align: center;
    color: white;
    pointer-events: none;
}

/* ============================================================
   TEXT / NORMAL SECTIONS
   ============================================================ */

.text-section {
    position: relative;
    z-index: 10;
    background: #ffffff;
    margin-top: -80vh;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px;
}

.text-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    text-align: center;
}

.normal-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 70%;
}

/* ============================================================
   MGRID — TEAM SECTION
   ============================================================ */

.mgrid-section {
    position: relative;
    z-index: 999;
    background: #ffffff;
    padding: 120px 0;
    display: block;
    width: 100%;
}

.mgrid-section.light-theme {
    background-color: #f5f5f7;
    padding-top: 120px;
    margin-top: 120px;
}

.mgrid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

/* CARD */
.mgrid-card {
    background: #0a0e14;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.4s ease;
}

.mgrid-card:hover {
    border-color: #8da2b5;
}

/* VIDEO / IMAGE BOX */
.mgrid-video-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.mgrid-video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: grayscale(20%);
}

.mgrid-card:hover video {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.mgrid-card:hover .card-image {
    transform: scale(1.08);
}

/* CONTENT */
.mgrid-content {
    padding: 30px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.mgrid-content h1 {
    font-size: 0.8rem;
    color: #8da2b5;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.mgrid-content h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 15px;
}

.mgrid-content p {
    font-size: 0.95rem;
    color: #b0c4d4;
    line-height: 1.5;
    margin-bottom: 25px;
}

.mgrid-button-wrapper {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

/* ============================================================
   MGRID CAROUSEL — horizontales Scroll-Variant
   ============================================================ */

.mgrid-container.mgrid-container--carousel {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-left: 24px;
    gap: 16px;
    padding: 0 24px 20px;
    justify-content: safe center;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.mgrid-container.mgrid-container--carousel::-webkit-scrollbar {
    height: 4px;
}

.mgrid-container.mgrid-container--carousel::-webkit-scrollbar-track {
    background: transparent;
}

.mgrid-container.mgrid-container--carousel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Cards: feste Breite, Snap pro Card, nth-child-Overrides zurücksetzen */
.mgrid-container--carousel .mgrid-card,
.mgrid-container--carousel .mgrid-card:nth-child(n) {
    flex: 0 0 clamp(260px, 75vw, 320px);
    width: clamp(260px, 75vw, 320px);
    scroll-snap-align: start;
    grid-column: auto;
    margin: 0;
    min-height: auto;
}


/* LIGHT THEME OVERRIDES */
.light-theme .mgrid-card {
    background-color: #ffffff;
}

.light-theme .mgrid-content h1,
.light-theme .mgrid-content h2 {
    color: #1d1d1f;
}

.light-theme .mgrid-content p {
    color: #424245;
}

.light-theme .apple-toggle-btn {
    background-color: #909090;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .apple-toggle-btn:hover {
    background-color: #e8e8ed;
    transform: scale(1.05);
}

.light-theme .apple-toggle-btn__open {
    background-color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.light-theme .apple-toggle-btn__icon,
.light-theme .apple-toggle-btn__label a {
    color: #ffffff;
}


/* ============================================================
   RESPONSIVE — max-width: 1480px
   ============================================================ */

@media (max-width: 1480px) {
    .content-overlay {
        top: 30%;
    }
}


/* ============================================================
   RESPONSIVE — max-width: 1023px  (Tablet)
   ============================================================ */

@media (max-width: 1023px) {

    .main__container {
        height: 150vh;
        overflow: visible;
    }

    .content-overlay {
        top: 50%;
    }

    .video-desktop,
    .video-mobile {
        display: none;
    }

    .video-tablet {
        display: block;
    }

    .text-section {
        position: relative;
        z-index: 100;
        background: #fff;
        margin-top: -20vh;
        min-height: 50vh;
    }

    /* Grid → 2 Spalten */
    .mgrid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 30px;
    }

    .mgrid-card {
        grid-column: span 1;
        min-height: auto;
    }

    /* 5. Card zentriert alleine in Reihe 3 */
    .mgrid-card:nth-child(5) {
        grid-column: 1 / span 2;
        width: 50%;
        margin: 0 auto;
    }

    .mgrid-video-box {
        aspect-ratio: 1 / 1;
    }

}


/* ============================================================
   RESPONSIVE — max-width: 768px  (Mobile)
   ============================================================ */

@media (max-width: 768px) {

    .main__container {
        height: 100svh;
    }

    .normal-section .container {
        width: 80%;
        padding: 0;
    }

    .content-overlay {
        top: 50%;
    }

    .video-desktop,
    .video-tablet {
        display: none;
    }

    .video-mobile {
        display: block;
    }

    .video-mobile video {
        width: 100%;
        height: 100svh;
        object-fit: cover;
    }

    .video-simple-desktop { display: none; }
    .video-simple-mobile  { display: block; }

    .video-wrapper {
        position: relative;
        height: 100%;
        z-index: 1;
    }

    .text-section {
        position: relative;
        z-index: 100;
        background: #fff;
        margin-top: 0;
        padding: 60px 20px;
    }

    /* MGRID horizontal scrollbar */
    .mgrid-section {
        padding: 40px 0 60px 0;
        overflow: hidden;
    }

    .mgrid-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 0 20px 30px 20px;
        scrollbar-width: none;
    }

    .mgrid-container::-webkit-scrollbar {
        display: none;
    }

    .mgrid-card,
    .mgrid-card:nth-child(4),
    .mgrid-card:nth-child(5) {
        flex: 0 0 75%;
        width: 75%;
        grid-column: auto;
        scroll-snap-align: center;
        min-height: auto;
    }

    .mgrid-content {
        padding: 20px;
        min-height: 180px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .mgrid-content h2 {
        font-size: 1.2rem;
    }

    .mgrid-content p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0 0 15px 0;
        display: block;
        -webkit-line-clamp: none;
        overflow: visible;
    }

}
