/* ============================================================================
   508 Ministry Compass & Dove Social - Coded Music Video Sequence Player
   Self-hosted Cormorant + Figtree fonts only. Zero external CDN dependencies.
   Zero horizontal overflow on 390px mobile and 1440px desktop.
   ============================================================================ */

.cmv-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0B152B;
  border: 1px solid rgba(212, 175, 55, 0.34);
  box-shadow: 0 14px 36px rgba(11, 21, 43, 0.16);
  margin: 2px 0 0;
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

.cmv-wrap *, .cmv-wrap *::before, .cmv-wrap *::after {
  box-sizing: border-box;
}

/* 16:9 Cinematic Sequence Stage */
.cmv-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #1E3668 0%, #0A1328 72%);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cmv-stage.is-video-stage {
  cursor: default;
  background: #070E1E;
}

.cmv-stage video.cmv-video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #070E1E;
}

.cmv-scenes {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.cmv-scene {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  opacity: 0;
  transition: opacity 1.35s cubic-bezier(0.35, 0, 0.25, 1);
  will-change: opacity, transform;
  pointer-events: none;
}

.cmv-scene.is-active {
  opacity: 1;
  z-index: 2;
}

.cmv-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  display: block;
  filter: saturate(1.06) contrast(1.03);
}

/* Smooth Ken Burns Motion Variants */
.cmv-wrap.is-playing .cmv-scene.is-active.kb-0 img { animation: cmvKbZoomIn 18s ease-in-out infinite alternate; }
.cmv-wrap.is-playing .cmv-scene.is-active.kb-1 img { animation: cmvKbPanRight 18s ease-in-out infinite alternate; }
.cmv-wrap.is-playing .cmv-scene.is-active.kb-2 img { animation: cmvKbZoomOut 18s ease-in-out infinite alternate; }
.cmv-wrap.is-playing .cmv-scene.is-active.kb-3 img { animation: cmvKbPanLeft 18s ease-in-out infinite alternate; }

/* Gentle idle breathing when paused so cards still feel alive */
.cmv-wrap:not(.is-playing) .cmv-scene.is-active img {
  animation: cmvKbIdle 24s ease-in-out infinite alternate;
}

@keyframes cmvKbZoomIn {
  0% { transform: scale(1.0) translate3d(0, 0, 0); }
  100% { transform: scale(1.11) translate3d(-1.5%, -1.2%, 0); }
}
@keyframes cmvKbPanRight {
  0% { transform: scale(1.08) translate3d(-2.4%, 0.6%, 0); }
  100% { transform: scale(1.08) translate3d(2.4%, -0.8%, 0); }
}
@keyframes cmvKbZoomOut {
  0% { transform: scale(1.12) translate3d(1.2%, -1%, 0); }
  100% { transform: scale(1.01) translate3d(-1%, 0.8%, 0); }
}
@keyframes cmvKbPanLeft {
  0% { transform: scale(1.07) translate3d(2.2%, -0.5%, 0); }
  100% { transform: scale(1.07) translate3d(-2.2%, 0.9%, 0); }
}
@keyframes cmvKbIdle {
  0% { transform: scale(1.01) translate3d(0, 0, 0); }
  100% { transform: scale(1.055) translate3d(-0.8%, -0.5%, 0); }
}

/* Atmospheric Lighting Vignette + Floating Golden Motes */
.cmv-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 15, 34, 0.56) 0%, rgba(8, 15, 34, 0.08) 32%, rgba(8, 15, 34, 0.14) 55%, rgba(8, 15, 34, 0.84) 100%),
    radial-gradient(circle at 75% 18%, rgba(246, 206, 108, 0.18), transparent 46%);
}

.cmv-motes {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.48;
  transition: opacity 0.45s ease;
}

.cmv-wrap.is-playing .cmv-motes {
  opacity: 0.92;
}

.cmv-mote {
  position: absolute;
  bottom: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 241, 194, 0.95) 0%, rgba(236, 185, 76, 0.55) 55%, rgba(236, 185, 76, 0) 100%);
  animation: cmvMoteFloat var(--dur, 9s) linear infinite;
  animation-delay: var(--del, 0s);
  left: var(--x, 50%);
  width: var(--sz, 6px);
  height: var(--sz, 6px);
  box-shadow: 0 0 10px rgba(246, 206, 108, 0.7);
}

