/* Nexus Launcher user guide — screenshot carousels (guide-carousel.js).
   One screenshot at a time with its neighbours peeking, so a reader sees
   there is more to swipe to. Print lays every slide out side by side. */

.shot-carousel { margin: 1.4rem 0; }

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
}

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

/* Spacers so the first and last slides can sit in the middle (minus the gap beside them). */
.carousel-track::before,
.carousel-track::after {
  content: "";
  flex: 0 0 calc((100% - min(19rem, 82%)) / 2 - 1rem);
}

.carousel-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 0.25rem; }

.carousel-track > .shot {
  flex: 0 0 min(19rem, 82%);
  margin: 0;
  scroll-snap-align: center;
}

.carousel-track .screenshot-image { width: 100%; }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.carousel-controls > button {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-controls > button:hover:not(:disabled) { background: var(--glass-hover); }
.carousel-controls > button:disabled { opacity: 0.35; cursor: default; }

html[dir="rtl"] .carousel-controls > button { transform: scaleX(-1); }

.carousel-dots { display: flex; gap: 0.15rem; }

/* A 1.5rem target around a small dot; the current one is the page-indicator pill. */
.carousel-dots button {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.carousel-dots button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel-dots button[aria-current="true"]::before {
  width: 1.1rem;
  background: var(--ink);
}

.shot-carousel.is-single .carousel-controls { display: none; }
.shot-carousel.is-single .carousel-track { scroll-snap-type: none; }

@media (prefers-reduced-motion: reduce) {
  .carousel-dots button::before { transition: none; }
}

@media print {
  .carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40mm, 1fr));
    gap: 6mm;
    overflow: visible;
  }

  .carousel-track::before,
  .carousel-track::after { display: none; }

  .carousel-track .screenshot-image { width: 38mm; }
}
