/* =========================================================
   IMGBOX – Galerie Overlay
   Datei: imgbox.css
========================================================= */

/* Overlay */
.imgbox{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.imgbox.is-open{
  display: block;
}

/* Backdrop */
.imgbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
}

/* Panel */
.imgbox-panel{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
}

/* Figure */
.imgbox-figure{
  margin: 0;
  width: min(1100px, 92vw);
  max-height: 86vh;
  display: grid;
  gap: 10px;
  align-items: center;
  justify-items: center;
}

.page-tour .imgbox-figure{
  width: min(2000px, 94vw);
}

#imgbox-img{
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 78vh;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  display: block;
}

/* Caption */
#imgbox-caption{
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  max-width: 70ch;
}

/* Close button */
.imgbox-close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.imgbox-close:hover{
  background: rgba(0,0,0,0.6);
}

/* Counter */
.imgbox-counter{
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Nav */
.imgbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 56px;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.45);
  color: #fff;

  font-size: 44px;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* minimaler Feinschliff nur für die Pfeile */
.imgbox-nav span{
  display: block;
  transform: translateY(-1px);
}

.imgbox-nav:hover{
  background: rgba(0,0,0,0.6);
}

.imgbox-prev{ left: 16px; }
.imgbox-next{ right: 16px; }

/* Thumbnails: klickbar */
.imgbox-item{
  cursor: zoom-in;
}

.imgbox-item:hover{
  filter: brightness(1.05);
}

/* =========================================================
   IMGBOX – Standard
========================================================= */

.imgbox-figure{
  margin: 0;
  width: min(1100px, 92vw);
  max-height: 86vh;
  display: grid;
  gap: 10px;
  align-items: center;
  justify-items: center;
}


/* =========================================================
   IMGBOX – Tourseite größer
========================================================= */

.page-tour .imgbox-figure{
  width: min(1500px, 94vw);
}


/* =========================================================
   IMGBOX – Bildformat erkennen
========================================================= */

.imgbox.is-landscape .imgbox-figure{
  width: min(1500px, 94vw);
}

.imgbox.is-portrait .imgbox-figure{
  width: min(780px, 92vw);
}

.imgbox.is-square .imgbox-figure{
  width: min(1000px, 92vw);
}


/* Bild selbst */
.imgbox-figure img{
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
}


/* Hochformat etwas höher zulassen */
.imgbox.is-portrait .imgbox-figure img{
  max-height: 82vh;
}

/* Mobile tweaks */
@media (max-width: 640px){
  .imgbox-panel{ padding: 12px; }
  .imgbox-nav{
    width: 48px;
    height: 48px;
    font-size: 38px;
  }
  #imgbox-caption{ font-size: 0.9rem; }
}

/* Thumbnails klickbar */
.imgbox-item{
  cursor: zoom-in;
}

/* Buttons sauber zentrieren */
.imgbox-nav{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pfeil-Zeichen exakt mittig */
.imgbox-nav span{
  display: block;
  line-height: 1;
  transform: translateY(-1px); /* minimal optisch mittiger */
}

.imgbox-item{
  cursor: zoom-in;
}
