/* --- Global fixes for mobile overflow and text scaling --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Floating slider with bottom-only shadow + thin border; width ≤1600px */
.r76-wrap {
  width: min(99vw, 1600px);
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  font-family: Arial, sans-serif;

  border-radius: 12px;
  overflow: hidden;
  background: transparent;

  border: 1px solid rgba(0,0,0,.14);

  box-shadow: none;
  filter:
    drop-shadow(0 30px 60px rgba(0,0,0,.32))
    drop-shadow(0 12px 24px rgba(0,0,0,.18));
}

/* Carousel core */
.carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}
.carousel-track {
  display: flex;
  transition: transform .5s ease-in-out;
  max-width: 100%;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
  max-width: 100%;
  cursor: pointer;
}

/* Images: responsive, never exceed viewport width */
.carousel-slide img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100vh;
  object-fit: contain;
}

/* Full-width caption band pinned to bottom */
.caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  color: #fff;
  padding: 10px 20px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .6s ease;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* One-line, JS-autofit text */
:root {
  --r76-title-max: 76px;
  --r76-title-min: 16px;
  --r76-subtitle-max: 38px;
  --r76-subtitle-min: 14px;
}
.caption h2 {
  margin: 0;
  font-size: var(--r76-title-max);
  line-height: 1.1;
  text-shadow: 3px 3px 8px rgba(0,0,0,.95);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}
.caption p {
  margin: 8px 0 0;
  font-size: var(--r76-subtitle-max);
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 2px 2px 6px rgba(0,0,0,.9);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* Hover (desktop): subtle affordance */
.carousel-slide:hover .caption h2,
.carousel-slide:hover .caption p {
  filter: brightness(1.05);
}

/* Keyboard focus: visible ring (accessibility) */
.carousel-slide:focus-visible {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Arrows */
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 20;
}
.carousel-button.prev { left: 15px; }
.carousel-button.next { right: 15px; }
.carousel-button img {
  width: 40px;
  height: 40px;
}

/* Hide arrows on devices without a mouse/trackpad */
@media (pointer: coarse) {
  .carousel-button { display: none !important; }
}

/* Thumbnails strip: smooth, touch-friendly scrolling */
.carousel-nav {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 15px;
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.carousel-nav::-webkit-scrollbar { display: none; }
.carousel-nav img {
  flex: 0 0 auto;
  width: 120px;
  max-width: 20vw;
  height: auto;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 4px;
  transition: border .3s, opacity .3s;
  scroll-snap-align: center;
}
.carousel-nav img:hover { opacity: .6; }
.carousel-nav img.active { border: 3px solid #333; }

/* Arrow size tweak for smaller laptops/tablets (if visible) */
@media (max-width: 768px) {
  .carousel-button img {
    width: 45px;
    height: 45px;
  }
}
