:root {
    --bg-dark: rgb(19, 19, 19);
    --bg-footer: rgb(15, 15, 15);
    --text-white: white;
    --text-grey: #888;
    
    
    --anim-speed: 0.7s;
    --anim-curve: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-dark);
    -webkit-tap-highlight-color: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
}


.header {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 200;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 100vw;
    height: 10vh;
    
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-size: 1.5vw;
}

.linkStyling {
  color: white;
}


.gallery-container {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    
    width: 100vw;
    height: 85vh;
    margin: 0 auto;
    
    background-color: var(--bg-dark);
    overflow: hidden;
}

.panel {
    position: relative;
    height: 100%;
    flex: 1;
    margin: 0 2px;
    cursor: pointer;
    
    transition: flex var(--anim-speed) var(--anim-curve);
    overflow: hidden; 
}

.panel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-position: center;
    background-size: cover;
    filter: none;
    opacity: 1;
    pointer-events: none;
    
    transition: opacity var(--anim-speed) var(--anim-curve),
                filter var(--anim-speed) var(--anim-curve);
}


.img-left {
    background-image: url("public/car1.jpg");
    clip-path: polygon(0% 0%, 100% 0%, calc(100% - 10vh) 100%, 0% 100%);
}

.panel.center {
    margin-left: -10vh;
    margin-right: -10vh;
    z-index: 5;
}

.img-center {
    background-image: url("public/car2.jpg");
    clip-path: polygon(10vh 0%, 100% 0%, calc(100% - 10vh) 100%, 0% 100%);
}

.panel.right {
    z-index: 4;
}

.img-right {
    background-image: url("public/car3.jpg");
    clip-path: polygon(10vh 0%, 100% 0%, 100% 100%, 0% 100%);
}


.panelTitle {
    position: absolute;
    z-index: 20;
    
    top: 50%; 
    left: 50%;
    
    color: var(--text-white);
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
    
    background-color: rgba(19, 19, 19, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
    pointer-events: none;

    font-size: 3vw; 

    transform: translate(-50%, -50%) scale(0.5); 
    -webkit-transform: translate(-50%, -50%) scale(0.5);

    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;

    
    transition: 
        top var(--anim-speed) var(--anim-curve),
        transform var(--anim-speed) var(--anim-curve),
        background-color var(--anim-speed) ease;

    will-change: transform, top;
}

.panelBody {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 100%;
    text-align: center;
    list-style: none;
    
    font-size: 1.7vw;
    color: var(--text-white);
    
    opacity: 0;
    pointer-events: none;
    transition-delay: 0s;
}

.panelBody li {
    margin: 1rem;
}

.panel.active {
    flex: 1.5;
    z-index: 100 !important;
}

.panel.active .panel-image {
    opacity: 0.1;
    filter: blur(10px);
}

.panel.active .panelTitle {
    top: 15%;
    
    background-color: transparent;
    
    transform: translate(-50%, -50%) scale(1);
    -webkit-transform: translate(-50%, -50%) scale(1);
}

.panel.active .panelBody {
    opacity: 1;
    transition: opacity 0.5s ease 0.25s;
}


@media (hover: hover) {
    .panel:hover {
        flex: 2.5;
        z-index: 100 !important;
    }
    .panel:hover .panel-image {
        opacity: 0.1;
        filter: blur(10px);
    }
    .panel:hover .panelTitle {
        top: 15%;
        background-color: transparent;
        transform: translate(-50%, -50%) scale(1);
        -webkit-transform: translate(-50%, -50%) scale(1);
    }
    .panel:hover .panelBody {
        opacity: 1;
        transition-delay: 250ms;
    }
}


footer {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.socials {
    
    display: grid;
    
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    width: 90vw;
    height: 5vh;
    margin: 0 auto;
    
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-size: 1vw;
    z-index: 200;
}

/* Linkes Element (Telefon) -> Links */
.socials > a:first-child {
    justify-self: start;
    text-align: left;
}

/* Mittleres Element (Socials) -> Mitte */
.socialsFlex {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 0.5rem;
}

/* Rechtes Element (Email) -> Rechts */
.socials > a:last-child {
    justify-self: end;
    text-align: right;
}

.instagramLogo {
    width: 35px;
}

.impressum {
    width: 100%;
    padding: 20px;
    flex-shrink: 0;
    background-color: var(--bg-footer);
    color: var(--text-grey);
    text-align: center;
    border-top: 1px solid #333;
    font-size: 1vw;
}

.impressum ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.impressum li {
    margin: 0;
}

/* =========================================
   8. MEDIA QUERIES
   ========================================= */

/* --- MOBILE (< 768px) --- */
@media (max-width: 768px) {
    .header {
        font-size: 4vw;
        height: 8vh;
    }

    .gallery-container {
        flex-direction: column;
        height: 83vh;
        width: 100%;
    }

    /* Stack Logic */
    .panel {
        width: 100%;
        margin: 0;
    }

    .img-left {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6vh), 0 100%);
    }

    .panel.center {
        margin: -6vh 0;
        z-index: 5;
    }

    .img-center {
        clip-path: polygon(0 6vh, 100% 0, 100% calc(100% - 6vh), 0 100%);
    }

    .img-right {
        clip-path: polygon(0 6vh, 100% 0, 100% 100%, 0 100%);
    }

    /* MOBILE TEXT SCALING */
    .panelTitle {
        /* Zielgröße für Mobile (Active) */
        font-size: 2rem; 
        /* Inaktiv etwas kleiner skalieren */
        transform: translate(-50%, -50%) scale(0.6); 
        -webkit-transform: translate(-50%, -50%) scale(0.6);
    }

    .panel.active {
        flex: 4;
    }

    .panel.active .panelTitle {
        top: 20%;
        /* Full Scale */
        transform: translate(-50%, -50%) scale(1);
        -webkit-transform: translate(-50%, -50%) scale(1);
    }

    .panelBody {
        font-size: 1.1rem;
        width: 90%;
    }
    
    .panelBody li {
        margin: 0.5rem;
    }

    /* Mobile Footer */
    .socials a {
        font-size: 2.2vw;
    }

    .socials p {
        font-size: 2.2vw;
    }

    .instagramLogo {
        width: 25px;
    }
    
    .impressum {
        font-size: 3.5vw;
    }
    
    .impressum h3 {
        font-size: 7vw;
    }
}

