body:has(dialog[open]) {
    overflow: hidden;
}

dialog {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: auto;
    border: 0;
    padding: 0;
    inset: 0;
    z-index: 999999999;
    overflow: hidden;
    box-shadow: var(--theme--card--box-shadow);
    width: 800px;
    min-height: 100%;
    transition: all 0.3s ease;
}

dialog,
dialog[data-dialog-offcanvas="right"] {
    transform: translate(100%, 0);
    left: auto;
    border-radius: var(--theme--card--border-radius) 0 0 var(--theme--card--border-radius);
}

dialog[data-dialog-offcanvas="left"] {
    transform: translate(-100%, 0);
    left: 0;
    right: auto;
    border-radius: 0 var(--theme--card--border-radius) var(--theme--card--border-radius) 0;
}

dialog[open] {
    transform: translate(0,0);
}

dialog:not([open]) {
    pointer-events: none;
    opacity: 0;
}

dialog::backdrop {
    background: #212529;
    opacity: 0.5;
}

dialog header {
    background: var(--theme--color--primary);
    color: var(--theme--color--background);
    position: relative;
    padding: var(--theme--gap--normal);
    display: flex;
    gap: var(--theme--gap--normal);
    justify-content: space-between;
    align-items: center;
}

dialog header > * {
    margin: 0;
}

dialog header button {
    padding: 0 0.2em;
    background: none;
    color: #fff;
    font-size: 2rem;
}

dialog header button:hover {
    color: #000;
}

dialog header button:focus {
    outline: solid 2px var(--theme--color--secondary) !important;
}

dialog article {
    flex: 1;
    overflow: auto;
}
