/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --warm-brown: #8B6F47;
    --warm-light: #E8DED0;
    --warm-bg: #FAF7F2;
    --dark: #2C2416;
    --text: #3D3426;
    --text-light: #8A7D6B;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 20px rgba(44, 36, 22, 0.08);
    --shadow-hover: 0 8px 40px rgba(44, 36, 22, 0.15);
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--warm-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================== HEADER ===================== */
.header {
    background: linear-gradient(135deg, #2C2416 0%, #4A3B28 50%, #6B5539 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 1;
    padding: 80px 0 100px;
    text-align: center;
}

.header-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.header-content h1 span {
    color: #D4B896;
}

.header-subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-desc {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.header-decoration {
    position: relative;
    z-index: 1;
    line-height: 0;
}

.header-decoration svg {
    display: block;
    width: 100%;
    height: auto;
    fill: var(--warm-bg);
}

/* ===================== GALLERY ===================== */
.gallery {
    padding: 60px 0 80px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

/* ===================== CARD ===================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: var(--warm-light);
}

.card-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--warm-brown);
    font-size: 0.9rem;
    transition: background var(--transition);
}

.card-image .placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.4;
}

.card:hover .card-image .placeholder {
    background: #E0D3C0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 24px;
}

.card-body .badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--warm-brown);
    background: rgba(139, 111, 71, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    riht: auto;
    margin-bottom: 10px;
}

.card-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-body .meisterstuck {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--warm-brown);
    margin-bottom: 10px;
}

.card-body .beschreibung {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.25s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--warm-light);
    overflow: hidden;
}

.modal-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warm-brown);
}

.modal-image .placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-body {
    padding: 32px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--card-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition);
    font-size: 1.2rem;
    color: var(--text);
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.modal-body .modal-sub {
    font-size: 1rem;
    color: var(--warm-brown);
    font-weight: 500;
    margin-bottom: 16px;
}

.modal-body .modal-desc {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 20px;
}

.modal-body .modal-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.modal-body .modal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===================== DETAIL VIEW ===================== */
.detail {
    padding: 60px 0 80px;
}

.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

/* --- Profile Header --- */
.profile-header {
    display: flex;
    gap: 32px;
    padding: 40px;
    background: linear-gradient(135deg, #FAF7F2 0%, #F0E8DC 100%);
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
}

.profile-portrait {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--warm-light);
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile-portrait .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    color: var(--warm-brown);
    font-size: 0.8rem;
}

.profile-portrait .placeholder svg {
    width: 60px;
    height: 60px;
    opacity: 0.4;
}

.profile-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.2;
}

.profile-age {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--warm-brown);
    font-weight: 500;
    margin-bottom: 8px;
}

.profile-sub {
    font-size: 1.1rem;
    color: var(--warm-brown);
    font-weight: 500;
    margin-bottom: 12px;
}

.profile-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 8px;
}

.profile-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.profile-meta span {
    color: var(--warm-brown);
    font-weight: 600;
}

/* --- Werk-Galerie --- */
.werk-gallery {
    padding: 40px;
}

.werk-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--warm-light);
}

.werk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.werk-item {
    break-inside: avoid;
}

.werk-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--warm-light);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.werk-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--warm-brown);
    font-size: 0.85rem;
}

.werk-image .placeholder svg {
    width: 56px;
    height: 56px;
    opacity: 0.35;
}

.werk-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.werk-caption {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    font-style: italic;
}

/* --- Back Link --- */
.back-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 12px;
    transition: color var(--transition);
    position: relative;
    z-index: 1;
}

.back-link:hover {
    color: #D4B896;
}

@media (max-width: 768px) {
    .detail {
        padding: 40px 0 60px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .profile-portrait {
        width: 100px;
        height: 100px;
    }

    .profile-info h2 {
        font-size: 1.5rem;
    }

    .werk-gallery {
        padding: 24px;
    }

    .werk-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===================== NAV TABS ===================== */
.nav-tabs {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.nav-tab {
    display: inline-block;
    padding: 8px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition);
}

.nav-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* ===================== CLASS PHOTOS ===================== */
.class-view {
    padding: 60px 0 80px;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 32px;
}

.class-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeIn 0.5s ease backwards;
}

.class-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.class-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--warm-light);
}

.class-image .class-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--warm-brown);
    font-size: 0.9rem;
}

.class-image .class-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.35;
}

.class-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.class-info {
    padding: 20px 24px;
}

.class-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.class-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
}

.class-date {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--warm-brown);
    font-weight: 500;
}

@media (max-width: 768px) {
    .class-view {
        padding: 40px 0 60px;
    }

    .class-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===================== FOOTER ===================== */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 32px 0;
    font-size: 0.85rem;
}

/* ===================== LIGHTBOX ===================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 40px;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxIn 0.25s ease;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    padding: 0 24px;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .lightbox {
        padding: 16px;
    }

    .lightbox-img {
        max-width: 100vw;
        max-height: 80vh;
    }

    .lightbox-close {
        top: 8px;
        right: 16px;
        font-size: 2rem;
    }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .header-content {
        padding: 50px 0 70px;
    }

    .header-content h1 {
        font-size: 2.2rem;
    }

    .header-subtitle {
        font-size: 0.95rem;
    }

    .gallery {
        padding: 40px 0 60px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .modal-body {
        padding: 24px;
    }

    .modal-body h2 {
        font-size: 1.4rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card {
    animation: fadeIn 0.5s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }