/* ===================== KÜCHEN-GALERIE ===================== */
.gallery-section {
  padding: 96px 32px;
  background: var(--paper);
}
.gallery-wrap {
  max-width: var(--max);
  margin: 0 auto;
}
.gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding: 6px;
  background: var(--paper-2);
  border-radius: 100px;
  width: max-content;
  max-width: 100%;
}
.gallery-filter {
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.gallery-filter:hover { background: rgba(255,255,255,0.6); }
.gallery-filter.active { background: var(--ink); color: var(--paper); }
.gallery-filter .gallery-count {
  font-size: 11px;
  opacity: 0.5;
  font-feature-settings: "tnum";
}
.gallery-filter.active .gallery-count { color: var(--accent); opacity: 1; }

/* Masonry mit CSS Columns — automatisches Layout für gemischte Bildformate */
.gallery-grid {
  column-count: 4;
  column-gap: 16px;
}
@media (max-width: 1100px) { .gallery-grid { column-count: 3; } }
@media (max-width: 720px) { .gallery-grid { column-count: 2; column-gap: 10px; } }
@media (max-width: 440px) { .gallery-grid { column-count: 1; } }

.gal-item {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  background: var(--paper-2);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s, opacity 0.5s;
}
@media (max-width: 720px) { .gal-item { margin-bottom: 10px; } }
.gal-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.gal-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -16px rgba(0,0,0,0.25);
}
.gal-item:hover img { transform: scale(1.03); }
.gal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.gal-item:hover::after { opacity: 1; }

/* Hidden state für Filter (statt display:none — sanftere Animation) */
.gal-item.hidden {
  display: none;
}

/* Load-More Bereich */
.gallery-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}
.gallery-loadmore[hidden] { display: none; }

/* Initial: Bilder oberhalb Index 16 versteckt — werden via "Mehr anzeigen" angezeigt */
.gal-item.hide-overflow { display: none; }

/* ===================== LIGHTBOX ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFadeIn 0.3s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  animation: lbImgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes lbImgIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.lightbox-caption {
  margin-top: 16px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--paper);
  width: 52px; height: 52px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.lightbox-close svg,
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(2px); }

@media (max-width: 720px) {
  .lightbox-close, .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-close svg, .lightbox-nav svg { width: 18px; height: 18px; }
  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-content img { max-height: 70vh; }
}

/* ===================== LAZY LOADING ===================== */
/* Platzhalter-Höhe damit Masonry-Layout nicht kollabiert */
.lazy-img {
  display: block;
  width: 100%;
  min-height: 240px;
  background: var(--paper-2);
  transition: opacity 0.4s ease;
}
.lazy-img.loaded {
  min-height: 0;
}
/* Subtiler Pulse-Effekt während Lade */
.lazy-img:not(.loaded) {
  background: linear-gradient(110deg, #ECECE9 30%, #F5F5F2 50%, #ECECE9 70%);
  background-size: 200% 100%;
  animation: lazyPulse 1.5s ease-in-out infinite;
}
@keyframes lazyPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
