.gallery-card > button {
  position: relative;
}
.gallery-card--album > button {
  cursor: pointer;
}
.gallery-card > button > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #020b12;
}
.gallery-video-badge {
  position: absolute;
  left: 15px;
  bottom: 15px;
  padding: 9px 12px;
  border-radius: 99px;
  color: #fff;
  background: rgba(6, 21, 33, 0.84);
  font: 600 8px "DM Mono", monospace;
  letter-spacing: 0.08em;
}
.gallery-lightbox > video {
  width: 100%;
  max-height: 76vh;
  display: block;
  background: #020b12;
}
.gallery-lightbox > video[hidden] { display: none; }
.gallery-card--album > button::after {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 10px;
  z-index: -1;
  border: 1px solid var(--gallery-line);
  background: #fff;
}

/* Keep the public gallery legible even when the visitor uses dark device mode. */
.gallery-directory {
  color: var(--gallery-ink);
  color-scheme: light;
}

@media (max-width: 540px) {
  .gallery-hero {
    min-height: 330px;
    padding: 104px 0 48px;
  }

  .gallery-directory {
    padding: 48px 0 76px;
  }

  .gallery-heading {
    gap: 22px;
  }

  .gallery-heading h2 {
    font-size: 38px;
    line-height: 1;
  }

  .gallery-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .gallery-card > button,
  .gallery-card:nth-child(n) > button {
    height: min(118vw, 460px);
  }

  .gallery-swipe {
    position: relative;
    height: min(118vw, 460px);
    overflow: hidden;
    background: #dce7ec;
  }

  .gallery-swipe__track {
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-swipe__track::-webkit-scrollbar {
    display: none;
  }

  .gallery-swipe__slide {
    width: 100%;
    height: 100%;
    min-width: 100%;
    padding: 0;
    flex: 0 0 100%;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border: 0;
    background: #dce7ec;
  }

  .gallery-swipe__slide img,
  .gallery-swipe__slide video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }

  .gallery-swipe__counter,
  .gallery-swipe__hint {
    position: absolute;
    z-index: 2;
    bottom: 14px;
    padding: 8px 11px;
    border-radius: 999px;
    color: #fff !important;
    background: rgba(6, 21, 33, 0.84);
    font: 600 8px "DM Mono", monospace !important;
    letter-spacing: 0.06em;
    pointer-events: none;
  }

  .gallery-swipe__counter {
    right: 14px;
  }

  .gallery-swipe__hint {
    left: 14px;
  }
}
.gallery-album-count {
  position: absolute;
  right: 15px;
  bottom: 15px;
  padding: 8px 11px;
  border-radius: 99px;
  color: #fff;
  background: rgba(6, 21, 33, 0.82);
  font: 600 8px "DM Mono", monospace;
  letter-spacing: 0.08em;
}
.gallery-album-label {
  color: var(--gallery-blue) !important;
  font: 600 9px "DM Mono", monospace !important;
  letter-spacing: 0.06em;
}
.gallery-lightbox-nav {
  display: none;
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(4, 24, 38, 0.78);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.gallery-lightbox > .gallery-lightbox-nav {
  top: 50%;
  right: auto;
}
.gallery-lightbox.is-album .gallery-lightbox-nav { display: block; }
.gallery-lightbox-prev { left: 14px; }
.gallery-lightbox > .gallery-lightbox-next { right: 14px; }
.gallery-download {
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 64px;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  color: #fff;
  background: rgba(4, 24, 38, 0.82);
  font: 600 9px Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.gallery-download:hover { background: #2866ff; }

@media (max-width: 540px) {
  .gallery-download {
    top: 14px;
    right: 58px;
    min-height: 34px;
    padding-inline: 11px;
    font-size: 8px;
  }

  .gallery-lightbox > button[data-gallery-close] {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .gallery-lightbox > .gallery-lightbox-nav {
    top: 50%;
    width: 40px;
    height: 40px;
  }
}
