/* =========================================
   1. BASIS & VARIABLEN
   ========================================= */
:root {
    --primary-color: #000000;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --text-color-grey: #dddddd;
    --background-color: #ffffff;
    --accent-color: #555555;
    
    /* Container Styles */
    --container-bg: radial-gradient(circle at center, #9e9e9e 0%, rgba(0, 0, 0, 0.97) 100%);
    --container-shadow: 15px 15px 30px rgba(0, 0, 0, 0.97);
    --container-radius: 20px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--primary-color);
    background-color: var(--background-color);
    background-image: url('../assets/aboutme-sketch.webp'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 100px; 
}

/* =========================================
   2. HEADER & NAV
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #f8f8f8;
    opacity: 0.95;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.construction-video {
    height: 110px;
    width: auto;
    border-radius: 8px;
    pointer-events: none;
}

.logo { width: 150px; height: auto; }

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

/* =========================================
   3. MAIN: CONTAINER STYLES
   ========================================= */
main {
    flex: 1;
    padding: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container, 
.galerie-container, 
.home-container, 
.impressum-box {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 50px;
    background: var(--container-bg);
    box-shadow: var(--container-shadow);
    border-radius: var(--container-radius);
    color: var(--text-color-light);
    overflow: hidden;
}

.logo-container h3, .galerie-container h3, .impressum-box h2, .impressum-box h3 {
    color: #fff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-container p, .galerie-container p {
    color: var(--text-color-grey);
    margin-bottom: 40px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   4. HOME (INDEX)
   ========================================= */
.home-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.intro-text { flex: 1; text-align: left; }
.intro-text h1 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.2; color: #fff; }
.intro-text p { font-size: 1.1rem; line-height: 1.6; color: var(--text-color-grey); margin-bottom: 1.5rem; }
.intro-image-wrapper { flex: 1; display: flex; justify-content: center; align-items: center; }
.profile-image { width: 100%; max-width: 400px; height: auto; border-radius: 50%; border: 5px solid rgba(255,255,255,0.2); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* =========================================
   5. GRID STYLES
   ========================================= */
.logo-grid {
    display: grid;
    /* Hier ist der Fix: auto-fit verhindert leere Grid-Zellen */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
}

.logo-item {
    background-color: #fff;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 20px;
    text-align: center;
}

.logo-item:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }

.project-preview-img { width: 100%; height: auto; max-height: 180px; object-fit: contain; margin-bottom: 15px; }
.dummy-logo-text { font-weight: bold; font-size: 1.5rem; color: var(--text-color-dark); margin-bottom: 5px; }
.dummy-logo-sub { font-size: 0.9rem; color: #888; text-transform: uppercase; }

.galerie-section { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 15px; 
    width: 100%; 
}

.galerie-item { 
    margin: 0; 
    width: 250px; 
    height: 250px; 
    overflow: hidden; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); 
    transition: transform 0.3s ease; 
    cursor: pointer; 
}

.galerie-item:hover { 
    transform: scale(1.05); 
    z-index: 10; 
}

.galerie-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}

.impressum-box { text-align: center; max-width: 800px; }
.impressum-box p { color: var(--text-color-grey); line-height: 1.6; margin-bottom: 10px; }

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #f8f8f8;
    opacity: 0.95;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
}

footer.footer-hidden { transform: translateY(100%); }

.footer-contact a, .footer-link a { text-decoration: none; font-weight: bold; color: var(--text-color-dark); transition: color 0.3s; }
.footer-contact a:hover, .footer-link a:hover { color: var(--accent-color); }

/* =========================================
   9. LIGHTBOX SYSTEM
   ========================================= */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#lightbox-overlay.show { display: flex; }

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border: 2px solid #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.nav-btn {
    color: white;
    font-size: 80px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 20px;
    user-select: none;
    z-index: 2010;
    line-height: 0.5;
}
#prev-btn { left: 20px; }
#next-btn { right: 20px; }
#close-btn { position: fixed; top: 20px; right: 30px; color: white; font-size: 60px; cursor: pointer; z-index: 2100; line-height: 0.8; }

