/* =========================================================================
   Voices Hero Audio Player
   Custom HTML5 player rendered by Voices_Hero_Audio_Widget.
   Designed to sit absolutely positioned over a hero image (bottom-left)
   when placed inside an Elementor section with `position: absolute` set
   on this widget's container.
   ========================================================================= */

.vs-hero-player {
  --vs-player-bg:     rgba(0, 0, 0, 0.55);
  --vs-player-text:   #ffffff;
  --vs-player-accent: #ffffff;

  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: min(560px, 100%);
  background: var(--vs-player-bg);
  color: var(--vs-player-text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 4px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

.vs-hero-player--placeholder {
  font-size: 0.9rem;
  opacity: 0.7;
  background: rgba(0,0,0,0.6);
  padding: 0.75rem 1rem;
}

/* ── Inline variant (light, designed for use inside a regular section) ── */
.vs-hero-player--inline {
  --vs-player-bg:     #f5f5f5;
  --vs-player-text:   #1a1a1a;
  --vs-player-accent: #992e3b;

  max-width: 100%;
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.vs-hero-player--inline .vs-hero-player__progress {
  background: rgba(0, 0, 0, 0.12);
}

.vs-hero-player--inline.vs-hero-player--placeholder {
  background: #f5f5f5;
  color: #757575;
}

/* =========================================================================
   Card variant — featured image is the hero of the tile. A semi-transparent
   player bar sits pinned to the bottom of the tile with the existing
   toggle + title + progress layout.

   Tile aspect ratio matches the side-by-side video embed (16:9 default).
   ========================================================================= */

.vs-hero-player--card {
  --vs-player-text:   #ffffff;
  --vs-player-accent: #ffffff;
  --vs-player-bar-bg: rgba(40, 40, 40, 0.75); /* semi-transparent gray */

  position: relative;
  display: flex;             /* override base */
  flex-direction: column;
  justify-content: flex-end; /* pin bar to bottom */
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;                /* override base padding */
  overflow: hidden;
  border-radius: 0;
  background-color: #1a1a1a; /* fallback if no featured image */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--vs-player-text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
}

/* Aspect ratio variants */
.vs-hero-player--card.vs-hero-player--ar-16-9 { aspect-ratio: 16 / 9; }
.vs-hero-player--card.vs-hero-player--ar-4-3  { aspect-ratio: 4 / 3; }
.vs-hero-player--card.vs-hero-player--ar-1-1  { aspect-ratio: 1 / 1; }
.vs-hero-player--card.vs-hero-player--ar-auto { aspect-ratio: auto; min-height: 280px; }

/* The bar pinned to the bottom of the tile — contains toggle + body
   horizontally (same as the inline variant's layout). */
.vs-hero-player--card .vs-hero-player__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--vs-player-bar-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--vs-player-text);
}

/* Toggle stays a circle; size adjusted for the bar context. */
.vs-hero-player--card .vs-hero-player__toggle {
  width: 56px;
  height: 56px;
  margin: 0;
}
.vs-hero-player--card .vs-hero-player__toggle svg {
  width: 22px;
  height: 22px;
}

/* Body — same stack as inline */
.vs-hero-player--card .vs-hero-player__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.vs-hero-player--card .vs-hero-player__eyebrow {
  font-size: 0.7rem;
  opacity: 0.85;
}

.vs-hero-player--card .vs-hero-player__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.vs-hero-player--card .vs-hero-player__progress {
  background: rgba(255, 255, 255, 0.3);
}

.vs-hero-player--card .vs-hero-player__time {
  opacity: 0.9;
}

/* Mobile */
@media (max-width: 640px) {
  .vs-hero-player--card .vs-hero-player__bar {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }
  .vs-hero-player--card .vs-hero-player__toggle {
    width: 48px;
    height: 48px;
  }
  .vs-hero-player--card .vs-hero-player__title {
    font-size: 0.95rem;
  }
}

/* ── Play / pause toggle ──────────────────── */
.vs-hero-player__toggle {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--vs-player-accent);
  background: transparent;
  color: var(--vs-player-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.vs-hero-player__toggle:hover {
  background: var(--vs-player-accent);
  color: var(--vs-player-bg);
}

.vs-hero-player__toggle:active {
  transform: scale(0.96);
}

.vs-hero-player__toggle svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.vs-hero-player__icon-pause { display: none; }
.vs-hero-player.is-playing .vs-hero-player__icon-play  { display: none; }
.vs-hero-player.is-playing .vs-hero-player__icon-pause { display: block; }

/* play icon needs a tiny optical nudge */
.vs-hero-player__icon-play { transform: translateX(1px); }

/* ── Body (eyebrow / title / progress / time) ─ */
.vs-hero-player__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vs-hero-player__eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  line-height: 1;
}

.vs-hero-player__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-hero-player__progress {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  cursor: pointer;
  margin-top: 0.25rem;
}

.vs-hero-player__progress:focus-visible {
  outline: 2px solid var(--vs-player-accent);
  outline-offset: 3px;
}

.vs-hero-player__progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--vs-player-accent);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.vs-hero-player__time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.vs-hero-player__sep { opacity: 0.5; }

/* ── Mobile ──────────────────────────────── */
@media (max-width: 640px) {
  .vs-hero-player {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }
  .vs-hero-player__toggle {
    width: 48px;
    height: 48px;
  }
  .vs-hero-player__title {
    font-size: 0.95rem;
  }
}
