/* Reset & Grundlegende Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f4f4f9;
  color: #333;
  padding: 20px;
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 25px;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  color: #222;
  font-size: 3em;
}

/* Grid-Layout für Thumbnails */
.gallery-grid {
  display: grid;
  /* 5 Spalten auf großen Bildschirmen (2 Reihen à 5 Bilder bei 10 Elementen) */
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background-color: #ddd;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  display: block;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

/* Responsive Breakpoints */
/* Tablets (bis ca. 900px): 3 Spalten */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* Smartphones (bis ca. 600px): 2 Spalten */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  body {
    padding: 12px;
  }
}

/* Lightbox Modal (Großansicht) */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Lightbox Buttons */
.btn-close, .btn-prev, .btn-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 24px;
  font-weight: bold;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
  user-select: none;
  backdrop-filter: blur(4px);
}

.btn-close:hover, .btn-prev:hover, .btn-next:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.btn-close {
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.btn-next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Anpassung der Buttons auf Mobilgeräten */
@media (max-width: 600px) {
  .btn-prev { left: 10px; padding: 8px 14px; }
  .btn-next { right: 10px; padding: 8px 14px; }
  .btn-close { top: 10px; right: 10px; width: 40px; height: 40px; }
}