/* Verhindert blaue Flächen in Safari */
.gallery img,
.modal,
.modal-content,
.prev,
.next,
.close {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.gallery,
.modal {
  -webkit-user-select: none;
  user-select: none;
}

* {
  -webkit-tap-highlight-color: transparent;
}

*:focus {
  outline: none !important;
  box-shadow: none !important;
}

button, a, span {
  -webkit-tap-highlight-color: transparent;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 Spalten auf Desktop */
  gap: 15px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Responsive: Tablets */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr); /* 3 Spalten auf Tablets */
  }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr; /* 1 Spalte auf Mobile */
  }
}

/* Vorschaubild */
.gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.3s;
}

.gallery img:hover {
  transform: scale(1.05);
}

/* Modal (Vollbild) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.95);
}

.modal-content {
  position: relative;
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85%;
  margin-top: 50px;
}

/* Schließen Button */
.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.close:hover {
  color: #ccc;
}

/* Navigation Pfeile */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -30px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  background-color: rgba(0,0,0,0.5);
  border-radius: 3px;
  user-select: none;
}

.next {
  right: 20px;
}

.prev {
  left: 20px;
}

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

/* Bildunterschrift */
.caption {
  text-align: center;
  color: white;
  padding: 15px;
  font-size: 18px;
}