/* --- TABLET (768px - 1366px) --- */
@media only screen and (min-width: 768px) and (max-width: 1366px) {
    
    .header {
        height: 8vh;
        font-size: 1.8vw;
    }

    .socials {
        /* Grid bleibt, Schriftgröße angepasst */
        font-size: 1.8vw;
        height: 6vh;
    }
    
    .instagramLogo {
        width: 25px;
    }

    .impressum {
        font-size: 1.5vw;
    }

    /* TABLET PORTRAIT (Hochformat) */
    @media (orientation: portrait) {
        .gallery-container {
            flex-direction: column;
            height: 84vh;
        }

        .panel {
            width: 100%;
            margin: 0;
            flex: 1;
        }

        .img-left {
            clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vh), 0 100%);
        }

        .panel.center {
            margin: -4vh 0;
        }

        .img-center {
            clip-path: polygon(0 4vh, 100% 0, 100% calc(100% - 4vh), 0 100%);
        }

        .img-right {
            clip-path: polygon(0 4vh, 100% 0, 100% 100%, 0 100%);
        }

        /* TEXT SCALING PORTRAIT */
        .panelTitle {
            font-size: 5vw; /* Zielgröße */
            top: 50%;
            transform: translate(-50%, -50%) scale(0.5); /* Inaktiv klein */
            -webkit-transform: translate(-50%, -50%) scale(0.5);
        }

        .panel.active {
            flex: 5;
        }

        .panel.active .panelTitle {
            top: 15%;
            transform: translate(-50%, -50%) scale(1);
            -webkit-transform: translate(-50%, -50%) scale(1);
        }

        .panelBody {
            font-size: 2.2vw;
            width: 85%;
            line-height: 1.6;
        }
        
        .panelBody li {
            margin: 0.8rem;
        }
    }

    /* TABLET LANDSCAPE (Querformat) */
    @media (orientation: landscape) {
        .gallery-container {
            flex-direction: row;
        }
        
        /* Clip-Paths für Landscape */
        .img-left {
            clip-path: polygon(0% 0%, 100% 0%, calc(100% - 6vh) 100%, 0% 100%);
        }

        .panel.center {
            margin-left: -6vh;
            margin-right: -6vh;
        }

        .img-center {
            clip-path: polygon(6vh 0%, 100% 0%, calc(100% - 6vh) 100%, 0% 100%);
        }

        .img-right {
            clip-path: polygon(6vh 0%, 100% 0%, 100% 100%, 0% 100%);
        }

        /* TEXT SCALING LANDSCAPE */
        .panelTitle {
            font-size: 3.5vw;
            background-color: rgba(19, 19, 19, 0.85);

            transform: translate(-50%, -50%) scale(0.6);
            -webkit-transform: translate(-50%, -50%) scale(0.6);
        }

        .panelBody {
            font-size: 1.8vw;
            width: 90%;
        }

        .panel.active .panelTitle {
            top: 15%;
            transform: translate(-50%, -50%) scale(1);
            -webkit-transform: translate(-50%, -50%) scale(1);
        }
    }
}
