/* ─── Reset + Grundlagen ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; max-width: 100%; height: auto; }


/* ─── Header ─────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 40px 80px 36px;
  border-bottom: 1px solid #ececec;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1800px;
  margin: 0 auto;
  animation: fade-down 600ms ease-out both;
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { animation: none; }
}

.logo {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #666;
}

.site-nav a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 120ms, border-color 120ms;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #111;
  border-bottom-color: #111;
}


/* ─── Gallery (Justified Rows) ───────────────────────────────────── */

.gallery {
  padding: 40px 80px 64px;
  font-size: 0;       /* entfernt Inline-Whitespace zwischen Items */
  max-width: 1800px;
  margin: 0 auto;
}

.gallery-item {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  background: #f5f5f5;
  margin: 0 4px 4px 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.gallery-item.is-laid-out {
  /* Layout berechnet, aber noch unsichtbar — wartet auf Intersection Observer */
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
  -webkit-touch-callout: none;
  user-select: none;
}

.lightbox img {
  pointer-events: none; /* Rechtsklick trifft den Overlay, nicht das img-Element */
}

.gallery-item:hover img {
  transform: scale(1.015);
}

/* Respektiere System-Einstellungen für reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
  .gallery-item {
    transition: opacity 200ms ease;
    transform: none;
  }
  .gallery-item.is-visible {
    transform: none;
  }
  .gallery-item img {
    transition: none;
  }
  .gallery-item:hover img {
    transform: none;
  }
}


/* ─── Prose (About, Kontakt) ─────────────────────────────────────── */

.prose {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 80px;
  font-size: 16px;
  line-height: 1.7;
}

.prose h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 24px;
  color: #666;
}

.prose p { margin: 0 0 1em; }


/* ─── Footer ─────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 80px 40px;
  margin: 32px auto 0;
  max-width: 1800px;
  border-top: 1px solid #ececec;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .footer-links {
  display: flex;
  gap: 20px;
}

.site-footer a:hover { color: #111; }


/* ─── Lightbox ───────────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 40px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 250ms ease;
}

.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 200ms ease;
}

.lightbox img.is-loaded {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  font-weight: 200;
  padding: 16px 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 150ms;
}

.lightbox-nav:hover { opacity: 1; }
.lightbox-nav.prev { left: 0; }
.lightbox-nav.next { right: 0; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  font-weight: 200;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 150ms;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 11px;
  letter-spacing: 0.10em;
  opacity: 0.6;
  pointer-events: none;
}


/* ─── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .site-header  { padding: 36px 48px 24px; }
  .gallery      { padding: 32px 48px 48px; }
  .site-footer  { padding: 24px 48px 32px; }
  .prose        { padding: 0 48px; }
}

@media (max-width: 640px) {
  .site-header  { padding: 24px 20px 16px; }
  .gallery      { padding: 20px 20px 32px; }
  .site-footer  { padding: 20px 20px 28px; }
  .prose        { padding: 0 20px; }
  .site-nav     { gap: 16px; font-size: 11px; }
  .site-nav a   { white-space: nowrap; }
  .lightbox     { padding: 16px; }
}
