/* ============================= */
/* Farben & Layout-Variablen     */
/* ============================= */

:root {
  --max: 1100px;

  --bg: #ffffff;
  --text: #111111;
  --muted: #555555;

  /* sehr dezente Linien */
  --border: rgba(0, 0, 0, 0.06);

  /* Kachel-Hintergrund */
  --tile-bg: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #f5f5f5;
    --muted: #aaaaaa;

    --border: rgba(255, 255, 255, 0.08);
    --tile-bg: #111111;
  }
}

/* ============================= */
/* Basics                        */
/* ============================= */

* { box-sizing: border-box; }

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

.container {
  max-width: none;
  margin: 0;
  padding: 16px 24px;
}

/* ============================= */
/* Header                        */
/* ============================= */

.header {
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  margin: 0 0 6px 0;
  font-size: 28px;
  font-weight: 650;
}

.header p {
  margin: 0;
  color: var(--muted);
}

/* ============================= */
/* Grid / Kacheln                */
/* ============================= */

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

/* quadratische Kacheln */
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  background: var(--tile-bg);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 200ms ease;
}

.tile:hover img { transform: scale(1.06); }

/* ============================= */
/* Lightbox                      */
/* ============================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.lightbox.open { display: flex; }

.lb-figure {
  margin: 0;
  max-width: 95vw;
  max-height: 85vh;
  text-align: center;
}

#lbImg {
  max-width: 95vw;
  max-height: 80vh;
  border-radius: 12px;
}

.lb-caption {
  color: #fff;
  opacity: 0.9;
  margin-top: 10px;
  font-size: 14px;
  padding: 0 8px;
}

.lb-btn {
  position: fixed;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  opacity: 0.9;
  user-select: none;
}

.lb-btn:hover { opacity: 1; }

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

/* ============================= */
/* Footer                        */
/* ============================= */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 18px 16px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-left {
  font-size: 14px;
  color: var(--muted);
}

.footer-links a {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover { text-decoration: underline; }

.footer-sep {
  margin: 0 8px;
  color: var(--muted);
}
/* ============================= */
/* Rechtliche Seiten kleiner     */
/* ============================= */

body.legal {
  font-size: 14px;
  line-height: 1.6;
}

body.legal h1 {
  font-size: 22px;
}

body.legal h2 {
  font-size: 16px;
  margin-top: 24px;
}

body.legal p,
body.legal li {
  font-size: 14px;
}
/* Smartphones Hochformat: immer 2 Spalten */
@media (max-width: 600px) and (orientation: portrait) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
/* Mobile: Bildunterschrift dezenter */
@media (max-width: 600px) {
  .lb-caption {
    font-size: 12px;
    opacity: 0.6;
  }
}
/* Mobile: Navigationspfeile in Lightbox ausblenden */
@media (max-width: 600px) {
  .lb-prev,
  .lb-next {
    display: none;
  }
}
/* --- Sortier-Auswahl (dezent) --- */

.controls {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.6;
}

.controls-label {
  margin-right: 6px;
}

.controls-select {
  font-size: 13px;
  background: transparent;
  color: inherit;
  border: 1px solid var(--border);
  padding: 2px 6px;
}

.controls-select:focus {
  outline: none;
  opacity: 1;
}