/* ============================================================================
   SLIDESHOW (with thumbnails)
   ============================================================================ */

.slideshow {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--background-color);
}

.slideshow:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main image area */

.slideshow-main {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  overflow: hidden;
}

.slideshow-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.slideshow-img.slideshow-fade-out {
  opacity: 0;
}

.slideshow-img.slideshow-fade-in {
  opacity: 1;
}

.slideshow-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #888);
  font-size: 0.9375rem;
}

.slideshow-counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 5;
  backdrop-filter: blur(4px);
}

/* Navigation buttons */

.slideshow-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}

.slideshow-nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.slideshow-prev {
  left: 1rem;
}

.slideshow-next {
  right: 1rem;
}

/* Thumbnail strip */

.slideshow-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.slideshow-thumbs::-webkit-scrollbar {
  height: 4px;
}

.slideshow-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.slideshow-thumbs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.slideshow-thumb {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 3rem;
  border: 2px solid transparent;
  border-radius: 0.375rem;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.slideshow-thumb:hover {
  opacity: 0.85;
}

.slideshow-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

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

/* -- Responsive -- */

@media (max-width: 900px) {
  .slideshow-main {
    aspect-ratio: 16 / 10;
  }

  .slideshow-nav-btn {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }

  .slideshow-thumb {
    width: 3.5rem;
    height: 2.25rem;
  }
}

@media (orientation: portrait) {
  .slideshow-main {
    aspect-ratio: 4 / 3;
  }

  .slideshow-nav-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }

  .slideshow-prev {
    left: 0.5rem;
  }

  .slideshow-next {
    right: 0.5rem;
  }

  .slideshow-thumb {
    width: 3rem;
    height: 2rem;
  }
}
