@charset "UTF-8";

/* =========================================================
   1. GRUNDAUFBAU DER GALERIE
   ========================================================= */

.gallery {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px;
  box-sizing: border-box;
}

/* =========================================================
   2. HAUPTBILD
   ========================================================= */

.main-image-container {
  position: relative;
  width: 100%;
  background-color: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.main-image-container img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.4s ease-in-out;
}

/* =========================================================
   3. SVG-PFEILE
   ========================================================= */

.nav-btn svg,
.lightbox-btn svg {
  display: block;
  width: 28px !important;
  height: 28px !important;
}

/* =========================================================
   4. NAVIGATIONSPFEILE AM HAUPTBILD
   ========================================================= */

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;

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

  width: 48px;
  height: 48px;
  padding: 0;

  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;

  cursor: pointer;
  transition: background 0.25s ease,
              box-shadow 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-btn svg {
  fill: #ffffff !important;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.85) !important;
}

.nav-btn:hover svg {
  fill: #ffffff !important;
}

.nav-btn.prev-btn {
  left: 16px;
}

.nav-btn.next-btn {
  right: 16px;
}

/* =========================================================
   5. THUMBNAIL-LEISTE
   ========================================================= */

.thumbnails {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;

  width: 100%;
  box-sizing: border-box;

  gap: 12px;
  margin-top: 16px;

  /* Platz für den aktiven Rahmen */
  padding: 10px 6px 14px;

  /* Horizontal scrollen, nicht vertikal */
  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Dezente Scrollbar */
.thumbnails::-webkit-scrollbar {
  height: 6px;
}

.thumbnails::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.thumbnails::-webkit-scrollbar-track {
  background-color: transparent;
}

/* =========================================================
   6. EINZELNE VORSCHAUBILDER
   ========================================================= */

.thumb {
  display: block;

  /* Feste Grösse, kein Schrumpfen */
  flex: 0 0 100px;
  width: 100px;
  min-width: 100px;
  height: 70px;

  box-sizing: border-box;
  object-fit: cover;

  cursor: pointer;
  opacity: 0.55;

  /* Der Rahmen bleibt innerhalb des Bildes */
  border: 3px solid transparent;
  border-radius: 8px;
  outline: none;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

  transition: opacity 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

/* Maus über dem Vorschaubild */
.thumb:hover {
  opacity: 0.85;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   7. AKTIVES VORSCHAUBILD
   ========================================================= */

.thumb.active {
  opacity: 1;

  /* Dünner blauer Rahmen */
  border: 2px solid #007bff;

  /* Dezenter Schatten */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Tastaturbedienung */
.thumb:focus-visible {
  border-color: #007bff;
  outline: 2px solid #007bff;
  outline-offset: -4px;
}

/* =========================================================
   8. EINBLEND-ANIMATION
   ========================================================= */

.fade-effect {
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =========================================================
   9. LIGHTBOX - HINTERGRUND
   ========================================================= */

.lightbox {
  display: none;

  position: fixed;
  z-index: 1000;

  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  background-color: rgba(0, 0, 0, 0.9);

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

  cursor: zoom-out;
}

/* =========================================================
   10. LIGHTBOX - GROSSES BILD
   ========================================================= */

.lightbox-content {
  display: block;

  width: auto;
  height: auto;

  max-width: 90%;
  max-height: 90vh;

  object-fit: contain;
  border-radius: 4px;

  animation: lightboxFade 0.3s ease-in-out;
}

/* =========================================================
   11. LIGHTBOX - SCHLIESSEN-SCHALTFLÄCHE
   ========================================================= */

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;

  z-index: 1020;

  color: #ffffff;
  font-size: 40px;
  font-weight: bold;

  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: #007bff;
}

/* =========================================================
   12. LIGHTBOX - NAVIGATIONSPFEILE
   ========================================================= */

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  z-index: 1010;

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

  width: 56px;
  height: 56px;
  padding: 0;

  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;

  cursor: pointer;

  transition: background 0.25s ease;
}

.lightbox-btn svg {
  fill: #ffffff !important;
}

.lightbox-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.lightbox-btn.prev-btn {
  left: 24px;
}

.lightbox-btn.next-btn {
  right: 24px;
}

/* =========================================================
   13. LIGHTBOX - ANIMATION
   ========================================================= */

@keyframes lightboxFade {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* =========================================================
   14. BILDUNTERSCHRIFT UNTER DEM HAUPTBILD
   ========================================================= */

.image-caption {
  margin-top: 10px;
  padding: 0 4px;
  display: none; /* Bildunterschrift unter dem Hauptbild ausblenden */

  font-family: sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;

  color: #4a4a4a;

  transition: opacity 0.3s ease;
}

/* =========================================================
   15. BILDUNTERSCHRIFT IN DER LIGHTBOX
   ========================================================= */

.lightbox-caption {
  max-width: 90%;
  margin: 15px auto 0;
  display: none;  /* Bildunterschrift in der Lightbox ausblenden */

  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5;

  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);

  overflow-wrap: break-word;
}

/* =========================================================
   16. TABLETS UND SMARTPHONES
   ========================================================= */

@media (max-width: 600px) {

  .gallery {
    padding: 4px;
  }

  /* Hauptbild-Pfeile */
  .nav-btn {
    width: 40px;
    height: 40px;
  }

  .nav-btn svg {
    width: 22px !important;
    height: 22px !important;
  }

  .nav-btn.prev-btn {
    left: 10px;
  }

  .nav-btn.next-btn {
    right: 10px;
  }

  /* Thumbnail-Leiste bleibt horizontal */
  .thumbnails {
    gap: 10px;
    padding: 9px 5px 13px;
  }

  /* Einheitliche Thumbnail-Grösse */
  .thumb {
    flex: 0 0 85px;
    width: 85px;
    min-width: 85px;
    height: 60px;
  }

  /* Lightbox-Pfeile */
  .lightbox-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.55);
  }

  .lightbox-btn svg {
    width: 22px !important;
    height: 22px !important;
  }

  .lightbox-btn.prev-btn {
    left: 10px;
  }

  .lightbox-btn.next-btn {
    right: 10px;
  }

  /* Schliessen-Schaltfläche */
  .lightbox-close {
    top: 10px;
    right: 16px;
    font-size: 36px;
  }

  /* Bildunterschrift */
  .image-caption {
    font-size: 13px;
  }

  .lightbox-caption {
    font-size: 14px;
  }
}

/* =========================================================
   17. KLEINE SMARTPHONES
   ========================================================= */

@media (max-width: 360px) {

  .nav-btn {
    width: 36px;
    height: 36px;
  }

  .nav-btn svg {
    width: 20px !important;
    height: 20px !important;
  }

  .thumbnails {
    gap: 8px;
  }

  .thumb {
    flex: 0 0 75px;
    width: 75px;
    min-width: 75px;
    height: 55px;
  }

  .lightbox-btn {
    width: 36px;
    height: 36px;
  }

  .lightbox-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
}



/* ==========================================
   18. LIGHTBOX – ZOOMFUNKTION
   ========================================== */

#lightbox-img {
    cursor: zoom-in;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

#lightbox-img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}