/*Sébastien Hintze le 14.01.2025 */
#ArrierePlan{
    /* L'arrièreplan du header */
    height: 330px;
    background-image: url("../images/wildlife/gemse6.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
#Images>img {
  /* Les paramètres des images dans la gallerie */
  display: block;
  height: auto;
  width: 100%;
  break-inside: avoid;
  box-sizing: border-box;
  margin-bottom: clamp(2px, 0.2vw, 4px);; /* Abstand nach unten */
}

#Images{
  /* Le layout des images dans la gallerie */
  column-count: 4;
  column-gap: clamp(2px, 0.2vw, 4px);
  padding-top: 0.2%;
}


.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;                 /* per JS sichtbar */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;                 /* Rand zum Viewportrand */
  box-sizing: border-box;
  backdrop-filter: blur(2px);
}
.lightbox.open { display: flex; }

.lightbox .lb-inner {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: 90vh;              /* harte Höhenbegrenzung */
  width: 100%;
  display: grid;
  grid-template-rows: 1fr auto;  /* Bild + Caption */
  gap: 10px;
}

#lbImage {
  width: auto;
  height: auto;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 140px);  /* Platz für Buttons/Caption */
  object-fit: contain;              /* vollständig anzeigen */
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  user-select: none;
  -webkit-user-drag: none;
}

.lb-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cfcfcf;
  font-size: .95rem;
  padding: 0 4px;
}

/* Buttons */
.lb-btn, .lb-close {
  position: absolute;
  z-index: 2;
  background: #00000066;
  color: #fff;
  border: 1px solid #ffffff26;
  display: grid; place-items: center;
  cursor: pointer;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

.lb-close {
  top: 10px; right: 10px;
  width: 38px; height: 38px; border-radius: 50%;
}

@media (max-width: 520px){
  #lbImage {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
  }
  .lb-prev, .lb-next { width: 38px; height: 38px; }
}



@media screen and (max-width: 800px){
  #ArrierePlan{ /* Changement d'arrière plan en portrait */
    background-image: url("../images/wildlife/gemse6.jpg");
    background-position: center;
    height: 600px;
  }
  #Images{
    /*Changement du layout en 2 colonnes */
      column-count: 2;
      column-gap: clamp(2px, 0.2vw, 4px);
      padding-top: 0.2%;
  }
}
@media screen and (max-width: 600px){
  #ArrierePlan{
    background-position: right;
  }
  #Images>img {
    /*Changement de la grandeur des images*/
    height: auto;
    width: 98vw;
    object-fit: center; 
    padding-top: clamp(1px, 0.2vw, 4px);
    padding-bottom: clamp(1px, 0.2vw, 4px);
    padding-left: clamp(2px, 1vw, 4px);
    padding-right: clamp(2px, 1vw, 4px);

  }
  #Images{
    /*Changement du flexbox en colonne*/
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
  }

}