:root {
  --strip: 28px;
  --gap: 6px;
  --radius: 12px;
  --frame: 0.8;                 /* fester Rahmen 4:5 */
  --ease: cubic-bezier(.65, 0, .35, 1);
  --dur: .7s;
  --lb-bg: rgba(28, 10, 20, .97);
}
body { margin: 0; }
.gallery {
  padding: 32px 16px 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.stage {
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.panel {
  flex: none;
  position: relative;
  width: 0;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(67, 24, 47, .08);
  cursor: pointer;
  transition: width var(--dur) var(--ease), margin var(--dur) var(--ease), border-radius var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  filter: brightness(.72);
  transition: filter var(--dur) var(--ease), opacity .5s ease;
}
.panel.is-active { cursor: zoom-in; }
.panel.is-active img, .panel.is-big img { filter: none; }
.panel:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.counter {
  margin: 20px 0 0;
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

/* Vollbild */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--lb-bg);
  color: #fff;
  display: grid;
  grid-template-rows: 1fr auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
  touch-action: none;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.lb-figure {
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 56px 12px 8px;
}
.lb-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.lb-counter {
  margin: 0;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .8);
}
.lb-btn {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.lb-close { top: 8px; right: 8px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); display: none; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

@media (min-width: 768px) {
  :root { --strip: 56px; --gap: 10px; --radius: 16px; }
  .gallery { padding: 48px 32px 56px; }
  .counter { font-size: 16px; margin-top: 24px; }
  .lb-figure { padding: 64px 80px 8px; }
  .lb-prev, .lb-next { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0s; }
}

/* optimierte Bilder: unscharfe Vorschau im Hintergrund, Bild blendet sanft ein, sobald es geladen ist */
.panel picture { position: absolute; inset: 0; }
.panel img.fade { opacity: 0; }
.panel img.fade.is-loaded { opacity: 1; }
