/* ============================================================
   BILD-LUPE
   Lernillustrationen in Lektionen anklicken und vergrößert ansehen.
   Verhalten: /js/bild-lupe.js
============================================================ */
img.bild-lupe-ziel {
    cursor: zoom-in;
}

img.bild-lupe-ziel:focus-visible {
    outline: 3px solid var(--brand-focus);
    outline-offset: 3px;
}

/* reset.css nullt alle Margins; der Browser zentriert Dialoge aber über margin: auto. */
.bild-lupe {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1100px, calc(100vw - 32px));
    height: fit-content;
    max-width: none;
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-md);
    background: var(--brand-paper);
    color: var(--brand-ink);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.bild-lupe::backdrop {
    background: rgba(27, 42, 33, 0.62);
}

.bild-lupe-rahmen {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 34px);
    margin: 0;
}

.bild-lupe-bild {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    background: var(--white);
    cursor: zoom-out;
}

.bild-lupe-text {
    margin: 0;
    padding: var(--space-sm) 64px var(--space-sm) var(--space-md);
    border-top: 1px solid var(--brand-line);
    color: var(--brand-muted);
    font-size: var(--font-size-small);
    line-height: 1.45;
}

.bild-lupe-text:empty {
    display: none;
}

.bild-lupe-schliessen {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--brand-line);
    border-radius: 50%;
    background: var(--brand-paper);
    color: var(--brand-ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.bild-lupe-schliessen:hover {
    background: var(--white);
}
