:root {
    --gelb: #ffd200;
    --schwarz: #111111;
    --grau: #f4f4f4;
    --text: #222;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--grau);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header.site {
    background: var(--schwarz);
    color: #fff;
    padding: 16px 20px;
}
header.site .inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
header.site img.logo { height: 64px; width: auto; }
header.site h1 { font-size: 1.5rem; line-height: 1.2; }
header.site h1 small {
    display: block;
    font-size: .85rem;
    font-weight: 400;
    color: var(--gelb);
}
header.site .spacer { flex: 1; }
header.site a.adminlink {
    color: #888;
    font-size: .8rem;
    text-decoration: none;
}
header.site a.adminlink:hover { color: var(--gelb); }

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Tages-Tabs */
nav.tage {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
nav.tage a {
    display: block;
    padding: 10px 18px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    border: 2px solid transparent;
    transition: border-color .15s;
}
nav.tage a:hover { border-color: var(--gelb); }
nav.tage a.aktiv {
    background: var(--gelb);
    color: var(--schwarz);
}
nav.tage a .anzahl {
    font-weight: 400;
    font-size: .8rem;
    opacity: .65;
}

/* Bilderraster */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.galerie a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: #ddd;
}
.galerie img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}
.galerie a:hover img { transform: scale(1.04); }

.leer {
    background: #fff;
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    color: #777;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.lightbox.offen { display: flex; }
.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 4px;
}
.lightbox button {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    padding: 16px;
    line-height: 1;
}
.lightbox button:hover { color: var(--gelb); }
.lightbox .schliessen { top: 8px; right: 12px; }
.lightbox .zurueck { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox .weiter { right: 4px; top: 50%; transform: translateY(-50%); }
.lightbox .zaehler {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: #bbb;
    font-size: .85rem;
}

footer.site {
    background: var(--schwarz);
    color: #aaa;
    padding: 20px;
    font-size: .85rem;
}
footer.site .inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}
footer.site a { color: var(--gelb); text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site .spacer { flex: 1; }

/* Admin */
.box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.box h2 { margin-bottom: 16px; font-size: 1.15rem; }
.box label { display: block; font-weight: 600; margin-bottom: 6px; }
.box input[type=password],
.box select,
.box input[type=file] {
    width: 100%;
    max-width: 420px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 1rem;
    background: #fff;
}
.btn {
    display: inline-block;
    background: var(--gelb);
    color: var(--schwarz);
    border: none;
    padding: 12px 26px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { filter: brightness(.95); }
.btn.sekundaer { background: #e5e5e5; }
.meldung {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.meldung.ok { background: #e6f6e6; color: #1d6b1d; }
.meldung.fehler { background: #fbe4e4; color: #a12626; }

#fortschritt { margin-top: 12px; font-size: .9rem; }
#fortschritt .eintrag { padding: 3px 0; }
#fortschritt .ok { color: #1d6b1d; }
#fortschritt .fehler { color: #a12626; }

.admin-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.admin-galerie figure { position: relative; }
.admin-galerie img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.admin-galerie button.loeschen {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: .9rem;
}
.admin-galerie button.loeschen:hover { background: #c0392b; }

@media (max-width: 600px) {
    header.site img.logo { height: 48px; }
    header.site h1 { font-size: 1.15rem; }
    .galerie { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
