/* The space: a swipeable strip of the designer's renders, shown whole as stills.
   CSS scroll snap does the swiping; gallery.js adds mouse drag, buttons, counter and arrow keys.
   Each render sits inside a solid border with no gradient (owner, 2026-10-10: "pictures here
   shouldn't be gradient, use a proper border"); the border is outside the picture, so none of it is covered. */

.gallery {
  --slide-h: calc(44vw + 10px);
  --gallery-gap: 14px;
}

.gallery-strip {
  position: relative;
  display: flex;
  gap: var(--gallery-gap);
  width: 100%;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
}

.gallery-strip::-webkit-scrollbar {
  display: none;
}

.gallery-strip:focus {
  outline: none;
}

/* Spacers so the first and last render can rest centered (all renders are wider than 1.4 to 1) */

.gallery-strip::before,
.gallery-strip::after {
  content: "";
  flex: 0 0 calc(50% - var(--slide-h) * 0.7);
}

.gallery-strip.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}

.gallery-slide {
  flex: 0 0 auto;
  box-sizing: content-box;
  height: var(--slide-h);
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
}

/* Controls: round arrow buttons around a counter, in the page's ink and cognac tones */

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.gallery-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.gallery-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-btn:hover {
  background: var(--ink);
  color: var(--cream);
}

.gallery-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.gallery-btn[aria-disabled="true"] {
  background: none;
  color: var(--ink);
  opacity: 0.3;
  cursor: default;
}

.gallery-counter {
  min-width: 6ch;
  color: var(--cognac);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Keyboard focus on the strip shows on the counter, so no ring is drawn around the renders */

.gallery-strip:focus-visible ~ .gallery-controls .gallery-counter {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@media (min-width: 768px) {
  .gallery {
    --slide-h: clamp(300px, 34vw + 70px, 580px);
    --gallery-gap: 24px;
  }

  .gallery-controls {
    padding-top: 28px;
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-strip {
    scroll-behavior: auto;
  }
}
