:root {
    --bg: #f4f3f0;
    --surface: #ffffff;
    --text: #222;
    --muted: #6b6b6b;
    --accent: #8a5a2b;
    --border: #e2dfd8;
    --sidebar: #2b2824;
    --sidebar-text: #d9d4cb;
    --radius: 6px;
    --thumb: 200px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ---------- Layout ---------- */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 230px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 24px 0;
}

.logo {
    display: block;
    padding: 0 22px 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    letter-spacing: .02em;
    color: #fff;
    text-decoration: none;
}

.logo .initial {
    color: #d9a066;
    font-size: 1.3em;
}

.menu-toggle { display: none; }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    border-top: 1px dotted rgba(255, 255, 255, .25);
}

.site-nav a {
    display: block;
    padding: 7px 22px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .95rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}

.site-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.site-nav a.active {
    background: rgba(255, 255, 255, .08);
    border-left-color: #d9a066;
    color: #fff;
}

/* ---------- Inhalt ---------- */
.content {
    flex: 1;
    min-width: 0;
    max-width: 1400px;
    padding: 32px 32px 60px;
}

h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 12px;
}

h1 small {
    font-size: .9rem;
    font-weight: 400;
    color: var(--muted);
    margin-left: 8px;
}

.lead { color: var(--muted); margin: 0 0 24px; }
.empty { color: var(--muted); }

.text { max-width: 720px; }

.intro-list { margin: 0 0 32px; padding-left: 20px; }
.intro-list li { margin: 4px 0; }

.link-list { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.link-list li { border-bottom: 1px solid var(--border); }
.link-list a { display: block; padding: 10px 0; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list a::after { content: " ↗"; color: var(--muted); font-size: .85em; }

/* ---------- Übersicht ---------- */
.categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* 8 Galerien = 2 volle Reihen */
    gap: 20px;
    max-width: 1100px;
}

@media (max-width: 950px) {
    .categories { grid-template-columns: repeat(2, 1fr); }
}

.category {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.category:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

.category-img {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    aspect-ratio: 1 / 1;
    padding: 3px;
    background: var(--border);
}

.category-img > * {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fafaf8;
}

.category-img img {
    object-fit: contain;
    display: block;
}

.category-img .placeholder { background: #efede8; }

.category-img .more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #efede8;
    color: var(--accent);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    transition: background .15s;
}

.category-img .more small {
    font-size: .8rem;
    font-weight: 400;
    color: var(--muted);
    margin-top: 4px;
}

.category:hover .more { background: #e6e1d8; }

.category-label {
    display: block;
    padding: 12px 14px;
    text-align: center;
}

/* ---------- Galerie ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr));
    gap: 16px;
}

.item {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s;
}

.item:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }

.item a {
    display: block;
    aspect-ratio: 1 / 1;
    background: #fafaf8;
    overflow: hidden;
}

.item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .25s;
}

.item a:hover img { transform: scale(1.04); }

.item figcaption {
    padding: 8px 10px;
    font-size: .85rem;
    border-top: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 10, 10, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lb-fade .2s ease;
}

.lightbox[hidden] { display: none; }

@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
    margin: 0;
    max-width: calc(100vw - 140px);
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lb-img {
    max-width: 100%;
    max-height: calc(100vh - 90px);
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    background: #fff;
    transition: opacity .2s;
}

.lb-img.loading { opacity: .3; }

.lb-stage figcaption {
    color: #eee;
    padding: 12px 0 0;
    display: flex;
    gap: 16px;
    align-items: baseline;
    text-align: center;
}

.lb-count { color: #999; font-size: .85rem; white-space: nowrap; }

.lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, .08);
    border: 0;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.lightbox button:hover { background: rgba(255, 255, 255, .2); }

.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

body.lb-open { overflow: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
    :root { --thumb: 140px; }

    .layout { display: block; }

    .sidebar {
        position: sticky;
        z-index: 20;
        width: auto;
        height: auto;
        padding: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .logo { padding: 12px 16px; font-size: 1.3rem; }

    .menu-toggle {
        display: block;
        background: none;
        border: 0;
        width: 48px;
        height: 48px;
        margin-right: 8px;
        cursor: pointer;
        position: relative;
    }

    .menu-toggle span:first-child,
    .menu-toggle span:first-child::before,
    .menu-toggle span:first-child::after {
        position: absolute;
        left: 13px;
        width: 22px;
        height: 2px;
        background: #fff;
        content: "";
    }
    .menu-toggle span:first-child { top: 23px; }
    .menu-toggle span:first-child::before { left: 0; top: -7px; }
    .menu-toggle span:first-child::after  { left: 0; top: 7px; }

    .site-nav {
        display: none;
        width: 100%;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .sidebar.open .site-nav { display: block; }

    .content { padding: 20px 16px 40px; }
    .gallery { gap: 10px; }
    .categories { gap: 12px; }

    .lb-stage { max-width: 100vw; }
    .lb-img { max-height: calc(100vh - 120px); }
    .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}
