/* =========================================================================
   Voices Hero Video — plain full-width hero image with title + play CTA
   that opens a centered modal/lightbox containing the YouTube/Vimeo embed.
   Rendered by Voices_Hero_Video_Widget.
   ========================================================================= */

.vs-hero-video {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Size variants */
.vs-hero-video--ar-16-9 { aspect-ratio: 16 / 9; }
.vs-hero-video--ar-21-9 { aspect-ratio: 21 / 9; }
.vs-hero-video--ar-4-3  { aspect-ratio: 4 / 3; }
.vs-hero-video--ar-1-1  { aspect-ratio: 1 / 1; }

/* Fill viewport, minus the site header height (measured by JS at runtime;
   80px fallback). `svh` uses the small viewport height so the bottom of
   the hero isn't hidden behind mobile browser UI. */
.vs-hero-video--fill {
  height: calc(100svh - var(--vs-site-header-height, 80px));
  /* Older browsers without svh fall back to vh: */
  height: calc(100vh - var(--vs-site-header-height, 80px));
  height: calc(100svh - var(--vs-site-header-height, 80px));
}

/* Full 100vh — ignores the header. */
.vs-hero-video--viewport {
  height: 100vh;
  height: 100svh;
}

/* ── Hero image ───────────────────────────── */
.vs-hero-video__poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Default overlay is transparent — image stays "plain". The widget's
   color picker can dial in a tint per instance if needed. */
.vs-hero-video__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  /* Subtle bottom gradient just for caption legibility on busy images. */
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%);
}

.vs-hero-video__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  padding: clamp(1.5rem, 4vw, 3rem);
  pointer-events: none; /* allow clicks to pass through except on play button */
  z-index: 2;
}

.vs-hero-video__title {
  color: #fff;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 1.5rem;
  max-width: 900px;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
}

/* ── Play button ──────────────────────────── */
.vs-hero-video__play {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.6rem 0.9rem 1.25rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid #fff;
  color: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.vs-hero-video__play:hover {
  background: #fff;
  color: #000 !important;
  transform: translateY(-1px);
}

.vs-hero-video__play:active {
  transform: translateY(0) scale(0.98);
}

.vs-hero-video__play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.vs-hero-video__play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
}

.vs-hero-video__play-icon svg {
  width: 14px;
  height: 14px;
  transform: translateX(1px); /* optical center */
}

.vs-hero-video__play-label {
  white-space: nowrap;
}

/* No-video fallback (poster only, no play CTA) */
.vs-hero-video--no-video {
  background-size: cover;
  background-position: center center;
}

/* Editor-only helper note */
.vs-hero-video__editor-note {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff8e1;
  border-left: 3px solid #f0b429;
  color: #5a4500;
  font-size: 0.85rem;
}

/* =========================================================================
   Modal / lightbox
   Created on demand by voices-hero-video.js, attached to <body>.
   ========================================================================= */

.vs-video-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.vs-video-modal.is-open {
  opacity: 1;
}

.vs-video-modal__dialog {
  position: relative;
  width: 60vw;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.vs-video-modal.is-open .vs-video-modal__dialog {
  transform: scale(1);
}

.vs-video-modal__dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.vs-video-modal__close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.vs-video-modal__close:hover,
.vs-video-modal__close:focus-visible {
  background: #fff;
  color: #000;
  border-color: #fff;
  outline: none;
}

.vs-video-modal__close svg {
  width: 18px;
  height: 18px;
}

/* Body scroll lock when modal is open */
body.vs-video-modal-open {
  overflow: hidden;
}

/* ── Mobile ──────────────────────────────── */
@media (max-width: 1024px) {
  .vs-video-modal__dialog {
    width: 90vw;
  }
}

@media (max-width: 640px) {
  .vs-hero-video__title {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    margin-bottom: 1.25rem;
  }
  .vs-hero-video__play {
    padding: 0.75rem 1.25rem 0.75rem 0.9rem;
    font-size: 0.9rem;
  }
  .vs-hero-video__play-icon {
    width: 28px;
    height: 28px;
  }
  .vs-video-modal {
    padding: 1rem;
  }
  .vs-video-modal__dialog {
    width: 100%;
  }
  .vs-video-modal__close {
    top: -2.5rem;
    width: 36px;
    height: 36px;
  }
}
