
/*=============================================
=                   Pico CSS Dialog                   =
=============================================*/


dialog {
    --spacing: 1rem;
    --bs-modal-padding: 1em;
    --bs-card-cap-padding-x: 1em;
    --bs-card-cap-padding-y: 1em;
    display: flex;
    z-index: 2048;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    width: inherit;
    min-width: 100%;
    height: inherit;
    min-height: 100%;
    padding: var(--spacing);
    border: none;
    background-color: var(--modal-overlay-background-color, rgba(0, 0, 0, 0.25))
}

dialog article {
    width: 310px;
    max-height: calc(100vh - var(--spacing) * 2);
    overflow: auto;
    background-color: var(--bs-card-bg);
    border: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, transparent);
    border-radius: var(--bs-border-radius, calc(var(--spacing) * 0.5));
    box-shadow: var(--bs-card-box-shadow, 20px 30px 30px rgba(0, 0, 0, .2));
    backdrop-filter: blur(var(--spacing, 0.1rem));
}

@media (min-width:576px) {
    dialog article {
        width: 480px;
        max-width: 510px;
    }
}

@media (min-width:768px) {
    dialog article {
        max-width: 700px;
    }
}

dialog article>footer,
dialog article>header {
    padding: 0.5em 1em;
}

dialog article>header .close {
    float: right;
    position: absolute;
    top: 0;
    right: 0;
    padding: calc(var(--spacing) * 0.5);
    font-size: 1em;
    color: inherit;
    text-shadow: none;
    margin-right: calc(var(--spacing) * 0.5);
    margin-top: calc(var(--spacing) * 0.5);
}

dialog article>footer {
    text-align: right
}

dialog article>footer [role=button] {
    margin-bottom: 0
}

dialog article>footer [role=button]:not(:first-of-type) {
    margin-left: calc(var(--spacing) * .5)
}

dialog article p:last-of-type {
    margin: 0
}

dialog:not([open]),
dialog[open=false] {
    display: none
}

.modal-is-open {
    padding-right: var(--scrollbar-width, 0);
    overflow: hidden;
    pointer-events: none
}

.modal-is-open dialog {
    pointer-events: auto
}

.modal-is-closing dialog,
.modal-is-closing dialog>article,
.modal-is-opening dialog,
.modal-is-opening dialog>article {
    animation-duration: .2s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both
}

.modal-is-closing dialog,
.modal-is-opening dialog {
    animation-duration: .2s;
    animation-name: fadeIn
}

.modal-is-closing dialog>article,
.modal-is-opening dialog>article {
    animation-delay: .2s;
    animation-name: slideInDown
}

.modal-is-closing dialog,
.modal-is-closing dialog>article {
    animation-delay: 0s;
    animation-direction: reverse
}

@keyframes fadeIn {
    from {
        background-color: transparent
    }

    to {
        background-color: var(--modal-overlay-background-color, rgba(0, 0, 0, 0.25))
    }
}


@keyframes slideInDown {
    from {
        transform: translateY(30%) scale(0.9);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

/*============  End of Pico CSS Dialog  =============*/
