/* ========================================================
   JAIN SHLOK (NAVKAR MAHAMANTRA) - HERO SECTION
   Clean text directly over Jain.mp4 at couple name position
   with real-time word-by-word chanting synchronization
   and floating bottom skip button.
   ======================================================== */

/* Scroll Lock while Shlok is playing */
html.is-shlok-locked,
body.is-shlok-locked {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100vh !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

.im-jain-shlok-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px;
  padding-top: 120px; /* Shifted downwards by 80px (was 40px) */
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s;
  transform: translateY(6px);
}

/* Active overlay */
.im-hero-video.is-opened .im-jain-shlok-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

/* Dismissed when mantra finishes or skipped */
.im-jain-shlok-overlay.is-dismissed {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-8px) !important;
  visibility: hidden !important;
}

.im-jain-shlok-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  background: transparent;
}

/* Compact Shlok Lines Container */
.im-jain-shlok-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.im-shlok-line {
  margin: 0;
  padding: 1.5px 6px;
  font-family: 'Rozha One', 'Tiro Devanagari Sanskrit', 'Cormorant Garamond', serif;
  font-size: 15.5px;
  line-height: 1.34;
  color: #5c0b1a;
  opacity: 0.55;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.im-shlok-line.is-active {
  opacity: 1 !important;
  transform: scale(1.02);
}

.im-shlok-line.is-passed {
  opacity: 0.75;
}

/* Word-by-word real-time highlight with ultra-responsive 0.12s transition */
.im-shlok-word {
  display: inline-block;
  margin: 0 2.5px;
  opacity: 0.5;
  color: #5c0b1a;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85), 0 1px 3px rgba(255, 255, 255, 0.8);
  transition: opacity 0.12s ease-out, 
              transform 0.12s ease-out, 
              color 0.12s ease-out, 
              text-shadow 0.12s ease-out;
}

/* Active Word: Instant Radiant Gold Glow */
.im-shlok-word.is-active {
  opacity: 1 !important;
  transform: scale(1.1) translateY(-1px) !important;
  color: #3e040f !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(255, 255, 255, 1), 
               0 0 26px rgba(212, 175, 55, 1), 
               0 1px 5px rgba(255, 255, 255, 1) !important;
}

/* Passed Word */
.im-shlok-word.is-passed {
  opacity: 0.75;
  transform: scale(1);
  color: #6d1525;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(255, 255, 255, 0.8);
}

.im-shlok-line--compound {
  font-size: 14px;
}

/* ========================================================
   BOTTOM-ALIGNED SKIP BUTTON
   ======================================================== */

.im-jain-shlok-skip-btn {
  position: absolute;
  bottom: 94px; /* Shifted upwards by 60px */
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(176, 141, 87, 0.65);
  color: #5c0b1a;
  padding: 8px 20px;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 14px rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  white-space: nowrap;
}

.im-jain-shlok-skip-btn:hover {
  background: #5c0b1a;
  color: #fffdf8;
  border-color: #5c0b1a;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 11, 26, 0.35);
}

.im-jain-shlok-skip-btn svg {
  transition: transform 0.25s ease;
}

.im-jain-shlok-skip-btn:hover svg {
  transform: translateX(3px);
}

/* ========================================================
   HERO CONTENT REVEAL COORDINATION
   ======================================================== */

.im-hero-video__content {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) !important;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.im-hero-video.is-content-revealed .im-hero-video__content {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.im-hero-video .im-hero-video__scroll {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 1s ease 0.5s !important;
}

.im-hero-video.is-content-revealed .im-hero-video__scroll {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Mobile Alignment */
@media (max-width: 640px) {
  .im-jain-shlok-overlay {
    padding-top: 216px; /* Shifted downwards by 80px (was 136px) */
    padding-inline: 12px;
  }
  
  .im-jain-shlok-container {
    max-width: 320px;
  }
  
  .im-jain-shlok-lines {
    gap: 2px;
  }
  
  .im-shlok-line {
    font-size: 13px;
    padding: 1px 4px;
    line-height: 1.32;
  }
  
  .im-shlok-word {
    margin: 0 1.5px;
  }
  
  .im-shlok-line--compound {
    font-size: 12px;
  }

  .im-jain-shlok-skip-btn {
    bottom: 86px; /* Shifted upwards by 60px */
    font-size: 12px;
    padding: 6px 16px;
  }
}


/* ========================================================
   COMPACT HEIGHT VIEWPORTS (< 800px Mobile Screen Height)
   Slightly reduced font size & shifted upwards by 50px
   ======================================================== */
@media screen and (max-height: 800px) {
  .im-jain-shlok-overlay {
    padding-top: 100px !important; /* Shifted downwards by 30px (was 70px) */ /* Shifted upwards by 50px (was 120px) */
  }

  .im-shlok-line {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  .im-shlok-line--compound {
    font-size: 12.5px !important;
  }
}

@media screen and (max-width: 768px) and (max-height: 800px) {
  .im-jain-shlok-overlay {
    padding-top: 196px !important; /* Shifted downwards by 30px (was 166px) */ /* Shifted upwards by 50px (was 216px) */
  }

  .im-jain-shlok-container {
    max-width: 310px !important;
  }

  .im-jain-shlok-lines {
    gap: 1.5px !important;
  }

  .im-shlok-line {
    font-size: 11.5px !important; /* Slightly reduced font size */
    line-height: 1.28 !important;
    padding: 0.5px 3px !important;
  }

  .im-shlok-word {
    margin: 0 1px !important;
  }

  .im-shlok-line--compound {
    font-size: 10.5px !important;
  }

  .im-jain-shlok-skip-btn {
    bottom: 60px !important;
    font-size: 11.5px !important;
    padding: 5px 15px !important;
  }
}

/* For ultra-compact mobile heights (<= 680px, e.g. iPhone SE / Galaxy Fold) */
@media screen and (max-width: 768px) and (max-height: 680px) {
  .im-jain-shlok-overlay {
    padding-top: 166px !important; /* Shifted downwards by 30px (was 136px) */
  }

  .im-shlok-line {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .im-shlok-line--compound {
    font-size: 10px !important;
  }

  .im-jain-shlok-skip-btn {
    bottom: 45px !important;
  }
}
