.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
  border: 0;
}

.gallery-filters label,
.gallery-jump a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #b9d6da;
  border-radius: 999px;
  color: var(--navy);
  font-size: 14px;
}

.gallery-filters label {
  cursor: pointer;
}

.gallery-filters label:has(:checked),
.gallery-jump a:hover {
  background: #e0f1f1;
}

.gallery-filters input {
  margin: 0;
  accent-color: var(--teal-deep);
}

.gallery-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 225px);
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding: 5px 5px 10px;
  scroll-padding-inline: 5px;
  scroll-snap-type: x mandatory;
}

.gallery-rail .tile {
  display: grid;
  grid-template-rows: 150px 1fr;
  align-items: stretch;
  width: 100%;
  border: 0;
  font: inherit;
  cursor: pointer;
  scroll-snap-align: start;
}

.gallery-rail .video-cover {
  display: block;
  overflow: hidden;
}

.gallery-rail .video-cover img {
  display: block;
}

.gallery-rail .tile > span {
  display: block;
  align-content: center;
  padding: 14px 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gallery-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.gallery:has([value="photo"]:checked) .gallery-video,
.gallery:has([value="video"]:checked) .gallery-photo,
.gallery:has([value="photo"]:checked) .gallery-jump {
  display: none;
}

.gallery-dialog {
  width: min(34rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: clamp(18px, 5vw, 32px);
  border: 0;
  border-radius: 20px;
  color: var(--navy);
  background: white;
  box-shadow: 0 20px 70px #081b4544;
  overflow: auto;
}

.gallery-dialog::backdrop {
  background: #081b4577;
}

.gallery-dialog h3 {
  font-size: 21px;
  overflow-wrap: anywhere;
}

.gallery-dialog .cta {
  max-width: 100%;
}

.gallery-player {
  display: block;
  width: 100%;
  height: auto;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  border: 0;
  margin-block: 12px;
}

.gallery-dismiss {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.gallery-dismiss button {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid #b9d6da;
  border-radius: 8px;
  background: white;
  color: inherit;
  cursor: pointer;
}

.gallery-dialog img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  margin: 12px auto 0;
}
