.stash-content {
  margin: 10px -3px 20px;
}

.asset-gallery {
  --asset-gap: 12px;
  position: relative;
}

.asset-gallery-status {
  margin: 0 0 20px;
}

.asset-gallery-status:empty {
  display: none;
}

.asset-card {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--fg, #111);
  background: transparent;
}

.asset-card img.is-loaded {
  animation: asset-fade-in 160ms ease-out;
}

@keyframes asset-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .asset-card img.is-loaded {
    animation: none;
  }
}

.asset-card img,
.asset-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}

.asset-card video {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.asset-card img.is-loaded,
.asset-card video.is-playing {
  visibility: visible;
}

.asset-card:focus-visible,
.asset-viewer-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.asset-gallery-status button {
  padding: 4px 8px;
  border: 1px solid var(--rule, #ddd);
  border-radius: 3px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

html.asset-viewer-open,
html.asset-viewer-open body {
  overflow: hidden;
}

.asset-viewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: min(100px, 10vmin);
  overflow: hidden;
  border: 0;
  color: var(--fg, #111);
  background: var(--bg, #fff);
}

.asset-viewer::backdrop {
  background: var(--bg, #fff);
}

.asset-viewer-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 100%;
}

.asset-viewer-media {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-viewer-close {
  position: fixed;
  top: 20px;
  right: 25px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  appearance: none;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
}

.asset-viewer-close svg {
  width: 100%;
  height: 100%;
}

.asset-viewer-close path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
}

@media (max-width: 600px) {
  .asset-gallery {
    --asset-gap: 8px;
  }
}
