/* Grossansicht für Fotos, Videos und PDF (#2976). Global, weil MudDialog ausserhalb des Komponenten-Bereichs rendert. */

/* Grossansicht (#2976): fester Rahmen in der sichtbaren Fensterhöhe. Pfeile und Leiste oben, Foto, Video oder PDF füllen den Rest.
   So springt die Pfeilleiste nicht, wenn hoch und quer aufgenommene Fotos wechseln, und ein PDF passt auch am Handy quer. */
.lightbox-dialog {
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
    display: flex;
    flex-direction: column;
}

.lightbox-dialog .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-dialog .lightbox-blaetterflaeche,
.lightbox-dialog .medien-ansicht {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lightbox-dialog .medien-ansicht > :last-child {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}

.lightbox-dialog .medien-ansicht > img.opc-image-viewer {
    width: 100%;
    max-height: 100%;
}

.lightbox-dialog .medien-ansicht video {
    max-height: 100% !important;
}

/* Wenig Höhe (Handy quer): ganzer Bildschirm, damit unter Titel und Leisten noch Platz für das Bild bleibt. */
@media (max-height: 500px) {
    .mud-dialog-container:has(.lightbox-dialog) {
        padding: 0 !important;
    }

    .lightbox-dialog {
        margin: 0 !important;
        height: 100dvh;
        max-height: 100dvh;
    }

    /* Titel und Fuss knapp, damit das Bild oder PDF den Grossteil der 360 px bekommt (Tippflächen bleiben 48 px) */
    .lightbox-dialog .mud-dialog-title {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .lightbox-dialog .mud-dialog-actions {
        padding-top: 0;
        padding-bottom: 0;
    }

    .lightbox-dialog .medien-leiste {
        margin-bottom: 0;
    }
}
