.iq_modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.85);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear .25s, opacity .25s 0s;
    z-index: 1000;
}

.iq_modal.open {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear 0s, opacity .25s 0s;
}

.iq_modal .modal-wrapper {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-width: min(92vw, 1200px);
    height: auto;
    max-height: 90vh;
    max-height: 90dvh;
    max-height: 90svh;
    background: #BFC2C4;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    padding: 0;
    align-items: center;
}

@supports (height: min(100px, 100px)) {
    .iq_modal .modal-wrapper { max-height: min(90vh, 1200px); }
    .iq_modal .modal-content img { max-height: min(90vh, 1200px); }
}

@supports (height: 1dvh) and (height: min(100px, 100px)) {
    .iq_modal .modal-wrapper { max-height: min(90dvh, 1200px); }
    .iq_modal .modal-content img { max-height: min(90dvh, 1200px); }
}

@supports (height: 1svh) and (height: min(100px, 100px)) {
    .iq_modal .modal-wrapper { max-height: min(90svh, 1200px); }
    .iq_modal .modal-content img { max-height: min(90svh, 1200px); }
}

.iq_modal .close-modal-container {
    position: static;
    width: 100%;
}

/* erhöhte Spezifität, um globale button-Regel zu überstimmen */
.iq_modal.iq_modal .close-modal-container.close-modal-container > button {
    all: unset;
    position: absolute;
    top: .5rem;
    right: 1rem;
    display: block;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    border-radius: 999px;
    z-index: 2;
}

.iq_modal.iq_modal .close-modal-container.close-modal-container > button svg {
    transform: rotate(45deg) scale(1.5);
    margin-top: .4rem;
}

.iq_modal.iq_modal .close-modal-container.close-modal-container > button svg path {
    fill: #353d42;
}

.iq_modal .modal-content {
    flex: 0 0 auto;
    align-self: center;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.iq_modal .modal-content figure,
.iq_modal .modal-content picture {
    margin: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.iq_modal .modal-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    max-height: 90svh;
    object-fit: contain;
    object-position: center center;
    border-radius: 5px;
    vertical-align: middle;
}

@media (min-width: 1024px) {
    .iq_modal.iq_modal .close-modal-container.close-modal-container > button {
        top: 1rem;
        right: 1.5rem;
    }
}

@media (max-width: 599px) {
    .iq_modal .modal-wrapper { max-width: 96vw; }
}