/* Wyłącznie Galeria na Home. Płaszczyzna 1320 px, bez skalowania fotografii
   w animacji: odsłaniamy nieruchomą panoramę o szerokości 884 px. */
.gallery-teaser .grid { pointer-events: none; }
.gallery-teaser .grid > * { pointer-events: auto; }
.gallery-teaser__head { grid-column: 1 / span 6; }
.gallery-teaser__head .h2 { font-size: clamp(24px, 3.333333vw, 64px); }
.gallery-teaser__cta { padding-inline: 0; border-inline-width: 0; justify-content: flex-start; }

.gallery-reveal {
  position: absolute;
  left: var(--page-margin);
  right: var(--page-margin);
  top: var(--gallery-photo-top, 64px);
  aspect-ratio: 1320 / 360;
  container-type: inline-size;
  isolation: isolate;
}
.gallery-reveal__photo {
  --unit: calc(100cqw / 1320);
  position: absolute;
  top: 0;
  left: calc((708 + var(--slot) * 96) * var(--unit));
  width: calc(420 * var(--unit));
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: calc(112 * var(--unit));
  background: transparent;
  overflow: hidden;
  z-index: var(--layer);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gallery-reveal__photo:focus-visible { outline: var(--focus); outline-offset: 4px; }
.gallery-reveal__photo img {
  display: block;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
.gallery-reveal__photo--main img { width: calc(884 * var(--unit)); }

.gallery-reveal:is(.is-ready, .is-playing) .gallery-reveal__photo--main {
  left: calc(436 * var(--unit));
  width: calc(884 * var(--unit));
  clip-path: inset(0 calc(572 * var(--unit)) 0 0 round calc(112 * var(--unit)));
}
.gallery-reveal:is(.is-ready, .is-playing) .gallery-reveal__photo:not(.gallery-reveal__photo--main) { visibility: hidden; }
.gallery-reveal.is-playing .gallery-reveal__photo--main {
  animation: gallery-capsule-travel 1800ms cubic-bezier(.45, 0, .2, 1) both;
}
.gallery-reveal.is-playing .gallery-reveal__photo:not(.gallery-reveal__photo--main) {
  animation: gallery-capsule-backplates 1800ms linear both;
}
@keyframes gallery-capsule-travel {
  0%, 5.5556% { clip-path: inset(0 calc(572 * var(--unit)) 0 0 round calc(112 * var(--unit))); }
  50%, 63.8889% { clip-path: inset(0 0 0 0 round calc(112 * var(--unit))); }
  100% { clip-path: inset(0 0 0 calc(464 * var(--unit)) round calc(112 * var(--unit))); }
}
@keyframes gallery-capsule-backplates {
  0%, 63.8888% { visibility: hidden; }
  63.8889%, 100% { visibility: visible; }
}
.gallery-reveal__transition { pointer-events: none; z-index: 4; }
.gallery-reveal.is-floating .gallery-reveal__photo { will-change: transform; }

@media (max-width: 1023px) {
  .gallery-teaser .grid { min-height: 0; }
  .gallery-teaser__head { grid-column: 1 / -1; }
  .gallery-reveal {
    position: relative;
    inset: auto;
    width: min(612px, 100%);
    margin: 40px 0 0 auto;
    aspect-ratio: 612 / 360;
  }
  .gallery-reveal__photo {
    --unit: calc(100cqw / 612);
    --tab: max(44px, calc(96 * var(--unit)));
    width: calc(100cqw - 2 * var(--tab));
    left: calc(var(--slot) * var(--tab));
    height: auto;
    aspect-ratio: 420 / 360;
    border-radius: calc((100cqw - 2 * var(--tab)) * 112 / 420);
  }
  .gallery-reveal__photo--main img { width: calc((100cqw - 2 * var(--tab)) * 884 / 420); }
  /* Uproszczone wejście na mniejszych ekranach: od razu interaktywny stos. */
  .gallery-reveal:is(.is-ready, .is-playing) .gallery-reveal__photo {
    left: calc(var(--slot) * var(--tab));
    width: calc(100cqw - 2 * var(--tab));
    clip-path: none;
    visibility: visible;
    animation: none;
  }
}
@media (max-width: 767px) {
  .gallery-teaser .grid { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-reveal:is(.is-ready, .is-playing) .gallery-reveal__photo {
    animation: none;
    visibility: visible;
  }
}
