.gallery .photo-frame{position:relative}

.gallery-track{
  display:flex;
  aspect-ratio:var(--gallery-ratio, 1);
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  outline:none;
}
.gallery-track::-webkit-scrollbar{display:none}
.gallery .photo-frame:has(.gallery-track:focus-visible){outline:2px solid var(--fg);outline-offset:3px}

.gallery-slide{
  flex:0 0 100%;
  min-width:0;
  scroll-snap-align:center;
  scroll-snap-stop:always;
}
.gallery .gallery-slide img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.gallery-dots{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:4px;
  min-height:21px;
  padding-top:10px;
}
.gallery-dot{
  width:5px;
  height:5px;
  border-radius:999px;
  background:var(--fg-dim);
  opacity:.65;
  transition:width .2s ease, opacity .2s ease, background-color .2s ease;
}
.gallery-dot.is-active{width:15px;background:var(--fg);opacity:1}

.gallery-nav{
  position:absolute;
  top:50%;
  display:none;
  place-items:center;
  width:40px;
  height:40px;
  margin-top:-20px;
  padding:0;
  border:0;
  border-radius:999px;
  background:var(--bg);
  color:var(--fg);
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:opacity .2s ease, transform .15s ease;
}
.gallery-nav svg{width:20px;height:20px}
.gallery-nav--prev{left:10px}
.gallery-nav--next{right:10px}
.gallery-nav:active{transform:scale(.94)}
.gallery-nav:disabled{opacity:0;pointer-events:none}
.gallery-nav:focus-visible{outline:2px solid var(--fg);outline-offset:2px}

@media (hover:hover) and (pointer:fine){
  .gallery-nav{display:grid}
}

@media (prefers-reduced-motion: reduce){
  .gallery-dot,
  .gallery-nav{transition:none}
}
