/**
 * Domovita dialog primitive
 * =========================
 * Companion to assets/js/dv-dialog.js.
 *
 * The <dialog> element is the CARD, not the scrim - the browser paints the
 * scrim as ::backdrop. Overlays converted from the old hand-rolled pattern
 * therefore move their rgba() background from the wrapper onto ::backdrop, and
 * drop position/inset/flex-centering entirely: a modal dialog's UA style is
 * `position: fixed; inset: 0; margin: auto`, which already centres it on both
 * axes.
 *
 * @since 3.1.8
 */

dialog.dv-dialog {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: min(92vw, 900px);
    max-height: 90dvh;
    overflow: visible;
    color: inherit;
}

dialog.dv-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

/* Scroll lock without JS state.
   The old pattern set document.body.style.overflow by hand on open and cleared
   it on close, which left the page permanently unscrollable if anything threw
   in between. :has() is Baseline widely available. */
body:has(dialog[open]) {
    overflow: hidden;
}
