/* Preserve a landscape player in articles, activity reports and school pages.
 * Lightning can set an inline pixel height after load; override that height.
 * Match YouTube embed hosts only, leaving maps and native video untouched.
 */
:is(.entry-body, .entry-content) iframe:is(
  [src^="https://www.youtube.com/embed/"],
  [src^="https://youtube.com/embed/"],
  [src^="https://www.youtube-nocookie.com/embed/"],
  [src^="https://youtube-nocookie.com/embed/"],
  [src^="//www.youtube.com/embed/"],
  [src^="//www.youtube-nocookie.com/embed/"]
) {
  display: block;
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9 !important;
  border: 0;
}

/* Gutenberg reserves space with a pseudo-element. The iframe now provides
 * that space itself, including when a saved block has a portrait ratio.
 */
:is(.entry-body, .entry-content) .wp-block-embed__wrapper:has(> iframe:is(
  [src^="https://www.youtube.com/embed/"],
  [src^="https://youtube.com/embed/"],
  [src^="https://www.youtube-nocookie.com/embed/"],
  [src^="https://youtube-nocookie.com/embed/"],
  [src^="//www.youtube.com/embed/"],
  [src^="//www.youtube-nocookie.com/embed/"]
))::before {
  display: none !important;
  padding-top: 0 !important;
}
