/* Basic responsive wrapper and play button */
.cvp-player-wrap {
  max-width: 100%;
  margin: 18px 0;
}

/* Aspect container for iframe/video */
.cvp-player-wrap .cvp-player,
.cvp-iframe-wrap,
.cvp-video-poster-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

/* poster image */
.cvp-video-poster img {
  position: absolute;
  top:0; left:0; width:100%; height:100%; object-fit:cover;
  display:block;
}

/* poster button stretches */
.cvp-video-poster {
  position: absolute;
  top:0; left:0; width:100%; height:100%;
  padding:0; margin:0; border:0; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}

/* play icon — simple triangle */
.cvp-play-triangle {
  width:84px; height:56px;
  background: rgba(0,0,0,0.5);
  clip-path: polygon(30% 20%, 30% 80%, 80% 50%);
  border-radius:8px;
  pointer-events:none;
}

/* small spinner to show progress while iframe/assets load */
.cvp-spinner {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.9);
  position: absolute;
  left: calc(50% + 40px);
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

/* spinner animation */
@keyframes cvp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.cvp-spinner { animation: cvp-spin 1s linear infinite; }

/* iframe/video fills */
.cvp-iframe-wrap iframe,
.cvp-player-wrap video {
  position:absolute;
  top:0; left:0; width:100%; height:100%;
  border:0;
}

/* Plyr overrides (small) */
.plyr__controls { border-radius: 0 0 8px 8px; }

/* small screens */
@media (max-width:480px) {
  .cvp-play-triangle { width:60px; height:40px; }
  .cvp-spinner { left: calc(50% + 30px); width: 22px; height: 22px; border-width: 2px; }
}

/* Debug panel for CVP (visible when ?cvp_debug=1 or data-cvp-debug="1") */
.cvp-debug {
  font-family: Menlo, Monaco, "Courier New", monospace;
  font-size: 12px;
  background: #f7f7f9;
  color: #222;
  border: 1px solid #e1e4e8;
  padding: 8px;
  margin-top: 10px;
  border-radius: 6px;
  max-height: 220px;
  overflow: auto;
}
.cvp-debug-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12px;
  color: #111;
}
.cvp-debug-line { margin: 2px 0; white-space: pre-wrap; }
.cvp-debug-info { color: #0b63b6; }
.cvp-debug-warn { color: #b36b00; }
.cvp-debug-error { color: #c92a2a; }

/* CVP player — ensure 16:9 aspect and display */
.cvp-iframe-wrap {
  position: relative !important;
  padding-bottom: 56.25% !important; /* 16:9 */
  height: 0 !important;
  overflow: hidden !important;
  display: block !important;
}
.cvp-iframe-wrap iframe {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  visibility: visible !important;
  opacity: 1 !important;
}
.cvp-player-wrap,
.cvp-player {
  position: relative !important;
  min-height: 0 !important;
}

/* Ensure CVP wrapper cannot collapse (more specific selector so it wins) */
body .cvp-player-wrap.cvp-player-wrap,
body .cvp-player-wrap .cvp-iframe-wrap {
  display: block !important;
  position: relative !important;
  padding-bottom: 56.25% !important; /* 16:9 */
  height: 0 !important;
  overflow: hidden !important;
  min-height: 0 !important;
}
body .cvp-player-wrap .cvp-iframe-wrap iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Minimal permanent fix: keep wrapper 16:9 and iframe filling it */
body .cvp-player-wrap .cvp-iframe-wrap {
  display: block !important;
  width: 100% !important;
  position: relative !important;
  padding-bottom: 56.25% !important;
  height: 0 !important;
  overflow: hidden !important;
}
body .cvp-iframe-wrap iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* CVP: prevent wrapper collapse and ensure iframe fills it */
body .cvp-player-wrap,
body .cvp-player-wrap .cvp-iframe-wrap {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;        /* fixes flex-child collapse */
  position: relative !important;
  padding-bottom: 56.25% !important; /* 16:9 */
  height: 0 !important;
  overflow: hidden !important;
}
body .cvp-player-wrap .cvp-iframe-wrap iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}