/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: rgb(19, 19, 19);
    --bg-footer: rgb(15, 15, 15);
    --text-white: white;
    --text-grey: #888;
    
    /* Animation Settings */
    --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;
}

/* =========================================
   2. HEADER
   ========================================= */
.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;
}

/* =========================================
   3. GALLERY CONTAINER
   ========================================= */
.gallery-container {
    display: flex;
    flex-direction: row; /* Default: Desktop Row */
    flex-shrink: 0;
    
    width: 95vw;
    height: 82vh;
    margin: 0 auto;
    
    background-color: var(--bg-dark);
    overflow: hidden;
}

/* =========================================
   4. PANEL BASIS & IMAGES
   ========================================= */
.panel {
    position: relative;
    height: 100%;
    flex: 1;
    margin: 0 2px;
    cursor: pointer;
    
    /* Smooth Flex Transition */
    transition: flex var(--anim-speed) var(--anim-curve);
    overflow: hidden; 
}

/* Hintergrundbilder */
.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);
}

/* Desktop Clip-Paths & Specifics */
.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; /* Center liegt obenauf */
}

.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%);
}

/* =========================================
   5. PANEL TEXT & BADGE
   ========================================= */

.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: 0.6rem;
}

/* VOR-ORT-SERVICE BADGE */
.service-badge {
    position: absolute;
    top: 5%;
    right: 20%; /* Etwas weiter nach links gerückt wegen der Schräge */
    z-index: 150;
    
    width: 120px;
    height: 120px;
    border: 2px solid white;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
    padding: 10px;
    
    /* Leicht transparenter Hintergrund, damit man es auf unruhigen Bildern lesen kann */
    background-color: rgba(0, 0, 0, 0.4); 
    pointer-events: none;
    
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--anim-speed) var(--anim-curve), transform var(--anim-speed) var(--anim-curve);
}

/* =========================================
   6. INTERAKTION / ACTIVE STATES
   ========================================= */

.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; 
}

.panel.active .service-badge {
    opacity: 1;
    transform: scale(1);
}

/* HOVER (Nur Desktop/Maus) */
@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;
    }
    .panel:hover .service-badge {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.socials {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    width: 90vw;
    height: 8vh;
    margin: 0 auto;
    
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-size: 1vw;
    z-index: 200;
}

.socials > a:first-child {
    justify-self: start;
    text-align: left;
}

.socialsFlex {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 0.2rem;
}

.socialsFlex a {
    font-size: 1.2vw;
}

.socials > a:last-child {
    justify-self: end;
    text-align: right;
}

.instagramLogo {
    width: 40px;
}

.socialsFlex a {
    font-size: 1.2vw;
}

.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;
}

.impressumList {
    display: grid;
    width: 40vw;
    margin: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    align-items: center;
    gap: 1rem;
}
.impressumListItemLeft {
  text-align: right;
  padding-right: 8rem;
}
.impressumListItemRight {
  text-align: left;
  padding-left: 8rem;
}

.gridSpanTwo {
  grid-column-end: span 2;
}

/* =========================================
   8. MEDIA QUERIES
   ========================================= */

/* --- MOBILE (< 768px) --- */
@media (max-width: 768px) {
    .socials > a:first-child,
    .socials > a:last-child {
        display: none;
    }
    
    .socials {
        justify-content: space-around;
        font-size: 3vw;
        width: 100vw;
        height: auto;
        padding: 6px 0;
        box-sizing: border-box;
    }
    
    .socialsFlex {
        width: 100vw;
        justify-content: center;
        align-items: center;
    }
    
    .socialsFlex a {
        font-size: 4vw;
    }
    .header {
        font-size: 4vw;
        height: 8vh;
    }

    .gallery-container {
        flex-direction: column;
        height: 83vh;
        width: 100%;
    }

    .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%);
    }

    .panelTitle {
        font-size: 2rem; 
        transform: translate(-50%, -50%) scale(0.6); 
        -webkit-transform: translate(-50%, -50%) scale(0.6);
    }

    .panel.active {
        flex: 4;
    }

    .panel.active .panelTitle {
        top: 20%;
        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;
    }

    /* Anpassung Badge auf Mobile */
    .service-badge {
        width: 70px;
        height: 70px;
        font-size: 0.7rem;
        top: 10%; /* Auf Mobile etwas tiefer setzen */
        right: 7%;
    }

    .instagramLogo {
        width: 22px;
        height: auto;
    }
    
    .impressum {
        font-size: 3.5vw;
    }
    
    .impressum h3 {
        font-size: 7vw;
    }

        .impressumList {
            display: flex;
            flex-direction: column;
            width: 90vw;
            margin: auto;
            gap: 1.2rem;
            align-items: center;
        }
        .impressumListItemLeft,
        .impressumListItemRight {
            text-align: center;
            padding: 0;
            width: 100%;
        }
        .gridSpanTwo {
            width: 100%;
            text-align: center;
        }
}

/* --- TABLET (768px - 1366px) --- */
@media only screen and (min-width: 768px) and (max-width: 1366px) {
    
    .header {
        height: 8vh;
        font-size: 1.8vw;
    }

    .socials {
        font-size: 2.2vw;
        height: 6vh;
    }
    
    .socialsFlex a {
        font-size: 2vw;
    }
    
    .instagramLogo {
        width: 38px;
    }

    .impressum {
        font-size: 2vw;
        padding: 30px;
    }

    .impressum h3 {
        font-size: 2.5vw;
        margin-bottom: 15px;
    }

    .impressumList {
        width: 90vw;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .impressumListItemLeft {}
    .impressumListItemRight {
        text-align: center;
        padding: 0;
    }

    /* 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%);
        }

        .panelTitle {
            font-size: 5vw; 
            top: 50%;
            transform: translate(-50%, -50%) scale(0.5); 
            -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;
        }

        /* Anpassung Badge auf Tablet Hochformat */
        .service-badge {
            top: 8%;
            right: 15%;
        }
    }

    /* TABLET LANDSCAPE (Querformat) */
    @media (orientation: landscape) {
        .gallery-container {
            flex-direction: row;
        }
        
        .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%);
        }

        .panelTitle {
            font-size: 3vw; 
            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);
        }
        
        /* Anpassung Badge auf Tablet Querformat */
        .service-badge {
            right: 10%;
            width: 100px;
            height: 100px;
        }
    }
}
