/* Empower Dynamic Widget block: fill the parent Group/Stack and honour wide/full alignment. */
.wp-block-empower-dynamic-widget,
[data-empower-app] {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-self: stretch;
  flex: 1 1 auto;
}

.wp-block-group > .wp-block-empower-dynamic-widget,
.wp-block-group > [data-empower-app] {
  max-width: 100%;
}

/* Constrained layouts cap children to content size unless aligned. */
.is-layout-constrained > .wp-block-empower-dynamic-widget.alignwide {
  max-width: var(--wp--style--global--wide-size, 100%);
}
.is-layout-constrained > .wp-block-empower-dynamic-widget.alignfull {
  max-width: none;
}

/* Editor placeholder spans the block. */
.wp-block-empower-dynamic-widget .components-placeholder {
  width: 100%;
}

/* Overlay stacking (FE-D054). The runtime sets data-empower-overlay-open on the
   widget only while its detail window is open and lifts the widget + ancestor
   stacking contexts inline; these :has() rules are the CSS-first layer for the
   common theme wrappers. Closed: nothing changes, so header menus stay on top. */
.wp-block-empower-dynamic-widget,
[data-empower-app] {
  --empower-overlay-z: 100000;
}
[data-empower-app][data-empower-overlay-open="true"] {
  position: relative;
  z-index: var(--empower-overlay-z, 100000) !important;
}
main:has([data-empower-app][data-empower-overlay-open="true"]),
.wp-block-group:has([data-empower-app][data-empower-overlay-open="true"]),
.entry-content:has([data-empower-app][data-empower-overlay-open="true"]),
.js-push:has([data-empower-app][data-empower-overlay-open="true"]) {
  z-index: 100000 !important;
}