@keyframes cmvMoteFloat {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  18% { opacity: 0.95; }
  82% { opacity: 0.7; }
  100% { transform: translate3d(var(--drift, 18px), -340px, 0) scale(1.15); opacity: 0; }
}

/* Top Stage HUD */
.cmv-hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.cmv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  max-width: 72%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmv-badge.is-shining {
  background: linear-gradient(135deg, rgba(238, 192, 85, 0.95), rgba(212, 154, 42, 0.95));
  color: #141B2D;
  border: 1px solid rgba(255, 245, 210, 0.72);
}

.cmv-badge.is-public-domain {
  background: rgba(16, 40, 82, 0.84);
  color: #F4F9FF;
  border: 1px solid rgba(140, 200, 255, 0.48);
}

.cmv-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.cmv-wrap.is-playing .cmv-badge-dot {
  animation: cmvPulseDot 1.3s ease-in-out infinite;
}

@keyframes cmvPulseDot {
  0%, 100% { transform: scale(0.85); opacity: 0.65; }
  50% { transform: scale(1.25); opacity: 1; }
}

.cmv-scene-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(10, 18, 38, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.cmv-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.cmv-dot.is-active {
  width: 20px;
  background: #F2C96B;
}

/* Center Play Hero Button */
.cmv-center-play {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid rgba(255, 245, 214, 0.88);
  background: linear-gradient(145deg, #F5D076 0%, #D49A2A 100%);
  color: #101A33;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(242, 201, 107, 0.24), 0 14px 32px rgba(0, 0, 0, 0.48);
  transition: transform 0.22s ease, opacity 0.28s ease, box-shadow 0.22s ease;
}

.cmv-center-play:hover {
  transform: translate(-50%, -50%) scale(1.07);
  box-shadow: 0 0 0 14px rgba(242, 201, 107, 0.32), 0 16px 36px rgba(0, 0, 0, 0.56);
}

.cmv-center-play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  margin-left: 3px;
}

.cmv-wrap.is-playing .cmv-center-play {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.86);
}

/* Synchronized Lyric / Theme Story Lower-Third Overlay */
.cmv-lyric-box {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 6;
  padding: 11px 16px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(11, 20, 42, 0.72) 0%, rgba(8, 15, 34, 0.86) 100%);
  border: 1px solid rgba(242, 201, 107, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.cmv-lyric-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.cmv-lyric-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F4D27B;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmv-lyric-line {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.18;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.cmv-lyric-line.is-swapping {
  opacity: 0;
  transform: translateY(5px);
}

.cmv-lyric-sub {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.32;
  color: #D7E8FF;
  opacity: 0.94;
}

/* Live Animated Equalizer Strip */
.cmv-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.cmv-eq span {
  width: 3px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(180deg, #FFE49B 0%, #58B4FF 100%);
  transition: height 0.2s ease;
}

.cmv-wrap.is-playing .cmv-eq span {
  animation: cmvEqBounce var(--eq-dur, 0.72s) ease-in-out infinite alternate;
  animation-delay: var(--eq-del, 0s);
}

@keyframes cmvEqBounce {
  0% { height: 5px; opacity: 0.55; }
  100% { height: var(--eq-max, 24px); opacity: 1; }
}

/* Tactile Playback Control Bar */
.cmv-controls {
  background: linear-gradient(180deg, #101E3D 0%, #0B152B 100%);
  padding: 12px 14px 13px;
  border-top: 1px solid rgba(242, 201, 107, 0.22);
  color: #F4F8FF;
}

.cmv-ctrl-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmv-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #F5D076 0%, #D49A2A 100%);
  color: #101A33;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(212, 154, 42, 0.34);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.cmv-play-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.cmv-play-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cmv-skip-btn,
.cmv-icon-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #EAF3FF;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.cmv-skip-btn:hover,
.cmv-icon-btn:hover {
  background: rgba(242, 201, 107, 0.2);
  border-color: rgba(242, 201, 107, 0.55);
  color: #FFF4D4;
}

.cmv-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.cmv-track-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.cmv-track-title {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.12;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmv-track-artist {
  font-size: 12px;
  font-weight: 600;
  color: #B9D4F5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cmv-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cmv-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  outline: none;
  cursor: pointer;
}

.cmv-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #F5D076;
  border: 2px solid #FFFFFF;
}

.cmv-vol-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #F5D076;
  border: 2px solid #FFFFFF;
}

/* Progress Seek Bar Row */
.cmv-seek-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.cmv-time {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #D7E8FF;
  min-width: 38px;
}

.cmv-time-dur {
  text-align: right;
  color: #9CBBE4;
}

.cmv-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #F2C96B var(--cmv-pct, 0%), rgba(255, 255, 255, 0.22) var(--cmv-pct, 0%));
  outline: none;
  cursor: pointer;
}

.cmv-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #E5B243;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cmv-seek::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #E5B243;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Prominent "Want to do this to your videos?" Studio Funnel CTA Bar */
.cmv-studio-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: linear-gradient(135deg, #EEF7FF 0%, #FFF9EA 100%);
  border-top: 1px solid #D9E6F6;
  color: #102447;
}

.cmv-studio-cta-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.cmv-studio-cta-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: #0E2A5C;
  line-height: 1.25;
}

.cmv-studio-cta-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.38;
  color: #365078;
}

