body.mal-open {
    overflow: hidden;
    touch-action: none;
}

.mal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mal-overlay.active {
    display: flex;
}

.mal-dialog {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
     box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.mal-caption {
    color: #fff;
    margin-top: 4px;
    text-align: center;
    font: normal 12px/17px 'Lucida Grande', Verdana, sans-serif;
}

.mal-counter {
    opacity: 0.75;
    font-size: 13px;
    margin-top: 4px;
}

.mal-nav {
    width: 100%;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mal-meta {
    text-align: center;
    flex: 1;
    padding: 0 20px;
}

.mal-counter {
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
    font: normal 11px/15px 'Lucida Grande', Verdana, sans-serif;
}

.mal-image {
    -webkit-user-drag: none;
    user-select: none;
}

.mal-button {
    background: none;
    border: none;
    color: #9a9a9a;
    cursor: pointer;
    padding: 0;
    font: normal 20px/20px Arial, Helvetica, sans-serif;
    letter-spacing: -2px;
    opacity: 0.9;
    transition: opacity 0.15s ease;
    min-width: 44px;
    min-height: 44px;
}

.mal-button:hover,
.mal-button:focus {
    opacity: 1;
    color: #ffffff;
    outline: none;
}

body.mal-open {
    overflow: hidden;
}

@media (max-width: 768px) {

    .mal-image {
        max-height: 70vh;
    }

     .mal-button {
        font-size: 20px;
        line-height: 20px;
    }
}