/* ==========================================================================
   RT Dua — Photo carousel (home page hero)
   Auto-advancing slides with arrows, dots, keyboard + swipe support.
   ========================================================================== */

.carousel {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 22px 50px -18px rgba(8, 61, 34, .34), 0 2px 8px rgba(16, 24, 40, .05);
  aspect-ratio: 16 / 10;
  outline: 1px solid var(--border);
  outline-offset: -1px;
}

.carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform .62s cubic-bezier(.4, .01, .2, 1);
  will-change: transform;
}
html[data-theme] .carousel-track.no-anim { transition: none; }

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* caption overlay */
.carousel-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 46px 24px 20px;
  background: linear-gradient(to top, rgba(4, 26, 15, .86) 0%, rgba(4, 26, 15, .52) 46%, transparent 100%);
  color: #fff;
  pointer-events: none;
}
.carousel-cap .cc-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.6px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase;
  background: rgba(201, 162, 39, .94);
  color: #1c1607;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 9px;
}
.carousel-cap h3 {
  font-size: 16.5px; font-weight: 700; letter-spacing: -.012em;
  margin: 0 0 4px; line-height: 1.35;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .34);
}
.carousel-cap p {
  font-size: 12.6px; margin: 0; line-height: 1.5;
  color: rgba(255, 255, 255, .78);
}

/* arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(6, 32, 19, .44);
  backdrop-filter: blur(7px);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .22s, background .18s, transform .18s;
  z-index: 3;
}
.carousel-nav svg { width: 18px; height: 18px; }
.carousel:hover .carousel-nav,
.carousel:focus-within .carousel-nav { opacity: 1; }
.carousel-nav:hover { background: rgba(6, 32, 19, .74); transform: translateY(-50%) scale(1.06); }
.carousel-nav:active { transform: translateY(-50%) scale(.96); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }

/* touch devices: always show arrows */
@media (hover: none) {
  .carousel-nav { opacity: 1; }
}

/* dots */
.carousel-dots {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  z-index: 3;
}
.carousel-dot {
  width: 8px; height: 8px; padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .48);
  cursor: pointer;
  transition: width .26s cubic-bezier(.4, .01, .2, 1), background .2s;
}
.carousel-dot:hover { background: rgba(255, 255, 255, .74); }
.carousel-dot.active { width: 25px; background: var(--gold); }

/* slide counter (top-right) */
.carousel-count {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  font-size: 11.4px; font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(6, 32, 19, .5);
  backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 5px 11px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* progress bar along the bottom edge */
.carousel-progress {
  position: absolute;
  left: 0; bottom: 0; height: 3px;
  width: 0;
  background: var(--gold);
  z-index: 4;
  opacity: .9;
}
.carousel-progress.run {
  animation: cprog var(--cprog-ms, 5200ms) linear forwards;
}
@keyframes cprog { from { width: 0; } to { width: 100%; } }

/* paused state marker */
.carousel.paused .carousel-progress { animation-play-state: paused; }

/* fallback if aspect-ratio unsupported */
@supports not (aspect-ratio: 16 / 10) {
  .carousel { height: 0; padding-bottom: 62.5%; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .carousel { border-radius: var(--r-lg); }
  .carousel-cap { padding: 38px 16px 16px; }
  .carousel-cap h3 { font-size: 14.6px; }
  .carousel-cap p { font-size: 11.8px; }
  .carousel-nav { width: 34px; height: 34px; }
  .carousel-nav svg { width: 16px; height: 16px; }
  .carousel-prev { left: 9px; }
  .carousel-next { right: 9px; }
  .carousel-count { top: 10px; right: 10px; font-size: 10.6px; padding: 4px 9px; }
  .carousel-dots { bottom: 13px; }
}

/* Honour reduced-motion: no auto-advance animation, no slide transition */
@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none; }
  .carousel-progress { display: none; }
}
