/* Screenshot strip (two at a time) and full-screen viewer for the DueRadar site. */

.gallery {
  position: relative;
  max-width: 720px;
  margin: 24px auto;
}

.gallery-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: 16px;
}

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

.gallery-track:focus-visible {
  outline: 3px solid #208aef;
  outline-offset: 4px;
}

/* Exactly two screenshots fit; swipe or use the arrows for the rest. */
.gallery-item {
  flex: 0 0 calc((100% - 12px) / 2);
  scroll-snap-align: start;
  display: block;
  cursor: zoom-in;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #111;
}

.gallery-nav,
.lightbox-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  border: none;
  border-radius: 50%;
  font: 32px/1 system-ui, sans-serif;
  cursor: pointer;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  color: #0b6bd3;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-nav[hidden] {
  display: none;
}

.gallery-prev {
  left: -14px;
}

.gallery-next {
  right: -14px;
}

/* Full-screen viewer */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: #000000;
  overflow: auto;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  border-radius: 12px;
  cursor: zoom-in;
}

/* Tapping the picture shows it at full size; scroll around, tap again to fit. */
.lightbox.zoomed {
  display: block;
  text-align: center;
}

.lightbox.zoomed .lightbox-image {
  max-width: none;
  max-height: none;
  width: min(1080px, 200vw);
  margin: 72px auto 24px;
  cursor: zoom-out;
}

.lightbox-caption {
  margin: 12px 16px 0;
  color: #e6e6e6;
  font-size: 15px;
  text-align: center;
}

.lightbox-button {
  position: fixed;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.lightbox-button:hover,
.lightbox-button:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: 16px;
  right: 16px;
  font-size: 22px;
  padding: 0;
}

.lightbox-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox.zoomed .lightbox-prev,
.lightbox.zoomed .lightbox-next {
  display: none;
}