.cmv-studio-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1B4E9B 0%, #10326D 100%);
  color: #FFFFFF !important;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(242, 201, 107, 0.65);
  box-shadow: 0 6px 16px rgba(16, 50, 109, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.cmv-studio-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(16, 50, 109, 0.3);
  background: linear-gradient(135deg, #215BB2 0%, #143D84 100%);
}

/* Fullscreen support */
.cmv-wrap:fullscreen {
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #070E1E;
}

.cmv-wrap:fullscreen .cmv-stage {
  flex: 1 1 auto;
  aspect-ratio: auto;
  min-height: 0;
}

.cmv-wrap:fullscreen .cmv-lyric-line {
  font-size: 36px;
}

/* Responsive Mobile Tuning (<= 600px, verified at 390px) */
@media (max-width: 600px) {
  .cmv-stage {
    aspect-ratio: 16 / 10;
    min-height: 215px;
  }

  .cmv-hud-top {
    top: 9px;
    left: 9px;
    right: 9px;
  }

  .cmv-badge {
    font-size: 8.8px;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    max-width: 76%;
  }

  .cmv-scene-dots {
    gap: 4px;
    padding: 4px 7px;
  }

  .cmv-dot {
    width: 6px;
    height: 6px;
  }

  .cmv-dot.is-active {
    width: 13px;
  }

  .cmv-center-play {
    width: 56px;
    height: 56px;
    top: 40%;
  }

  .cmv-center-play svg {
    width: 24px;
    height: 24px;
  }

  .cmv-lyric-box {
    left: 9px;
    right: 9px;
    bottom: 9px;
    padding: 9px 11px;
    gap: 8px;
  }

  .cmv-lyric-line {
    font-size: 17.5px;
    line-height: 1.2;
  }

  .cmv-lyric-sub {
    font-size: 11px;
  }

  .cmv-eq {
    height: 22px;
    gap: 2px;
  }

  .cmv-controls {
    padding: 10px 11px 11px;
  }

  .cmv-ctrl-top {
    flex-wrap: wrap;
    gap: 7px;
  }

  .cmv-track-meta {
    order: -1;
    flex: 1 0 100%;
    margin-bottom: 3px;
  }

  .cmv-play-btn {
    width: 40px;
    height: 40px;
  }

  .cmv-skip-btn {
    padding: 0 9px;
    font-size: 11px;
    height: 32px;
  }

  .cmv-vol-wrap {
    margin-left: auto;
  }

  .cmv-vol-slider {
    display: none;
  }

  .cmv-track-title {
    font-size: 17px;
  }

  .cmv-studio-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 11px 12px;
  }

  .cmv-studio-cta-btn {
    width: 100%;
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cmv-scene img,
  .cmv-mote,
  .cmv-eq span,
  .cmv-badge-dot {
    animation: none !important;
  }
}
