/* ==========================================================================
   ASK Digital Agency - "Our Work" Vertical Video Showcase Section
   Design: Editorial Agency Dark, 9:16 Vertical Reels, Neon-Lime Accents
   ========================================================================== */

/* 1. Main Section Container */
.our-work-section {
  position: relative;
  background-color: #000000;
  padding: 90px 0 100px 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 100%;
}

.our-work-ambient-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse at center, rgba(152, 226, 9, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

.our-work-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* 2. Header Section */
.our-work-header {
  margin-bottom: 48px;
  text-align: center;
}

.our-work-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  border: 1.5px solid #98E209;
  color: #ffffff;
  padding: 7px 28px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(152, 226, 9, 0.12);
  margin-bottom: 18px;
}

.our-work-heading {
  font-family: var(--themeht-typography-secondary-font-family, "DM Sans", "Inter", sans-serif);
  color: #ffffff;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.055em;
  margin: 0 0 14px 0;
}

.our-work-subheading {
  color: #9ea3ae;
  font-size: 16px;
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto;
  font-weight: 400;
}

/* 3. Carousel Wrapper */
.our-work-carousel-wrapper {
  position: relative;
  width: 100%;
  padding: 0 60px;
  box-sizing: border-box;
}

.our-work-swiper {
  width: 100%;
  overflow: hidden;
  padding: 24px 0 32px 0;
  cursor: grab;
}

.our-work-swiper:active {
  cursor: grabbing;
}

/* 4. Slides and Cards */
.our-work-slide {
  height: auto;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.our-work-card {
  width: 100%;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0d0e12;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.85);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease,
              box-shadow 0.35s ease,
              opacity 0.4s ease;
  will-change: transform, border-color, box-shadow;
  box-sizing: border-box;
}

/* Desktop: side slides slightly reduced; active/center slide emphasized */
@media (min-width: 992px) {
  .our-work-swiper .swiper-slide:not(.swiper-slide-active):not(.swiper-slide-fully-visible) .our-work-card {
    opacity: 0.72;
    transform: scale(0.96);
  }

  .our-work-swiper .swiper-slide-active .our-work-card,
  .our-work-card:hover {
    opacity: 1;
    transform: scale(1.03);
    border-color: rgba(152, 226, 9, 0.65);
    box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(152, 226, 9, 0.15);
  }
}

/* 5. 9:16 Video Frame */
.our-work-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #08080a;
  overflow: hidden;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 9 / 16) {
  .our-work-video-frame {
    height: 0;
    padding-top: 177.78%;
  }
}

/* Video & Poster media elements */
.our-work-poster,
.our-work-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.our-work-poster {
  z-index: 2;
  transition: opacity 0.5s ease;
  background-color: #0c0d10;
}

.our-work-video {
  z-index: 3;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: transparent;
  border: 0;
  /* Taps/swipes pass through to the slider; audio toggle sits above */
  pointer-events: none;
}

/* Never show native controls or play overlays (incl. iOS start button) */
.our-work-video::-webkit-media-controls,
.our-work-video::-webkit-media-controls-panel,
.our-work-video::-webkit-media-controls-overlay-play-button,
.our-work-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
}

.our-work-video.is-playing {
  opacity: 1;
}

.our-work-card.is-video-active .our-work-poster {
  opacity: 0;
  pointer-events: none;
}

/* Dark Placeholder (when no poster image exists) */
.our-work-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, #15181e 0%, #090a0d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* An honest, compact fallback for a failed source. It remains hidden while
   the active uploaded video loads and never changes the card dimensions. */
.our-work-video-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 8, 10, 0.86);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.our-work-video-error.is-visible {
  display: flex;
}

/* 7. Audio / Mute Control Button Overlay */
.our-work-audio-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  outline: none;
}

.our-work-audio-toggle:hover {
  background: rgba(152, 226, 9, 0.2);
  border-color: #98E209;
  color: #98E209;
  transform: scale(1.08);
}

.our-work-audio-toggle:focus-visible {
  outline: 2px solid #98E209;
  outline-offset: 2px;
}

/* Toggle audio icons */
.our-work-audio-toggle .audio-icon-unmuted {
  display: none;
}

