.work-gallery {
  min-width: 0;
  width: 100%;
}

.work-gallery__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.02vw, 18px);
}

.work-gallery .work-window {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1.59;
  overflow: hidden;
}

.work-window img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.work-gallery .work-window:focus-visible {
  outline: 0;
}

.work-window:focus-visible::after {
  position: absolute;
  content: "";
  inset: 3px;
  pointer-events: none;
  border: 2px solid white;
  outline: 2px solid #421143;
}

.work-gallery__controls {
  display: none;
}

@media (max-width: 760px) {
  .work-gallery__track {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 87%;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .work-gallery__track::-webkit-scrollbar {
    display: none;
  }

  .work-card {
    scroll-snap-align: start;
  }

  .work-card:last-child {
    scroll-snap-align: end;
  }

  .work-gallery__controls:not([hidden]) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
  }

  .work-gallery__buttons {
    display: flex;
    gap: 4px;
  }

  .work-gallery__buttons button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    margin: 0;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }

  .work-gallery__buttons button:last-child {
    padding-right: 0;
  }

  .work-gallery__buttons button:enabled:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .work-gallery__buttons button:disabled {
    color: #746571;
    cursor: default;
  }

  .work-gallery__buttons button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
  }
}

.work-card { min-width: 0; }