/* -----------------------------------------
   MANUAL SCROLL (VERTIKAL FÜR PROJEKTE)
   ----------------------------------------- */
.scroll-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

#lightbox-overlay.scroll-mode {
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 60px;
    padding-bottom: 60px;
}

#lightbox-overlay.scroll-mode .lightbox-content { display: block; width: 100%; }

#lightbox-overlay.scroll-mode #lightbox-image,
#lightbox-overlay.scroll-mode #prev-btn,
#lightbox-overlay.scroll-mode #next-btn { display: none; }

.scroll-container img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin-bottom: 0;
    cursor: pointer;
}

#lightbox-overlay.scroll-mode.presentation-mode {
    align-items: center;
    overflow: hidden;
    padding: 0;
}

#lightbox-overlay.scroll-mode.presentation-mode .scroll-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#lightbox-overlay.scroll-mode.presentation-mode .scroll-container img { display: none; }

#lightbox-overlay.scroll-mode.presentation-mode .scroll-container img.active {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    cursor: default;
}

/* -----------------------------------------
   VERTIKALE PFEILE (FÜR PROJEKTE)
   ----------------------------------------- */
.vertical-nav-container {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2200;
}

.vertical-nav-btn {
    display: none;
    color: white;
    font-size: 40px;
    background: rgba(0,0,0,0.5);
    border: 2px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    user-select: none;
    transition: background 0.3s;
}

.vertical-nav-btn:hover { background: rgba(255,255,255,0.2); }
#lightbox-overlay.scroll-mode.presentation-mode .vertical-nav-btn { display: flex; }

/* -----------------------------------------
   HORIZONTAL SCROLL (NEU FÜR GALERIE)
   ----------------------------------------- */
#lightbox-overlay.horizontal-mode {
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 50px; 
}

#lightbox-overlay.horizontal-mode .scroll-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    height: 60vh; 
    align-items: center;
    margin: auto; 
    padding: 0;
}

#lightbox-overlay.horizontal-mode .scroll-container img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s;
    border-radius: 4px;
}

#lightbox-overlay.horizontal-mode .scroll-container img:hover {
    transform: scale(1.03);
}

#lightbox-overlay.horizontal-mode.presentation-mode {
    padding: 0;
    overflow: hidden;
}

#lightbox-overlay.horizontal-mode.presentation-mode .scroll-container {
    height: 100vh;
    width: 100vw;
    justify-content: center;
    gap: 0;
}

#lightbox-overlay.horizontal-mode.presentation-mode .scroll-container img {
    display: none;
    transform: none; 
    border-radius: 0;
}

#lightbox-overlay.horizontal-mode.presentation-mode .scroll-container img.active {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* Pfeile im Galerie Präsentationsmodus wieder einblenden */
#lightbox-overlay.horizontal-mode.presentation-mode #prev-btn,
#lightbox-overlay.horizontal-mode.presentation-mode #next-btn {
    display: block;
}

/* -----------------------------------------
   MOBILE ANPASSUNGEN (BEIDE MODI)
   ----------------------------------------- */
@media screen and (max-width: 768px), screen and (orientation: portrait) {
    /* Vertikaler Modus */
    .vertical-nav-container {
        right: 0; left: 0; top: 0; bottom: 0;
        transform: none;
        flex-direction: column;
        justify-content: space-between; 
        padding: 80px 20px 40px 20px; 
        pointer-events: none;
    }
    .vertical-nav-btn {
        pointer-events: auto;
        margin: 0 auto;
        background: rgba(0,0,0,0.7);
        border: 1px solid rgba(255,255,255,0.5);
        width: 50px; height: 50px; font-size: 30px;
    }

    /* Horizontaler Modus */
    #lightbox-overlay.horizontal-mode {
        padding: 0 20px;
    }
    #lightbox-overlay.horizontal-mode .scroll-container {
        height: 40vh; /* Auf Mobile etwas kleiner */
        gap: 20px;
    }
    #lightbox-overlay.horizontal-mode.presentation-mode #prev-btn,
    #lightbox-overlay.horizontal-mode.presentation-mode #next-btn {
        display: none; /* Auf Mobile wischen statt klicken */
    }
}