/* Portfolio single-page hero carousel + lightbox.
   Replaces the old single hero image. Styled to be neutral so it sits
   inside the existing Elementor hero column. Non-active slides are hidden
   by CSS, so even with JS disabled only the first image shows. */

.th-carousel { position: relative; width: 100%; }

/* Multi-image: a fixed-aspect viewport reserves constant space so the page
   never reflows as slides of slightly different sizes swap. Slides are
   stacked and crossfade via opacity; `contain` keeps each screenshot whole
   (letterboxing rather than cropping). Tune --th-carousel-ratio per taste. */
.th-carousel__viewport {
  position: relative;
  width: 100%;
  /* Placeholder until JS sets the exact ratio of the first image (so the
     primary screenshot fills the box at its native size — no shrink —
     while the box stays fixed so the page doesn't reflow between slides). */
  aspect-ratio: var(--th-carousel-ratio, 3 / 2);
  overflow: hidden;
  border-radius: 5px;
}
/* Slides sit in a horizontal flex row; the track translates by
   -index * 100% to slide the next/prev image into view. */
.th-carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
  will-change: transform;
}
.th-carousel__viewport .th-carousel__slide { flex: 0 0 100%; width: 100%; height: 100%; margin: 0; }
/* cover (not contain): every slide fills the box edge-to-edge so all four
   corners clip to the viewport's rounded radius. The box is sized to the
   first image's ratio, so that primary image isn't cropped; others whose
   ratio differs slightly are cropped a hair rather than letterboxed (which
   would leave their corners looking square). */
.th-carousel__viewport .th-carousel__img { width: 100%; height: 100%; object-fit: cover; }

/* Single image: render at natural size — no box or animation needed. */
.th-carousel--single .th-carousel__img { width: 100%; height: auto; }

.th-carousel__img { display: block; cursor: zoom-in; }

/* Prev/next arrows — translucent frosted glass */
.th-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 50%;
  /* !important: the migrated Elementor/WooCommerce snapshot ships many
     high-specificity `button` background rules that otherwise repaint these. */
  background: rgba(255, 255, 255, 0.3) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff !important;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease;
}
.th-carousel__arrow:hover { background: rgba(255, 255, 255, 0.45) !important; }
.th-carousel__arrow--prev { left: 12px; }
.th-carousel__arrow--next { right: 12px; }

/* Dots — float over the bottom edge of the image */
.th-carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.th-carousel__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.15s ease;
}
.th-carousel__dot:hover { background: rgba(255, 255, 255, 0.6) !important; }
.th-carousel__dot.is-active { background: rgba(255, 255, 255, 0.95) !important; }

/* Lightbox overlay (markup injected by portfolio-carousel.js) */
.th-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.th-lightbox[hidden] { display: none; }
.th-lightbox__img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.th-lightbox__btn {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease;
}
.th-lightbox__btn:hover { background: rgba(255, 255, 255, 0.3) !important; }
.th-lightbox__close { top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; }
.th-lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; font-size: 34px; }
.th-lightbox__nav--prev { left: 18px; }
.th-lightbox__nav--next { right: 18px; }

@media (max-width: 600px) {
  .th-carousel__arrow { width: 36px; height: 36px; font-size: 22px; }
  .th-lightbox__nav { width: 44px; height: 44px; font-size: 28px; }
}
