/* Grundlegende Stile */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #111;
    color: #f0f0f0;
    overflow: hidden; /* Verhindert standardmäßiges Scrollen */
}

/* Verhindert das Scrollen des Galerie-Inhalts, wenn das Menü offen ist */
body.menu-open {
    overflow: hidden;
}


/* --- Header & Hamburger Menu --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 5vw;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo span {
    font-size: 1.2rem;
    font-weight: bold;
}

.logo small {
    font-size: 0.7rem;
    color: #a0a0a0;
    letter-spacing: 1px;
}

#menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: white; /* Farbe auf Weiß geändert für besseren Kontrast */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

body.menu-open #menu-toggle span {
    background-color: white;
}

body.menu-open #menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

body.menu-open #menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.menu-open #menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* --- Navigations-Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-overlay nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.nav-overlay nav li {
    margin: 20px 0;
}

.nav-overlay nav a {
    color: #f0f0f0;
    text-decoration: none;
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-overlay nav a:hover {
    color: #aaa;
}


/* --- Desktop Galerie-Stile --- */
.gallery-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.background-image.active {
    opacity: 1;
}

.gallery-container::before,
.gallery-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20vh;
    z-index: 3;
    pointer-events: none;
}

.gallery-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0) 100%);
}

.gallery-container::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0) 100%);
}

.gallery-nav {
    position: absolute;
    bottom: 5vh;
    left: 5vw;
    right: 5vw;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-nav button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #f0f0f0;
    padding: 8px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-nav button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#counter {
    margin-bottom: 15px;
}

.progress-indicator {
    display: flex;
    gap: 8px;
}

.progress-bar {
    width: 25px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.8s ease;
}

.progress-bar.active {
    background-color: white;
}

/* Versteckt den mobilen Button auf dem Desktop */
.orientation-button {
    display: none;
}


/* =================================================== */
/* === ALLES FÜR DIE MOBILE ANSICHT (unter 768px) === */
/* =================================================== */
@media (max-width: 768px) {
    body {
        overflow-y: auto !important; /* Scrollen auf Mobile erlauben */
        overflow-x: hidden;
    }
    
    .gallery-nav { display: none; }
    
    .gallery-container {
        height: auto;
        display: block;
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .background-images {
        position: relative;
        height: auto;
    }

    .background-image {
        position: relative;
        opacity: 1;
        width: 90%;
        margin: 0 auto 20px auto;
        aspect-ratio: 4 / 3;
        background-size: cover;
        border-radius: 8px;
        overflow: hidden;
    }

    .gallery-container::before,
    .gallery-container::after { 
        display: none; 
    }

    .orientation-button {
        display: flex;
        position: absolute;
        top: 15px;
        left: 15px;
        width: 44px;
        height: 44px;
        background-color: rgba(0,0,0,0.5);
        border: 1px solid rgba(255,255,255,0.6);
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 50;
        transition: background-color 0.3s ease;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23FFFFFF'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z'/%3E%3C/svg%3E");
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    }
    .orientation-button:hover {
        background-color: rgba(0,0,0,0.8);
    }
    
    .fullscreen-viewer {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(10, 10, 10, 1);
        z-index: 2000;
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0s 0.4s;
        overflow: hidden;
    }
    .fullscreen-viewer.active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.4s ease;
    }

    .rotate-prompt {
        color: white;
        text-align: center;
        font-size: 1.1rem;
        display: none;
    }
    .rotate-prompt.visible {
        display: block;
    }
    .rotate-prompt .phone-icon {
        width: 50px;
        height: 100px;
        border: 3px solid white;
        border-radius: 10px;
        margin: 0 auto 20px;
        position: relative;
        animation: rotate-animation 2.5s ease-in-out forwards;
    }
    @keyframes rotate-animation {
        0%   { transform: rotate(0deg); opacity: 1; }
        30%  { transform: rotate(0deg); opacity: 1; }
        60%  { transform: rotate(90deg); opacity: 1; }
        100% { transform: rotate(90deg); opacity: 0; }
    }

    .fullscreen-image {
        position: absolute;
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0;
        transform: translate(-50%, -50%) rotate(0deg) scale(0.95);
        transition: opacity 0.4s ease 0.1s, transform 0.5s ease 0.1s;
    }

    .fullscreen-image.visible {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(90deg) scale(1);
    }

    .fullscreen-controls {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.5s ease 0.2s;
    }

    .fullscreen-controls.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* --- FINALE ÄNDERUNG HIER: Position des Schließen-Buttons --- */
    .fullscreen-close {
        position: absolute;
        bottom: 15px;   /* Physisch: Unten */
        right: 15px;    /* Physisch: Rechts */
        font-size: 2.5rem;
        color: white;
        background: none;
        border: none;
        cursor: pointer;
        line-height: 1;
        padding: 10px;
        z-index: 2001;
    }
    /* --- ENDE DER ÄNDERUNG --- */

    .fullscreen-nav {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 2.5rem;
        line-height: 1;
        color: rgba(255, 255, 255, 0.7);
        background: none;
        border: none;
        cursor: pointer;
        padding: 15px 40px;
        transition: color 0.3s ease;
    }
    .fullscreen-nav:hover { color: white; }

    #fullscreen-prev {
        top: 15px; /* Physisch: Oben */
    }
    #fullscreen-next {
        bottom: 15px; /* Physisch: Unten */
    }
}