.artifact-gallery > h2 {
  margin-bottom: 1rem;
}

.artifact-carousel {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: .75rem;
}

.artifact-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2.5rem) / 3);
  gap: 1.25rem;
  margin: 0;
  padding: 0 0 .25rem;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.artifact-strip > li {
  min-width: 0;
  scroll-snap-align: start;
}

.artifact-card {
  display: grid;
  gap: .5rem;
  width: 100%;
  padding: 0;
  border: 0;
  color: #4a5568;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .875rem;
  text-align: center;
}

.artifact-card:focus-visible {
  outline: none;
}

.artifact-thumbnail {
  display: grid;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #f7fafc;
}

.artifact-card:hover .artifact-thumbnail {
  border-color: #a0aec0;
}

.artifact-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artifact-card:focus-visible .artifact-thumbnail::after,
.artifact-card[aria-pressed="true"] .artifact-thumbnail::after {
  position: absolute;
  inset: 0;
  content: '';
  box-shadow: inset 0 0 0 2px #3182ce;
  border-radius: inherit;
}

.artifact-play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: clamp(2.55rem, 5vw, 3.4rem);
  height: clamp(2.55rem, 5vw, 3.4rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #1a202ce0;
  color: #fff;
}

.artifact-play::before {
  content: '';
  width: 0;
  height: 0;
  margin-left: .15rem;
  border-block: .42rem solid transparent;
  border-left: .63rem solid currentColor;
}

.artifact-scroll {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  min-width: 0;
  padding: 0;
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #4a5568;
  background: transparent;
  cursor: pointer;
}

.artifact-scroll:disabled {
  visibility: hidden;
}

.artifact-scroll:hover {
  background: #edf2f7;
}

.artifact-scroll::before {
  content: '';
  width: .42rem;
  height: .42rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.artifact-previous::before {
  transform: rotate(-135deg);
}

.artifact-player[hidden],
.artifact-player [hidden] {
  display: none;
}

.artifact-player {
  width: min(100%, 50rem);
  display: grid;
  gap: .75rem;
  margin: 1.25rem auto 0;
  padding: .85rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #fff;
  scroll-margin-top: 1rem;
}

.artifact-caption h3 {
  margin: 0;
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.artifact-caption p,
.artifact-status {
  margin: .25rem 0 0;
  color: #4a5568;
  font-size: .875rem;
}

.artifact-player video,
.artifact-player > img {
  display: block;
  max-width: 100%;
  width: 100%;
  max-height: min(32rem, 65svh);
  object-fit: contain;
  border-radius: .25rem;
}

.artifact-player video {
  aspect-ratio: 16 / 9;
  background: #1a202c;
}

@media (max-width: 62rem) {
  .artifact-strip {
    grid-auto-columns: calc((100% - 1.25rem) / 2);
  }
}

@media (max-width: 37rem) {
  .artifact-carousel {
    grid-template-columns: 1fr auto auto 1fr;
    gap: .5rem;
  }

  .artifact-strip {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-auto-columns: 100%;
  }

  .artifact-previous, .artifact-next {
    grid-row: 2;
    margin-bottom: 0;
  }

  .artifact-previous { grid-column: 2; }
  .artifact-next { grid-column: 3; }
}

@media print {
  .artifact-scroll, .artifact-player, .artifact-play { display: none !important; }
  .artifact-carousel { display: block; }
  .artifact-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    overflow: visible;
  }
  .artifact-strip > li { break-inside: avoid; }
}
