/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background-color: #FFFFFF;
    color: #000000;
    line-height: 1.6;
    font-weight: 300;
    overflow-x: hidden;
    width: 100%;
}

header, .gallery-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: flex-start;
    z-index: 1;
    background-color: #FFFFFF;
    height: 60px;
    align-items: center;
}

header .nav, .gallery-header .nav {
    margin-left: auto;
}

.cv-page header {
    background-color: #0047AB;
}

/* CV Page Styles */
.cv-page {
    background-color: #0047AB;
    color: #FFFFFF;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cv-page a {
    color: #FFFFFF;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.cv-page a:hover {
    text-decoration: underline;
    font-style: italic;
}

.cv-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.cv-left, .cv-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1 1 45%;
    min-width: 280px;
}

.cv-text p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.food-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.food-list li {
    margin-bottom: 0.5rem;
}

.food-list li:first-child {
    font-style: italic;
}

@media (max-width: 768px) {
    .cv-content {
        padding: 1rem;
        flex-direction: column;
    }
    
    .cv-text p {
        margin-bottom: 1.2rem;
    }
}

.name a, .nav a {
    text-decoration: none;
    color: #000000;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 300;
    padding: 0.5rem;
    display: inline-block;
}

.cv-page .name a, 
.cv-page .nav a {
    color: #FFFFFF;
}

.cv-page .nav a,
.gallery-page .nav a {
    font-size: 2rem;
    padding: 0;
}

header .nav a {
    font-size: 1rem;
    padding: 0.5rem;
}

.name a:hover, .nav a:hover {
    text-decoration: underline;
    font-style: italic;
}

.name a:active, .nav a:active {
    opacity: 0.8;
}

main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.featured-image {
    display: none;
}

/* Gallery Styles */
.gallery-page {
    background-color: #FFFFFF;
    padding-top: 60px;
    min-height: 100vh;
}

.gallery-page .name a,
.gallery-page .nav a {
    pointer-events: auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    margin: 0;
    contain: content;
    position: relative;
    z-index: 0;
    padding-top: 80px;
}

.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5; /* Light gray background for loading state */
    contain: content;
    transform: translateZ(0);
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
    content-visibility: auto;
    contain-intrinsic-size: 250px 250px;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid #ddd;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0.5;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-item.loaded {
    opacity: 1;
}

.gallery-item.loaded::before {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform: translateZ(0);
    will-change: transform;
    contain: content;
    background-color: transparent;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item img {
        transition: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
}

/* CV Page Styles */
.cv-page {
    background-color: #0047AB;
    color: #FFFFFF;
    min-height: 100vh;
}

.cv-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 100vh;
}

.cv-left {
    width: 90%;
    padding-right: 2rem;
    text-align: left;
    padding-top: 6rem;
}

.cv-right {
    width: 50%;
    padding-top: 6rem;
    padding-left: 2rem;
}

.cv-text {
    font-size: 3.3rem;
    font-weight: 300;
    line-height: 1.2;
}

.cv-text p {
    margin-bottom: 2rem;
}

.cv-text a {
    color: #FFFFFF;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    display: inline-block;
}

.cv-text a:hover {
    text-decoration: underline;
    font-style: italic;
}

.cv-text a:active {
    opacity: 0.8;
}

.food-list {
    list-style: none;
    font-size: 3.3rem;
    line-height: 1.2;
    margin-top: 0;
}

.food-list li {
    margin-bottom: 1rem;
}

.cv-right .cv-text {
    margin-bottom: 2rem;
}

.close-button {
    position: fixed;
    top: 1rem;
    right: 2rem;
    z-index: 1001;
    height: 60px;
    display: flex;
    align-items: center;
}

.close-button a {
    font-size: 2rem;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
    font-weight: 300;
    padding: 0.5rem;
    display: inline-block;
}

.close-button a:hover {
    text-decoration: underline;
    font-style: italic;
}

.close-button a:active {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cv-text, .food-list {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .gallery-header {
        padding: 0 20px;
    }
    
    .gallery-page .name a {
        left: 20px;
    }
    
    .gallery-page .nav a {
        right: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .cv-content {
        padding: 4rem 1rem 1rem;
        flex-direction: column;
    }
    
    .cv-left, .cv-right {
        width: 100%;
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .cv-text, .food-list {
        font-size: 2rem;
    }

    .featured-image {
        padding: 4rem 1rem;
    }
}

@media (max-width: 480px) {
    .cv-text, .food-list {
        font-size: 1.8rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (hover: none) {
    .gallery-item:hover img {
        transform: none;
    }
    
    .name a:hover, 
    .nav a:hover,
    .cv-text a:hover,
    .close-button a:hover {
        text-decoration: none;
        font-style: normal;
    }
}

.featured-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding: 4rem 2rem;
}

.featured-container picture,
.featured-container img {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.featured-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #FFFFFF;
    z-index: 1000;
    padding: 0;
    overflow: auto;
    cursor: zoom-in;
}

.featured-container.fullscreen.zoomed {
    cursor: zoom-out;
}

.featured-container.fullscreen picture,
.featured-container.fullscreen img {
    width: auto;
    height: auto;
    min-width: 100vw;
    min-height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.featured-container.fullscreen.zoomed picture,
.featured-container.fullscreen.zoomed img {
    min-width: 200vw;
    min-height: 200vh;
    max-width: none;
    max-height: none;
    cursor: zoom-out;
    object-fit: none;
    transform: scale(2);
}

.featured-container.fullscreen .close-button {
    position: fixed;
    top: 0;
    right: 0.5rem;
    z-index: 1001;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.featured-container.fullscreen .close-button a {
    font-size: 2rem;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
    font-weight: 300;
    padding: 0;
    display: inline-block;
}

.featured-container.fullscreen .close-button a:hover {
    text-decoration: underline;
    font-style: italic;
}

.featured-container.fullscreen .close-button a:active {
    opacity: 0.8;
}

/* Bunte Animation für das X im Vollbild-Modus */
.featured-container.fullscreen .close-button a {
    animation: rainbow-colors 2s linear infinite;
    font-weight: bold;
}

@keyframes rainbow-colors {
    0% { color: #ff0000; } /* Rot */
    14.3% { color: #ff8c00; } /* Orange */
    28.6% { color: #ffd700; } /* Gelb */
    42.9% { color: #00ff00; } /* Grün */
    57.2% { color: #00bfff; } /* Hellblau */
    71.4% { color: #0000ff; } /* Blau */
    85.7% { color: #8a2be2; } /* Violett */
    100% { color: #ff0000; } /* Zurück zu Rot */
}

.nav a {
    font-size: 2rem;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
    font-weight: 300;
    padding: 0.5rem;
    display: inline-block;
}

.nav a:hover {
    opacity: 0.8;
}

.nav a:active {
    opacity: 0.6;
} 