/**
 * core/embed rules, each scoped to the unit that owns it.
 *
 * This file is shared by construction: every unit that places a core/embed lands here.
 * Nothing in it may be written unscoped -- a rule with no unit hook class changes every
 * embed on the site, which is a theme decision and belongs to wp-theme-scaffold.
 */

/*
 * .wm-video-dialog: THE POSTER-TO-MODAL WRAPPER (patterns/inner-section-video-dialog.php,
 * assets/js/video-dialog-view.js). It is not a registered block -- the trigger and the
 * `<dialog>` are hand-written HTML around a plain `core/image` (the poster) and a plain
 * `core/embed`/`core/video` (the player) -- so its rules live here, against the block whose
 * presence on a page is what turns this file's stylesheet on
 * (washington_mills_block_style_map(), functions.php).
 *
 * `units/inner-section-content.yml`'s `image-video-dialog` variant is the contract this
 * reproduces; per-row citations are repeated below only where a number is not obvious from the
 * selector it sits under.
 */

/*
 * THE POSTER FRAME AND ITS TRIGGER (chrome.video-poster-frame, chrome.video-poster-link).
 *
 * NO 30px BLACK STRIP ABOVE THE POSTER. The source's `.image-wrapper` carries a `margin-top:
 * 30px` at 1124px and wider that lands inside this variant's own black `.video-img` wrapper --
 * visible in the source's screenshot as a black bar with nothing under it -- but is invisible on
 * the plain-image variant, where the same margin sits over the band's own background colour
 * instead. The operator's decision, 2026-09-26 (ai/inventory.yml
 * `selection.choices[inner-section-content].approved.plan`, quoted in full in
 * `units/inner-section-content.yml`'s `variants` key): "that'd obviously be wrong" -- a source
 * bug, not reproduced. So this wrapper is sized by its own content and carries no fixed height
 * of its own; `display: inline-block` and the black background are kept for the same reason the
 * source has them (an image that has not finished loading paints black, not the page's own
 * background, while it decodes).
 */
.wm-video-dialog__trigger {
	position: relative;
	display: block;
	background-color: #000;
	cursor: pointer;
}

.wm-video-dialog__trigger img {
	display: block;
	opacity: 1;
	transition: opacity 0.3s;
}

/*
 * THE PLAY DISC (chrome.video-play-button). An 80x80 white-at-0.8 circle, centred on the
 * poster, holding icomoon U+E905 (`$icon-play`) in this theme's `primary`. The icon font is not
 * shipped (the same decision `units/footer.yml`'s `core/social-links` node and
 * assets/css/blocks/button.css's `cta-link-chevron` rule already made for this theme's other
 * icomoon glyphs), so the glyph is the icomoon path reproduced as an inline SVG, painted through
 * a mask so `background-color` stays the token rather than a baked-in hex.
 */
.wm-video-dialog__trigger::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	width: 80px;
	height: 80px;
	margin-left: auto;
	margin-right: auto;
	transform: translateY(-50%);
	z-index: 1;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.8);
	transition: opacity 0.3s;
}

.wm-video-dialog__trigger::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	width: 28px;
	height: 28px;
	margin-left: auto;
	margin-right: auto;
	transform: translateY(-50%);
	z-index: 2;
	background-color: var(--wp--preset--color--primary);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M67.951 1024.001l-11.382-1024 910.863 502.325z'/%3E%3C/svg%3E");
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: 24px 24px;
}

/*
 * poster-hovered (units/inner-section-content.yml `states`): the disc fades to 0.7 and the
 * poster's own background dims slightly. Recorded there as NOT CAPTURED -- CODE only
 * (scss/modules/_paragraph.scss:270-277), reproduced from that citation rather than from a
 * measurement.
 */
.wm-video-dialog__trigger:hover::before {
	opacity: 0.7;
}

.wm-video-dialog__trigger:hover {
	background-color: rgba(0, 0, 0, 0.1);
}

/*
 * THE DIALOG (chrome.video-modal-dialog, video-modal-dialog-small, video-modal-backdrop). A
 * native `<dialog>` centres itself via the UA stylesheet; the source's own exact `top` offsets
 * (Foundation Reveal's `vOffset: 'auto'`, inlined per instance) are not reproduced; this is a
 * mechanism difference the operator's own instruction to use `showModal()` obliges, named here
 * rather than left silent. `max-width` and the side margins approximate the source's own
 * `medium-10` centred column at 1200px; the small-screen, full-bleed form below 640px is the
 * one geometry fact this contract measures on its own capture rather than reads off Foundation's
 * compiled CSS, so it is kept exact. `padding` IS one of the contract's own measured numbers
 * ("padding: 16px at all four viewports", `chrome.video-modal-dialog`) and this theme's scale has
 * an exact step for it -- `16` / slug `25` (theme.json `settings.spacing.spacingSizes`) -- so it
 * is written as that preset, per Standards' spacing rule
 * (`reference/sources/spacing-standard.md`), not the bare literal.
 */
.wm-video-dialog__dialog {
	max-width: 1200px;
	width: calc(100% - 240px);
	padding: var(--wp--preset--spacing--25);
	background-color: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.wm-video-dialog__dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.45);
}

@media (max-width: 639.98px) {
	.wm-video-dialog__dialog {
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		margin: 0;
		padding: var(--wp--preset--spacing--25);
	}
}

/*
 * THE PLAYER FRAME (chrome.video-modal-player). core/embed's own responsive wrapper
 * (`.wp-embed-aspect-16-9 .wp-block-embed__wrapper`) already sizes the iframe against the
 * VIDEO'S real 16:9 aspect ratio; the source's 4:3 letterboxing is Foundation's `.flex-video`
 * utility clipping a 16:9 video into a fixed 4:3 box, which is a source rendering quirk rather
 * than a deliberate design choice, and is not reproduced -- named here rather than carried
 * forward silently. `max-width` keeps the player from spanning the full dialog width, echoing
 * the source's own `medium-10` inset.
 */
.wm-video-dialog__frame {
	max-width: 83.3333%;
	margin-left: auto;
	margin-right: auto;
}

/*
 * THE CLOSE X (chrome.video-modal-close). White, 32px, top-right, icomoon U+E907
 * (`$icon-close`), the same not-shipped-font treatment as the play disc above.
 */
.wm-video-dialog__close {
	position: absolute;
	top: 8px;
	right: 16px;
	z-index: 10;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background-color: transparent;
	cursor: pointer;
}

.wm-video-dialog__close::before {
	content: "";
	display: block;
	width: 32px;
	height: 32px;
	background-color: #fff;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M993.444 137.578l-373.269 373.269 371.817 371.817c26.507 26.507 26.507 69.398 0 95.904s-69.443 26.507-95.904 0.046l-371.863-371.863-397.28 397.324c-26.598 26.598-69.715 26.552-96.313-0.046-26.642-26.598-26.642-69.761-0.046-96.313l397.28-397.28-394.601-394.647c-26.461-26.461-26.461-69.398 0.046-95.904s69.443-26.507 95.904-0.046l394.601 394.647 373.269-373.269c26.598-26.598 69.67-26.598 96.313 0.046 26.598 26.598 26.598 69.715 0.046 96.313z'/%3E%3C/svg%3E");
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: 32px 32px;
}
