.wf-gallery-card {
  overflow: hidden;
  border: 0;
}

.wf-gallery-card__cover {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: color-mix(in srgb, var(--wf-primary) 8%, #f8f9fa);
}

.wf-gallery-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.wf-gallery-card__cover:hover img,
.wf-gallery-card__cover:focus-visible img {
  transform: scale(1.025);
}

.wf-gallery-card__placeholder {
  font-size: clamp(3rem, 8vw, 5rem);
  filter: grayscale(1);
  opacity: .45;
}

.wf-gallery-presentation {
  max-width: 96rem;
  margin-inline: auto;
}

.wf-gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(68vh, 46rem);
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
  touch-action: pan-y;
}

.wf-gallery-stage img {
  display: block;
  width: 100%;
  height: min(68vh, 46rem);
  object-fit: contain;
}

.wf-gallery-caption {
  min-height: 8.5rem;
}

.wf-gallery-thumbnails {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding: .25rem .25rem .75rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.wf-gallery-thumbnail {
  flex: 0 0 9rem;
  height: 6.4rem;
  padding: .2rem;
  overflow: hidden;
  border: .2rem solid transparent;
  border-radius: .6rem;
  background: #fff;
  scroll-snap-align: center;
}

.wf-gallery-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: .25rem;
  object-fit: cover;
}

.wf-gallery-thumbnail.is-active {
  border-color: var(--wf-primary);
}

.wf-gallery-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0 0 .2rem;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.58);
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.wf-gallery-arrow--previous { left: 1rem; }
.wf-gallery-arrow--next { right: 1rem; }
.wf-gallery-arrow:disabled { opacity: .35; }

.wf-gallery-viewer {
  width: min(96vw, 100rem);
  max-width: none;
  height: min(94vh, 70rem);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: .75rem;
  color: #fff;
  background: #080808;
}

.wf-gallery-viewer::backdrop {
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(3px);
}

.wf-gallery-viewer[open] {
  display: block;
}

.wf-gallery-viewer__content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: #fff;
  background: #080808;
}

.wf-gallery-viewer__content:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.wf-gallery-viewer__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  padding: .75rem 1rem;
  background: #171717;
}

.wf-gallery-viewer__toolbar [data-wf-counter] {
  margin-right: auto;
}

.wf-gallery-viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.wf-gallery-viewer__stage img {
  position: absolute;
  inset: 0;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wf-gallery-viewer__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  min-height: 3rem;
  padding: .7rem 1rem;
  background: #171717;
}

.wf-gallery-viewer__caption [data-wf-description-wrap] {
  flex-basis: 100%;
  color: #ced4da;
}

.wf-gallery-viewer [data-wf-thumbnails] {
  margin: 0 !important;
  padding: .35rem .7rem;
  background: #171717;
}

.wf-gallery-viewer .wf-gallery-thumbnail { flex-basis: 5.5rem; height: 4rem; }

@media (max-width: 575.98px) {
  .wf-gallery-stage,
  .wf-gallery-stage img {
    min-height: 18rem;
    height: min(58vh, 34rem);
  }

  .wf-gallery-caption { min-height: 0; }
  .wf-gallery-thumbnail { flex-basis: 6.5rem; height: 4.75rem; }
  .wf-gallery-arrow { width: 2.55rem; height: 2.55rem; font-size: 1.65rem; }
  .wf-gallery-arrow--previous { left: .5rem; }
  .wf-gallery-arrow--next { right: .5rem; }

  .wf-gallery-viewer {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .wf-gallery-viewer__toolbar {
    flex-wrap: wrap;
    gap: .5rem;
    padding: .55rem;
  }

  .wf-gallery-viewer__toolbar > :first-child { flex: 1 1 auto; }
  .wf-gallery-viewer__toolbar [data-wf-counter] { margin-right: 0; }
  .wf-gallery-viewer__caption { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wf-gallery-card__cover img {
    transition: none;
  }
}
