:root {
  --bg-color: #0f1115;
  --text-color: #ffffff;
  --accent-color: #3b82f6;
  --card-bg: #1e1e1e;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

header {
  padding: 16px 24px;
  background-color: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  margin: 0 auto;
}

.logo {
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 24px;
  max-width: 100%;
  margin: 0 auto;
}

/* Der Trick, damit die letzte Zeile nicht zu stark gestreckt wird */
.gallery::after {
  content: '';
  flex-grow: 999;
}

.gallery-item {
  height: 300px;
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--card-bg);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, z-index 0.3s ease;
  z-index: 1;
}

.gallery-item:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 15px 30px rgba(0,0,0,0.8);
  border-radius: 12px;
}

.gallery-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  vertical-align: middle;
  transition: filter 0.4s ease;
}


.image-text {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  text-shadow: 0px 2px 4px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  pointer-events: none;
}

.gallery-item:hover .image-text {
  opacity: 1;
  transform: translateY(0);
}

.download-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transition: all 0.3s ease;
  transform: translateY(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.download-btn:hover {
  background-color: var(--accent-color);
  transform: scale(1.05);
  border-color: var(--accent-color);
}

.gallery-item:hover .download-btn {
  opacity: 1;
  transform: translateY(0);
}

footer {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 1024px) {
  .gallery-item {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .gallery-item {
    height: 220px;
  }
  header {
    padding: 12px 8px;
  }
  .gallery {
    padding: 6px 8px;
  }
  
  /* Auf Touch-Geräten immer anzeigen, da Hover nicht gut funktioniert */
  .image-text, .download-btn {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .gallery-item {
    height: 180px;
  }
  header {
    padding: 10px 4px;
  }
  .gallery {
    padding: 6px 4px;
  }
}

/* --- Lightbox Styles --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
  margin-top: 15px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  transition: background 0.3s ease;
  backdrop-filter: blur(5px);
  z-index: 1002;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; }
  .lightbox-prev { left: 10px; width: 40px; height: 40px; }
  .lightbox-next { right: 10px; width: 40px; height: 40px; }
  .lightbox-img { max-height: 70vh; }
}
