:root {
  --bg: #121212;
  --text: #ddd;
  --title: #fff;
  --muted: #888;
  --gap: 4px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 16px 48px; }

.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Kopf und Fuß */
.kopf {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 24px;
  width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 16px 32px;
}
.logo {
  color: var(--title); text-decoration: none; text-transform: uppercase;
  letter-spacing: .35em; font-size: 15px;
}
.kopf nav a, .fuss a {
  color: var(--text); opacity: .7; text-decoration: none; font-size: 14px; margin-left: 20px;
}
.kopf nav a:first-child, .fuss a:first-child { margin-left: 0; }
.kopf nav a:hover, .fuss a:hover { opacity: 1; }
.fuss { text-align: center; padding: 24px 16px 32px; }

/* Raster */
.raster {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) { .raster { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .raster { grid-template-columns: repeat(4, 1fr); } }
.raster li { margin: 0; }
.raster a { display: block; position: relative; }
.raster img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: #1c1c1c; }
.raster a:focus-visible { outline: 2px solid var(--title); outline-offset: 2px; }

.kachel span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  color: var(--title); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}

.hinweis { color: var(--muted); text-align: center; padding: 64px 0; }

/* Galerie */
.galerie-kopf { margin-bottom: 20px; }
.galerie-kopf h1 { margin: 0; color: var(--title); font-weight: 400; font-size: 26px; letter-spacing: .02em; }
.galerie-kopf .info { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* Textseiten */
.text { max-width: 680px; margin: 0 auto; }
.text h1 { color: var(--title); font-weight: 400; font-size: 26px; margin: 0 0 20px; }
.text h2 { color: var(--title); font-weight: 400; font-size: 19px; margin: 32px 0 8px; }
.portraet { display: block; max-width: 100%; height: auto; margin: 0 0 24px; }

/* Login und 404 */
.login, .leer { max-width: 360px; margin: 48px auto; text-align: center; }
.login h1, .leer h1 { color: var(--title); font-weight: 400; font-size: 22px; margin: 0 0 24px; }
.login form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.login label { font-size: 14px; color: var(--muted); }
.login input[type=password] {
  padding: 10px 12px; font-size: 16px; color: var(--title);
  background: #1c1c1c; border: 1px solid #333; border-radius: 4px;
}
.login input[type=password]:focus { outline: none; border-color: #777; }
.login button {
  margin-top: 6px; padding: 10px 12px; font-size: 15px; cursor: pointer;
  color: var(--bg); background: var(--title); border: 0; border-radius: 4px;
}
.login button:hover { background: #ccc; }
.fehler { color: #e88; margin: 0 0 16px; }

/* Vollbild-Ansicht */
html.lb-offen, html.lb-offen body { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 10; background: #000;
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y; user-select: none;
}
.lb[hidden] { display: none; }
.lb img { max-width: 100vw; max-height: 100vh; width: auto; height: auto; object-fit: contain; }
.lb-zu {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  font-size: 26px; line-height: 44px; color: var(--text); background: none; border: 0; cursor: pointer; opacity: .7;
}
.lb-zu:hover { opacity: 1; }
.lb-zaehler {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  font-size: 13px; color: var(--muted); letter-spacing: .08em;
}
