/* The page shell is narrower than the scrollport. The first card follows its gutter. */
body:has(.store-gallery) { overflow-x: clip; }
.store-project-main { container-type: inline-size; }

.store-gallery {
  --side: calc((100vw - 100cqw) / 2);
  position: relative;
  min-width: 0;
  margin: clamp(26px, 3.4vw, 44px) calc(0px - var(--side)) 0;
}

.store-screenshots {
  --shot-width: clamp(210px, 17vw, 310px);
  display: flex;
  gap: clamp(10px, 1.1vw, 16px);
  align-items: flex-start;
  margin: 0;
  padding: 0 var(--side);
  overflow-x: auto;
  scroll-padding-inline: var(--side);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  list-style: none;
}

.store-screenshots::-webkit-scrollbar { display: none; }
.store-screenshots li { flex: 0 0 var(--shot-width); min-width: 0; }
.store-screenshots a { display: block; border-radius: 18px; cursor: zoom-in; }
.store-screenshots a:focus-visible { outline-offset: -3px; }
.store-screenshots a, .store-screenshots img { -webkit-user-drag: none; user-select: none; }
.store-screenshots.is-dragging, .store-screenshots.is-dragging a { cursor: grabbing; }

.store-screenshots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  background-color: #eef2f0;
  background-size: cover;
}

.store-scroll {
  position: absolute;
  inset: 0 clamp(10px, 2vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.store-scroll[hidden] { display: none; }

.store-scroll button, .store-viewer button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #17243a;
  cursor: pointer;
}

.store-scroll button { box-shadow: 0 2px 8px #17243a24; pointer-events: auto; }
.store-scroll button:disabled { visibility: hidden; }
.store-scroll button:hover { background: #f1f5f3; }

.store-scroll button:first-child svg { transform: rotate(180deg); }

.store-viewer {
  max-width: min(100% - 24px, 680px);
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.store-viewer::backdrop { background: rgb(16 25 39 / 82%); }
.store-viewer > div { position: relative; }
.store-viewer img { display: block; max-width: 100%; max-height: calc(100dvh - 48px); border-radius: 16px; }
.store-viewer button { position: absolute; inset: 8px 8px auto auto; }

@media (max-width: 560px) {
  .store-screenshots { --shot-width: clamp(188px, 60vw, 280px); }
}

@media (hover: hover) and (pointer: fine) {
  .store-screenshots a { cursor: grab; }
}

@media (hover: none) {
  .store-scroll { display: none; }
}