.our-work-audio-toggle .audio-icon-muted {
  display: block;
}

.our-work-audio-toggle.is-unmuted {
  background: #98E209;
  border-color: #98E209;
  color: #000000;
}

.our-work-audio-toggle.is-unmuted .audio-icon-muted {
  display: none;
}

.our-work-audio-toggle.is-unmuted .audio-icon-unmuted {
  display: block;
}

/* 8. Bottom Information Overlay */
.our-work-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 38px 16px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0) 100%);
  z-index: 4;
  box-sizing: border-box;
  pointer-events: none;
}

.our-work-item-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px 0;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.our-work-item-desc {
  color: #b0b4be;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 9. Progress Indicator Bar (Reel indicator) */
.our-work-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 5;
  overflow: hidden;
}

.our-work-progress-bar {
  height: 100%;
  width: 100%;
  background-color: #98E209;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s linear;
  will-change: transform;
}

/* 10. Navigation Arrows */
.our-work-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #000000;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  outline: none;
}

.our-work-nav-btn:hover {
  background: #98E209;
  border-color: #98E209;
  color: #000000;
  box-shadow: 0 0 16px rgba(152, 226, 9, 0.35);
}

.our-work-nav-btn:focus-visible {
  outline: 2px solid #98E209;
  outline-offset: 2px;
}

.our-work-nav-btn.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.our-work-prev {
  left: 6px;
}

.our-work-next {
  right: 6px;
}

/* 11. Pagination Indicators */
.our-work-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.our-work-pagination .swiper-pagination-bullet {
  width: 24px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  margin: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.our-work-pagination .swiper-pagination-bullet-active {
  width: 38px;
  background: #98E209;
  box-shadow: 0 0 10px rgba(152, 226, 9, 0.5);
}

/* 12. RESPONSIVE BREAKPOINTS */

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
  .our-work-section {
    padding: 70px 0 80px 0;
  }

  .our-work-heading {
    font-size: 2.4rem;
    line-height: 1.08;
  }

  .our-work-carousel-wrapper {
    padding: 0 36px;
  }

  .our-work-nav-btn {
    width: 38px;
    height: 38px;
  }

  .our-work-prev { left: 0; }
  .our-work-next { right: 0; }
}

/* Mobile (< 768px): STRICT REQUIREMENT -> EXACTLY 2 VIDEOS AT A TIME */
@media (max-width: 767px) {
  .our-work-section {
    padding: 56px 0 64px 0;
  }

  .our-work-container {
    padding: 0 12px;
  }

  .our-work-header {
    margin-bottom: 32px;
  }

  .our-work-pill-badge {
    font-size: 11px;
    padding: 6px 22px;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
  }

  .our-work-heading {
    font-size: 2rem;
    line-height: 1.08;
    margin-bottom: 10px;
  }

  .our-work-subheading {
    font-size: 14px;
    padding: 0 8px;
  }

  /* Remove side padding on mobile for full horizontal width */
  .our-work-carousel-wrapper {
    padding: 0;
  }

  /* Hide external navigation arrows on mobile in favor of native touch swipe */
  .our-work-nav-btn {
    display: none;
  }

  .our-work-swiper {
    padding: 12px 0 20px 0;
  }

  .our-work-card {
    border-radius: 14px;
  }

  .our-work-video-frame {
    border-radius: 13px;
  }

  .our-work-audio-toggle {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
  }

  .our-work-audio-toggle svg {
    width: 14px;
    height: 14px;
  }

  .our-work-info-overlay {
    padding: 24px 10px 10px 10px;
  }

  .our-work-item-title {
    font-size: 13px;
    line-height: 1.25;
    margin-bottom: 2px;
  }

  .our-work-item-desc {
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 1;
  }

  .our-work-pagination .swiper-pagination-bullet {
    width: 18px;
    height: 3px;
  }

  .our-work-pagination .swiper-pagination-bullet-active {
    width: 28px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .our-work-card,
  .our-work-slide,
  .our-work-poster,
  .our-work-video,
  .our-work-progress-bar {
    transition: none !important;
    transform: none !important;
  }
}
