.gallery-icons { position: absolute; overflow: hidden; }
#gallery-heading { scroll-margin-top: 100px; }
.project-gallery { background: #f6f5f2; }
.project-gallery > .container { max-width: none; padding: 0; }
.project-gallery__heading { max-width: 1280px; margin: 0 auto 34px; padding: 0 24px; }
.project-gallery__heading .section-title { margin-bottom: 0; }
.project-gallery__stage { position: relative; }
.project-gallery__track {
  position: relative;
  width: 100%;
  height: clamp(560px, 63vw, 720px);
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
}
.project-gallery__slide {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: clamp(112px, 12vw, 176px);
  height: clamp(84px, 9vw, 132px);
  padding: 0;
  overflow: hidden;
  background: #dedbd4;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  filter: grayscale(1);
  transform: translate(-50%, -50%) translate(var(--gallery-x, 0px), var(--gallery-y, 0px)) scale(0.76);
  transition: width 0.55s ease, height 0.55s ease, opacity 0.4s ease, transform 0.55s ease, filter 0.4s ease;
}
.project-gallery__slide[data-gallery-offset] { opacity: 0.58; pointer-events: auto; }
.project-gallery__slide[data-gallery-offset="-3"] { --gallery-x: -48vw; --gallery-y: 106px; }
.project-gallery__slide[data-gallery-offset="-2"] { --gallery-x: -40vw; --gallery-y: -118px; }
.project-gallery__slide[data-gallery-offset="-1"] { --gallery-x: -31vw; --gallery-y: 84px; }
.project-gallery__slide[data-gallery-offset="1"] { --gallery-x: 31vw; --gallery-y: -82px; }
.project-gallery__slide[data-gallery-offset="2"] { --gallery-x: 40vw; --gallery-y: 126px; }
.project-gallery__slide[data-gallery-offset="3"] { --gallery-x: 48vw; --gallery-y: -104px; }
.project-gallery__slide[data-gallery-offset="0"] {
  z-index: 4;
  width: clamp(300px, 43vw, 610px);
  height: clamp(430px, 55vw, 650px);
  opacity: 1;
  filter: grayscale(0);
  transform: translate(-50%, -50%);
  cursor: zoom-in;
}
.project-gallery__slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.project-gallery__slide[data-gallery-offset="0"] img { object-fit: contain; }
.project-gallery__controls { display: flex; align-items: center; justify-content: center; gap: 20px; position: relative; margin-top: -44px; z-index: 8; }
.gallery-control {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a1a19b;
  border-radius: 50%;
  background: #f6f5f2;
  color: var(--color-black);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.gallery-control:hover { background: white; border-color: var(--color-black); }
.gallery-control svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.project-gallery__expand { position: absolute; top: calc(50% - clamp(430px, 55vw, 650px) / 2 + 12px); left: calc(50% + clamp(300px, 43vw, 610px) / 2 - 52px); width: 40px; height: 40px; z-index: 6; opacity: 0; transition: opacity 0.2s; }
.project-gallery__stage:hover .project-gallery__expand,
.project-gallery__stage:focus-within .project-gallery__expand { opacity: 1; }
.project-gallery__count { display: block; min-width: 60px; text-align: center; font-size: 0.875rem; color: #60675f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-gallery__caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gallery-control:focus-visible, .project-gallery__slide:focus-visible { outline: 2px solid var(--color-red); outline-offset: -3px; }
.pswp__project-caption { position: absolute; bottom: 12px; left: 60px; right: 60px; text-align: center; color: white; font-size: 0.875rem; text-shadow: 0 1px 4px black; pointer-events: none; }
@media (max-width: 768px) {
  .project-gallery__heading { padding: 0 16px; margin-bottom: 24px; }
  .project-gallery__heading .section-title { font-size: 1.5rem; }
  .project-gallery__track { height: 570px; }
  .project-gallery__slide { width: 92px; height: 69px; }
  .project-gallery__slide[data-gallery-offset="-2"] { --gallery-x: -46vw; --gallery-y: -168px; }
  .project-gallery__slide[data-gallery-offset="-1"] { --gallery-x: -43vw; --gallery-y: 146px; }
  .project-gallery__slide[data-gallery-offset="1"] { --gallery-x: 43vw; --gallery-y: -132px; }
  .project-gallery__slide[data-gallery-offset="2"] { --gallery-x: 46vw; --gallery-y: 172px; }
  .project-gallery__slide[data-gallery-offset="0"] { width: min(76vw, 390px); height: 470px; }
  .gallery-control { width: 48px; height: 48px; }
  .project-gallery__controls { margin-top: -40px; gap: 16px; }
  .project-gallery__expand { width: 36px; height: 36px; top: 58px; left: calc(50% + min(38vw, 195px) - 44px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-control, .project-gallery__slide, .project-gallery__expand { transition: none; }
}
