/* Lightbox-Modul (prexma / webatlas), Version 1 – gehört zu lightbox.js.
   Sieht in jedem Projekt gleich aus; anpassen nur über diese Variablen (z. B. in :root):
   --lightbox-flaeche (Hintergrund), --lightbox-text, --lightbox-text-leise, --lightbox-knopf, --lightbox-knopf-aktiv,
   --lightbox-fokus, --lightbox-radius, --lightbox-schrift */
.lightbox {
    --_flaeche: var(--lightbox-flaeche, rgb(9 13 15 / .93));
    --_text: var(--lightbox-text, #f5f2eb);
    --_leise: var(--lightbox-text-leise, rgb(245 242 235 / .6));
    --_knopf: var(--lightbox-knopf, rgb(255 255 255 / .11));
    --_knopf-aktiv: var(--lightbox-knopf-aktiv, rgb(255 255 255 / .24));
    --_fokus: var(--lightbox-fokus, #ffb36b);
    --_radius: var(--lightbox-radius, .5rem);
    position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    display: none; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
    background: transparent; color: var(--_text); font-family: var(--lightbox-schrift, inherit);
}
.lightbox[open] { display: grid; animation: lightbox-auf .22s ease-out; }
.lightbox::backdrop { background: var(--_flaeche); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox[open]::backdrop { animation: lightbox-ein .22s ease-out; }
@keyframes lightbox-auf { from { opacity: 0; transform: scale(.985); } }
@keyframes lightbox-ein { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightbox-dreht { to { transform: rotate(1turn); } }

.lightbox-leiste { display: flex; align-items: center; gap: .5rem; padding: .75rem clamp(.75rem, 2vw, 1.25rem); }
.lightbox-info { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .875rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--_leise); }
.lightbox--pdf .lightbox-info { font-size: 1rem; letter-spacing: 0; color: var(--_text); }

.lightbox-knopf { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; flex: none; min-width: 2.75rem; height: 2.75rem; padding: 0;
    border: 0; border-radius: 999px; background: var(--_knopf); color: var(--_text); font: inherit; font-size: .9rem; line-height: 1; text-decoration: none;
    cursor: pointer; transition: background-color .15s ease; }
.lightbox-knopf:hover { background: var(--_knopf-aktiv); color: var(--_text); }
.lightbox-knopf:focus-visible { outline: 2px solid var(--_fokus); outline-offset: 2px; }
.lightbox-knopf svg { width: 1.3rem; height: 1.3rem; flex: none; }
.lightbox-knopf[hidden] { display: none; }
.lightbox-download { padding: 0 1.1rem 0 .85rem; }

.lightbox-buehne { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; padding: 0 clamp(.5rem, 6vw, 5rem); touch-action: pan-y pinch-zoom; }
.lightbox-bild { grid-area: 1 / 1; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--_radius);
    box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / .55); opacity: 0; transition: opacity .28s ease; -webkit-user-drag: none; user-select: none; }
.lightbox-bild.ist-da { opacity: 1; }
.lightbox.laedt .lightbox-buehne::after { content: ''; grid-area: 1 / 1; width: 2.25rem; height: 2.25rem; border-radius: 50%; opacity: 0;
    border: 3px solid var(--_knopf-aktiv); border-top-color: var(--_text); animation: lightbox-dreht .8s linear infinite, lightbox-ein .2s .3s forwards; }

.lightbox-pfeil { position: absolute; top: 50%; width: 3rem; height: 3rem; margin-top: -1.5rem; }
.lightbox-zurueck { left: clamp(.5rem, 1.5vw, 1.25rem); }
.lightbox-vor { right: clamp(.5rem, 1.5vw, 1.25rem); }
@media (max-width: 40em) { .lightbox-pfeil { width: 2.5rem; height: 2.5rem; min-width: 2.5rem; margin-top: -1.25rem; background: rgb(9 13 15 / .55); } }

.lightbox-text { margin: 0; padding: .8rem 1rem 1.1rem; min-height: 3.6rem; text-align: center; font-size: .95rem; line-height: 1.45; text-wrap: balance; }
.lightbox-credit { display: block; margin-top: .1rem; font-size: .78rem; letter-spacing: .03em; color: var(--_leise); }
.lightbox-credit:empty { display: none; }

.lightbox--pdf .lightbox-text { display: none; }
.lightbox--pdf .lightbox-buehne { padding: 0 clamp(.5rem, 2vw, 1.25rem) clamp(.5rem, 2vw, 1.25rem); }
.lightbox-pdf { grid-area: 1 / 1; width: min(100%, 70rem); height: 100%; border: 0; border-radius: var(--_radius); background: #fff; box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / .55); }

.lightbox-offen { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
    .lightbox[open], .lightbox[open]::backdrop { animation: none; }
    .lightbox-bild { transition: none; }
}
@media print { .lightbox { display: none !important; } }
