/* =============================================================================
   AdStar landing — video-modal.css  (Examples preview popup, per Figma 238:1421)
   ========================================================================== */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease-out), visibility 0s linear var(--dur);
}
.video-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out);
}
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---- Dialog ------------------------------------------------------------- */
.video-modal__dialog {
  position: relative;
  width: min(1000px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border-radius: var(--radius-sm);
  background: var(--gray-900);             /* #1a1a1a */
  border: 1px solid var(--border-strong);  /* #383838 */
  box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(0.985);
  transition: transform var(--dur) var(--ease-out);
}
.video-modal.is-open .video-modal__dialog { transform: none; }

/* ---- Header (type badge + close, title + description) ------------------- */
.video-modal__head { display: flex; flex-direction: column; gap: 10px; }
.video-modal__topline { display: flex; align-items: center; justify-content: space-between; }

.video-modal__type {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding-inline: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--gray-200);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.video-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--gray-750);            /* #383838 */
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.video-modal__close:hover { background: var(--gray-700); }
.video-modal__close:active { transform: scale(0.94); }
.video-modal__close img { width: 12px; height: 12px; }

.video-modal__textline { display: flex; flex-direction: column; gap: 4px; }
.video-modal__title {
  margin: 0;
  font-size: var(--fs-display-xs);        /* 24 */
  line-height: var(--lh-display-xs);      /* 32 */
  font-weight: 600;
  color: var(--gray-25);
}
.video-modal__desc {
  margin: 0;
  font-size: var(--fs-xs);                /* 12 */
  line-height: var(--lh-xs);              /* 18 */
  color: var(--gray-200);
}

/* ---- Video player ------------------------------------------------------- */
.video-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 720;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
}
.video-modal__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;     /* letterbox vertical clips rather than crop */
  background: #000;
}

/* ---- Custom controls ---------------------------------------------------- */
.video-modal__controls {
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4) 85%);
  opacity: 1;
  transition: opacity var(--dur) var(--ease-out);
}
/* Auto-hide controls after inactivity while playing */
.video-modal__player.is-idle .video-modal__controls { opacity: 0; }

.video-modal__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.video-modal__btn:hover { background: rgba(255, 255, 255, 0.12); }
/* sizing only — do NOT set display here; the play/pause + mute toggles below
   rely on display:none/block and would be overridden by a blanket rule. */
.video-modal__btn img { width: 16px; height: 16px; }

/* Toggle which icon shows for play/pause + mute */
.video-modal__icon-play,
.video-modal__icon-muted { display: none; }
.video-modal__player.is-paused .video-modal__icon-play { display: block; }
.video-modal__player.is-paused .video-modal__icon-pause { display: none; }
.video-modal__player.is-muted .video-modal__icon-muted { display: block; }
.video-modal__player.is-muted .video-modal__icon-vol { display: none; }

.video-modal__progress {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 4px;
}
.video-modal__time {
  flex-shrink: 0;
  width: 36px;
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.video-modal__time--remaining { width: 42px; text-align: right; }

.video-modal__bar {
  position: relative;
  flex: 1 0 0;
  min-width: 0;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  touch-action: none;
}
.video-modal__bar:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 3px; }
.video-modal__buffer,
.video-modal__played {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 9999px;
  background: #fff;
}
.video-modal__buffer { opacity: 0.3; width: 0; }
.video-modal__played { width: 0; }
.video-modal__played::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.video-modal__bar:hover .video-modal__played::after,
.video-modal__bar:focus-visible .video-modal__played::after { opacity: 1; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 767px) {
  .video-modal { padding: 16px; }
  .video-modal__dialog { gap: 16px; padding: 16px; }
  .video-modal__title { font-size: var(--fs-xl); line-height: var(--lh-xl); }
  .video-modal__controls { padding: 12px; height: 52px; }
}
