/* WQS Embed Size: clamp YouTube / video embeds to 800-1080 px width band.
 *
 * For new embeds, the wqs-embed-size mu-plugin writes explicit width/height
 * attributes; this CSS is a safety floor for legacy posts whose saved
 * _oembed_* meta still reports 560x315.
 *
 * Constraints:
 *   - min-width: 800px so even 480P-or-lower videos stay readable.
 *   - max-width: 1080px so embed width never exceeds the design baseline.
 *   - aspect-ratio: 16/9 keeps height proportional when the explicit
 *     height attr is overridden by `width: 100%`.
 *   - On viewports narrower than 800px the figure overflows horizontally
 *     rather than shrinking below 800; the body / main container handles
 *     horizontal scroll. This is intentional — see project memory entry
 *     for the same rule applied to other "fixed-width" components.
 */

.wp-block-embed,
.wp-block-video {
    min-width: 800px;
    max-width: 1080px;
}

.wp-block-embed iframe,
.wp-block-video video,
.wp-block-embed .wp-block-embed__wrapper iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}

/* Inside flex/grid parents where `align-self` might shrink the figure,
 * force the embed figure to honor its min-width band. */
.wp-block-embed figure,
.wp-block-embed > * {
    max-width: 1080px;
    width: 100%;
}

/* On viewports narrower than the band, allow horizontal scrolling rather
 * than shrinking the video below the readability threshold. */
@media (max-width: 800px) {
    .wp-block-embed,
    .wp-block-video {
        /* keep min-width so the figure overflows; parent scrolls horizontally */
    }
}