/* ================================================
   Tiere-Seite – Galerie auf Holzuntergrund
   York & Nova 2025
   ================================================ */


body {
  background: url('<?= $paths['bg']; ?>/tiere/tierhg.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
  background-color: #222 !important;
}


/* =======================================================
   Hintergrund der Tierseite – Holztextur
   ======================================================= */
body.page-tiere {
  background: url('/bg/tiere/tierhg.jpg') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  background-color: #000;
}


body,
.gallery-page {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: white;
  text-align: center;
  overflow-x: hidden;
}

/* -----------------------------------------------
   Titel (optional, falls genutzt)
   ----------------------------------------------- */
.title {
  margin: 20px 0;
  font-size: 2rem;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* -----------------------------------------------
   Galerie-Bereich
   ----------------------------------------------- */
.gallery {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden; /* verhindert Überlaufen */
  perspective: 1200px;

}

/* Jedes Galeriebild zufällig positioniert */
.gallery-item {
  position: absolute;
  cursor: pointer;
  transition: transform 0.5s ease, z-index 0.3s ease;
}

/* Einheitliche Größe, kein Übermaß */
.gallery-item img {
  display: block;
  width: 100%;
  max-width: 220px; /* kontrollierte Maximalgröße */
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s ease, box-shadow 0.4s ease;
  object-fit: cover;
  pointer-events: none;
}

/* Hover-Verhalten */
.gallery-item:hover {
  z-index: 20;
  transform: scale(1.05) rotate(0deg);
}

.gallery-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
}

/* -----------------------------------------------
   Lightbox
   ----------------------------------------------- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  cursor: pointer;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
}

.controls span {
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* -----------------------------------------------
   Smartphone: Grid statt zufälliger Tisch
   ----------------------------------------------- */
@media (max-width: 768px) {
  .gallery {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    height: auto;
  }

  .gallery-item {
    position: static !important;
    width: 45%;
    transform: none !important;
  }

  .gallery-item img {
	  display: block;
	  width: 180px;
	  max-width: 20vw;
	  border-radius: 8px;
	  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
	  transition: transform 0.4s ease, box-shadow 0.4s ease;
	}

}

/* -----------------------------------------------
   Optional: Holztextur-Hintergrund
   (kommt automatisch per Inline-Style von PHP)
   ----------------------------------------------- */
.gallery-page {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
