/*
 * Bild-Layer der Referenz-Galerie (templates/referenzen/detail.html.twig, Logik /static/js/bild-layer.js).
 * Dunkler Hintergrund in Mine Shaft, Bild ganz und unbeschnitten, runde Knöpfe wie im Rest der Website.
 * Akzent über --color-green (asioso Grün, avinci Blau aus avinci.css).
 */
.bild-layer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}
.bild-layer[open] { display: flex; align-items: center; justify-content: center; }
.bild-layer::backdrop { background: rgb(38 38 38 / .92); }

.bild-layer__bild {
    display: block;
    max-width: min(92vw, 2000px);
    max-height: 84dvh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6);
    background: #262626;
}

.bild-layer__knopf {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / .12);
    color: #fff;
    cursor: pointer;
    transition: background-color .3s cubic-bezier(.22, 1, .36, 1);
}
.bild-layer__knopf:hover { background: var(--color-green, #93BE33); }
.bild-layer__knopf:focus-visible { outline: 2px solid var(--color-green, #93BE33); outline-offset: 3px; }
.bild-layer__knopf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bild-layer__zu { top: max(20px, env(safe-area-inset-top, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); }
.bild-layer__zurueck { left: max(20px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.bild-layer__weiter { right: max(20px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }

.bild-layer__zaehler {
    position: absolute;
    bottom: max(22px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    color: rgb(255 255 255 / .75);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}

/* Handy: Pfeile unten neben dem Zähler, damit sie das Bild nicht verdecken */
@media (max-width: 767px) {
    .bild-layer__bild { max-width: calc(100vw - 32px); max-height: 74dvh; border-radius: 12px; }
    .bild-layer__zurueck, .bild-layer__weiter { top: auto; bottom: max(12px, env(safe-area-inset-bottom, 0px)); transform: none; width: 46px; height: 46px; }
    .bild-layer__zurueck { left: max(16px, env(safe-area-inset-left, 0px)); }
    .bild-layer__weiter { right: max(16px, env(safe-area-inset-right, 0px)); }
    .bild-layer__zu { top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
}

@media (prefers-reduced-motion: no-preference) {
    .bild-layer[open] .bild-layer__bild { animation: bild-layer-auf .35s cubic-bezier(.22, 1, .36, 1); }
    .bild-layer[open]::backdrop { animation: bild-layer-blende .3s ease-out; }
}
@keyframes bild-layer-auf { from { opacity: 0; transform: scale(.96); } }
@keyframes bild-layer-blende { from { opacity: 0; } }
