/* ============================================================
   Slideshow Component
   Arrow navigation, thumbnail strip, touch swipe, keyboard.
   ============================================================ */

.slideshow {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  user-select: none;
}

/* ── Main area (image + arrows) ── */
.slideshow__main {
  position: relative;
}

.slideshow__viewport {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-gray-900, #111);
}

.slideshow__track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.slideshow__slide {
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.slideshow__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Arrow navigation ── */
.slideshow__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  color: var(--color-gray-900, #111);
}

.slideshow__arrow--prev { left:  12px; }
.slideshow__arrow--next { right: 12px; }

.slideshow__arrow:hover {
  background: var(--color-white, #fff);
  transform: translateY(-50%) scale(1.08);
}

.slideshow__arrow:focus-visible {
  outline: 2px solid var(--color-accent, #c9a227);
  outline-offset: 3px;
}

.slideshow__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Slide counter ── */
.slideshow__counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  border-radius: 20px;
  pointer-events: none;
}

/* ── Thumbnail strip ── */
.slideshow__thumbnails {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
  background: rgba(0, 0, 0, 0.7);
}

.slideshow__thumbnails::-webkit-scrollbar {
  height: 4px;
}

.slideshow__thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.slideshow__thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.slideshow__thumb {
  flex: 0 0 72px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  background: var(--color-gray-800, #1f2937);
}

.slideshow__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slideshow__thumb.is-active {
  opacity: 1;
  border-color: var(--color-accent, #c9a227);
}

.slideshow__thumb:hover:not(.is-active) {
  opacity: 0.85;
  transform: scale(1.05);
}

.slideshow__thumb:focus-visible {
  outline: 2px solid var(--color-accent, #c9a227);
  outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .slideshow__arrow {
    width: 38px;
    height: 38px;
  }

  .slideshow__arrow--prev { left: 6px; }
  .slideshow__arrow--next { right: 6px; }

  .slideshow__thumb {
    flex: 0 0 60px;
    height: 44px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .slideshow__track {
    transition: none;
  }

  .slideshow__arrow {
    transition: none;
  }
}
