/* WorldIndex YouTube Player Size Fix v1.8.5a */

/* Constrain all known YouTube/player wrappers without breaking responsive playback. */
#yt-player,
#youtube-player,
#video-player,
#player,
.wi185-player-shell,
.video-wrap,
.video-wrapper,
.player-wrap,
.player-container,
.video-container,
.media-player,
.youtube-wrap {
  width: min(100%, 960px) !important;
  max-width: 960px !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: 540px !important;
  min-height: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: hidden !important;
  border-radius: 14px !important;
  background: #000 !important;
}

/* Ensure iframe fills the constrained 16:9 box only. */
#yt-player iframe,
#youtube-player iframe,
#video-player iframe,
#player iframe,
.wi185-player-shell iframe,
.video-wrap iframe,
.video-wrapper iframe,
.player-wrap iframe,
.player-container iframe,
.video-container iframe,
.media-player iframe,
.youtube-wrap iframe,
iframe[src*="youtube.com/embed"],
iframe[src*="youtube-nocookie.com/embed"] {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 540px !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9 !important;
  border: 0 !important;
}

/* Prevent an inherited fixed player height from stretching the containing card/page. */
.card:has(.wi185-player-shell),
.card:has(#yt-player),
.card:has(iframe[src*="youtube.com/embed"]),
.card:has(iframe[src*="youtube-nocookie.com/embed"]) {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Slightly more compact desktop view so transcript/comments remain visible below. */
@media (min-width: 1000px) {
  #yt-player,
  #youtube-player,
  #video-player,
  #player,
  .wi185-player-shell,
  .video-wrap,
  .video-wrapper,
  .player-wrap,
  .player-container,
  .video-container,
  .media-player,
  .youtube-wrap {
    width: min(100%, 860px) !important;
    max-width: 860px !important;
    max-height: 484px !important;
  }

  #yt-player iframe,
  #youtube-player iframe,
  #video-player iframe,
  #player iframe,
  .wi185-player-shell iframe,
  iframe[src*="youtube.com/embed"],
  iframe[src*="youtube-nocookie.com/embed"] {
    max-height: 484px !important;
  }
}

/* Mobile: edge-to-edge within content, still 16:9, no giant vertical block. */
@media (max-width: 700px) {
  #yt-player,
  #youtube-player,
  #video-player,
  #player,
  .wi185-player-shell,
  .video-wrap,
  .video-wrapper,
  .player-wrap,
  .player-container,
  .video-container,
  .media-player,
  .youtube-wrap {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    border-radius: 10px !important;
  }

  #yt-player iframe,
  #youtube-player iframe,
  #video-player iframe,
  #player iframe,
  .wi185-player-shell iframe,
  iframe[src*="youtube.com/embed"],
  iframe[src*="youtube-nocookie.com/embed"] {
    max-height: none !important;
  }
}

/* Optional compact status line added by v1.8.5. */
.wi185-player-status {
  max-width: 860px !important;
  margin: 6px auto 0 !important;
  text-align: left !important;
}
