.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* 👉 HIER EINFÜGEN */
.gallery-grid {
  margin-top: 20px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.image-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;

  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;

  font-weight: 800;
  color: #fff6ee;

  background:
    linear-gradient(rgba(8,2,10,0.5), rgba(8,2,10,0.85)),
    url('../../images/hero/background.webp') center center / cover no-repeat;

  text-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

.lightbox {
  position: fixed;
  inset: 0;

  background:
    linear-gradient(
      rgba(5,2,8,0.82),
      rgba(5,2,8,0.92)
    ),
    url('../../images/hero/background.webp') center center / cover no-repeat fixed;

  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  overflow: hidden;

  backdrop-filter: blur(4px);
}

.lightbox.open { 
  display: flex; 
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  touch-action: pan-y;
  position: relative;
  z-index: 2;
}

/* =========================================
   PROFESSIONELLES LIGHTBOX-WASSERZEICHEN
========================================= */
.lightbox::after {
  content: "";
  position: absolute;
  inset: -20%;

  background-image: url('../../images/branding/logo.webp');
  background-repeat: repeat;
  background-size: 120px 120px;
  background-position: center;

  opacity: 0.16;
  pointer-events: none;

  z-index: 10000;

  transform: rotate(-18deg) scale(1.25);

  filter:
    drop-shadow(0 2px 6px rgba(0,0,0,0.35))
    blur(0.15px);
}

/* Leichter Glow-Effekt */
.lightbox::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at center,
      rgba(255,140,40,0.08),
      transparent 70%
    );

  z-index: 1;
  pointer-events: none;
}

/* =========================================
   BUTTONS
========================================= */

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  z-index: 10001;

  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 0 20px rgba(255,140,40,0.25);
}

.lightbox-close {
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
}

.lightbox-prev { 
  left: 18px; 
}

.lightbox-next { 
  right: 18px; 
}

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);

  padding: 8px 14px;
  border-radius: 999px;

  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);

  color: white;
  font-weight: 700;

  z-index: 10001;
}

/* =========================================
   GALLERY CARDS
========================================= */

.gallery-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.image-caption {
  padding: 12px 14px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .gallery-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
  }
}

@media (max-width: 560px) {
  .gallery-grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

.gallery-image-wrap {
  position: relative;
  overflow: hidden;
}

/* Wasserzeichen auf Galerie-Vorschaubildern */
.gallery-image-wrap::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;

  width: 44px;
  height: 44px;

  background: url('../../images/branding/logo.webp') center / contain no-repeat;

  opacity: 0.5;

  pointer-events: none;

  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));

  z-index: 2;
}

/* =========================================
   UX GALLERY
========================================= */

.ux-gallery {
  align-items: stretch;
}

.ux-gallery-card.is-hidden {
  display: none;
}

.ux-gallery-card {
  animation: galleryFadeIn 0.28s ease both;
}

.ux-gallery-card .card-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text);
}

.ux-gallery-card .card-body p {
  margin: 0;
}

.gallery-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.gallery-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.compact-section-head {
  margin-bottom: 20px;
}

@keyframes galleryFadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }

  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* =========================================
   PREMIUM HOVER-EFFEKT
========================================= */

.gallery-card,
.ux-gallery-card {
  position: relative;
  overflow: hidden;

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;

  will-change: transform;
}

.gallery-card:hover,
.ux-gallery-card:hover,
.gallery-card:focus-within,
.ux-gallery-card:focus-within {
  transform: translateY(-6px);

  border-color: rgba(255, 190, 120, 0.42);

  box-shadow:
    0 20px 46px rgba(0,0,0,0.48),
    0 0 22px rgba(255, 122, 24, 0.18);
}

.gallery-card img,
.ux-gallery-card img {
  transition:
    transform 0.42s ease,
    filter 0.42s ease;

  will-change: transform;
}

.gallery-card:hover img,
.ux-gallery-card:hover img,
.gallery-card:focus-within img,
.ux-gallery-card:focus-within img {
  transform: scale(1.07);
  filter: brightness(1.08) contrast(1.04);
}

.gallery-image-wrap::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 1;

  background:
    linear-gradient(
      180deg,
      rgba(255, 122, 24, 0.00),
      rgba(255, 122, 24, 0.18)
    );

  opacity: 0;

  transition: opacity 0.3s ease;

  pointer-events: none;
}

.gallery-card:hover .gallery-image-wrap::before,
.ux-gallery-card:hover .gallery-image-wrap::before,
.gallery-card:focus-within .gallery-image-wrap::before,
.ux-gallery-card:focus-within .gallery-image-wrap::before {
  opacity: 1;
}

.gallery-card .card-body,
.ux-gallery-card .card-body {
  transition:
    transform 0.28s ease,
    background 0.28s ease;
}

.gallery-card:hover .card-body,
.ux-gallery-card:hover .card-body,
.gallery-card:focus-within .card-body,
.ux-gallery-card:focus-within .card-body {
  transform: translateY(-2px);
  background: rgba(255, 122, 24, 0.04);
}

@media (prefers-reduced-motion: reduce) {

  .gallery-card,
  .ux-gallery-card,
  .gallery-card img,
  .ux-gallery-card img,
  .gallery-image-wrap::before,
  .gallery-card .card-body,
  .ux-gallery-card .card-body {
    transition: none;
  }

  .gallery-card:hover,
  .ux-gallery-card:hover,
  .gallery-card:focus-within,
  .ux-gallery-card:focus-within,
  .gallery-card:hover img,
  .ux-gallery-card:hover img,
  .gallery-card:focus-within img,
  .ux-gallery-card:focus-within img,
  .gallery-card:hover .card-body,
  .ux-gallery-card:hover .card-body,
  .gallery-card:focus-within .card-body,
  .ux-gallery-card:focus-within .card-body {
    transform: none;
  }
}
/* =========================================
   BILDSCHUTZ
========================================= */

.gallery-grid,
.gallery-card,
.gallery-image-wrap,
.lightbox,
.lightbox-image-wrap,
.lightbox img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.lightbox-image-wrap {
  position: relative;
  z-index: 2;
  display: inline-flex;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  border-radius: 20px;
  overflow: hidden;
}

.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-protection-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  pointer-events: none;
}

/* =========================================
   PREMIUM LIGHTBOX ZOOM + BILDSCHUTZ
========================================= */

.gallery-grid,
.gallery-card,
.gallery-image-wrap,
.lightbox,
.lightbox-image-wrap,
.lightbox img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.lightbox-image-wrap {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  border-radius: 20px;
  overflow: hidden;
  touch-action: none;
}

.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.18s ease;
  cursor: zoom-in;
  will-change: transform;
}

.lightbox-image-wrap img.is-zoomed {
  cursor: grab;
}

.lightbox-image-wrap img.is-zoomed:active {
  cursor: grabbing;
}

.lightbox-protection-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  pointer-events: none;
}

.lightbox img {
  touch-action: none;
}