/* See inc/photo-slider.php. WordPress' and the theme's gallery rules are strong (one has an id),
   hence the repeated class and !important. */
.site:has(.photo-slider) {
  overflow-x: clip; /* the row is as wide as the screen, scrollbar included */
}

body .entry-content .wp-block-gallery.photo-slider.photo-slider.photo-slider.has-nested-images {
  --photo: min(80vw, 600px);
  display: flex !important;
  flex-flow: row nowrap !important;
  gap: 1rem !important;
  box-sizing: border-box;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 0 2.5rem calc(50% - 50vw) !important;
  padding: 0 calc((100vw - var(--photo)) / 2) !important;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.photo-slider::-webkit-scrollbar {
  display: none;
}

body .entry-content .wp-block-gallery.photo-slider.photo-slider.photo-slider.has-nested-images > .wp-block-image.wp-block-image {
  flex: 0 0 var(--photo) !important;
  width: var(--photo) !important;
  max-width: none !important;
  margin: 0 !important;
  scroll-snap-align: center;
}

body .entry-content .wp-block-gallery.photo-slider.photo-slider.photo-slider.has-nested-images > .wp-block-image.wp-block-image img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.photo-slider.is-dragging {
  cursor: grabbing !important;
}

.photo-slider.is-moving {
  scroll-snap-type: none !important;
}

.photo-slider:focus-visible {
  outline: 2px solid #222;
  outline-offset: 4px;
}
