dialog {
    display: flex;
    z-index: 999;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    min-width: 100vw;
    min-height: 100vh;
    padding: 20px;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: blur(0.375rem);
    backdrop-filter: blur(0.15rem);
    overflow-y: auto;
}
@media screen and (max-width: 450px) {
    dialog {
        padding: 10px;
    }
}


dialog>article {
    width: fit-content;
    z-index: 1000;
    max-height: fit-content;
    min-height: fit-content;
    max-height: calc(100vh - 1rem * 2);
    margin: 1rem;
    overflow: auto;
    background: white;

    max-height: 100%; /* Místo calc */
    margin: auto; /* Vycentrování */

}



@media screen and (max-width: 1170px) {
    dialog>article {
        /* width: 85vw; */
    }
}

@media screen and (max-width: 950px) {
    dialog>article {
        /* width: 90vw; */
    }
}


dialog>article>header .close,dialog>article>header :is(a,button)[rel=prev] {
    margin: 0;
    margin-left: var(--pico-spacing);
    padding: 0;
    float: right
}

dialog>article>footer {
    text-align: right
}

dialog>article>footer [role=button],dialog>article>footer button {
    margin-bottom: 0
}

dialog>article>footer [role=button]:not(:first-of-type),dialog>article>footer button:not(:first-of-type) {
    margin-left: calc(var(--pico-spacing) * .5)
}

dialog>article .close,dialog>article :is(a,button)[rel=prev] {
    display: block;
    width: 1rem;
    height: 1rem;
    margin-top: calc(var(--pico-spacing) * -1);
    margin-bottom: var(--pico-spacing);
    margin-left: auto;
    border: none;
    background-image: var(--pico-icon-close);
    background-position: center;
    background-size: auto 1rem;
    background-repeat: no-repeat;
    background-color: transparent;
    opacity: .5;
    transition: opacity var(--pico-transition)
}

dialog>article .close:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),dialog>article :is(a,button)[rel=prev]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus) {
    opacity: 1
}

dialog:not([open]),dialog[open=false] {
    display: none
}

.modal-is-open {
    padding-right: var(--pico-scrollbar-width,0);
    overflow: hidden;
    pointer-events: none;
    touch-action: none
}

.modal-is-open dialog {
    pointer-events: auto;
    touch-action: auto
}

:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article {
    animation-duration: .2s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both
}

:where(.modal-is-opening,.modal-is-closing) dialog {
    animation-duration: .8s;
    animation-name: modal-overlay
}

:where(.modal-is-opening,.modal-is-closing) dialog>article {
    animation-delay: .2s;
    animation-name: modal
}

.modal-is-closing dialog,.modal-is-closing dialog>article {
    animation-delay: 0s;
    animation-direction: reverse
}

@keyframes modal-overlay {
    from {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background-color: transparent
    }
}

@keyframes modal {
    from {
        transform: translateY(-100%);
        opacity: 0
    }
}





dialog>article {
    padding: 20px 30px;
    /* display: grid; */
    /* grid-template-columns: 1fr 3fr; */
    /* grid-template-rows: auto 1fr; */
    gap: 10px 40px;
    position: relative;

    max-height: calc(100vh - 40px); /* Omez výšku */
    overflow-y: auto; /* Umožni scrollování */
}

@media screen and (max-width: 450px) {
    dialog>article {
        padding: 20px 10px;
    }
}

dialog>article .close {
    padding: 0px;
    border: 0px;
    background: transparent;
    position: absolute;
    right: 25px;
    top: 15px;
    cursor: pointer;
    font-size: 1.4rem;
    width: fit-content;
    height: fit-content;
    
}


dialog>article h2 {
    margin-top: 10px;
    margin-bottom: 10px;
}

dialog>article p {
    margin-top: 0px;
    margin-bottom: 10px;
}

dialog>article img {
    grid-column: 1;
    grid-row: 1/3;
    object-fit: cover;
    width: 100%;
    height: 100%;
}




