/* Baustein Lichtkasten. Farben ueber Variablen, damit jede Seite ihre eigenen setzt.
   Weich auf und zu ueber @starting-style und allow-discrete, bei reduzierter Bewegung ohne Animation.
   Kein backdrop-filter, kein filter und kein z-index in Animationen. */
.lk {
  --lk-grund: #0B1828;
  --lk-text: #FFF8EC;
  --lk-knopf: #FFFDF8;
  --lk-knopf-text: #112F4D;
  position: fixed; inset: 0; inline-size: 100%; block-size: 100dvh; max-inline-size: none; max-block-size: none;
  margin: 0; padding: max(12px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px));
  border: 0; background: var(--lk-grund); color: var(--lk-text);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  overscroll-behavior: contain;
}
.lk:not([open]) { display: none; }
.lk::backdrop { background: transparent; }
.lk__kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; inline-size: min(100%, 1600px); margin-inline: auto; }
.lk__titel { margin: 0; font: 500 clamp(1.25rem, 1rem + 1vw, 1.75rem) / 1.2 var(--f-anzeige, Georgia, serif); color: var(--lk-text); overflow-wrap: anywhere; }
.lk__zaehler { margin: 0; font: 600 1rem / 1 var(--f-text, system-ui); font-variant-numeric: tabular-nums; color: var(--lk-text); white-space: nowrap; }
.lk__buehne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-block-size: 0; inline-size: min(100%, 1600px); margin-inline: auto; }
.lk__foto {
  position: relative; margin: 0; justify-self: center; min-inline-size: 0;
  inline-size: min(100%, calc((100dvh - 190px) * 16 / 9)); aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: clip; background: rgb(255 255 255 / 0.06);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8); touch-action: pan-y;
}
.lk__bild, .lk__bild img { display: block; inline-size: 100%; block-size: 100%; }
.lk__bild img { object-fit: cover; }
.lk__foto .ki__marke { z-index: 1; }
.lk__text { margin: 0 auto; inline-size: min(100%, 1600px); max-inline-size: 60em; text-align: center; font: 400 1rem / 1.5 var(--f-text, system-ui); color: var(--lk-text); }
.lk__knopf {
  display: inline-grid; place-items: center; inline-size: 52px; block-size: 52px; padding: 0; border: 0; border-radius: 50%;
  background: var(--lk-knopf); color: var(--lk-knopf-text); cursor: pointer;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.2), 0 12px 24px -10px rgb(0 0 0 / 0.6);
  transition: translate 300ms cubic-bezier(0.2, 0.9, 0.25, 1), box-shadow 300ms;
}
.lk__knopf svg { inline-size: 24px; block-size: 24px; }
.lk__knopf[hidden] { display: none; }
.lk__knopf:focus-visible { outline: 3px solid #F3D9A8; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .lk__knopf:hover { translate: 0 -2px; } }
/* Am Handy: Pfeile unter dem Foto, das Foto bekommt die ganze Breite */
@media (max-width: 767.98px) {
  .lk { gap: 10px; padding-inline: 12px; }
  .lk__buehne { grid-template-columns: 1fr 1fr; grid-template-areas: "foto foto" "zurueck vor"; gap: 12px; align-content: center; }
  .lk__foto { grid-area: foto; inline-size: 100%; }
  .lk__zurueck { grid-area: zurueck; justify-self: end; }
  .lk__vor { grid-area: vor; justify-self: start; }
}

/* Weich auf und zu */
@media (prefers-reduced-motion: no-preference) {
  .lk { transition: opacity 320ms ease, display 320ms allow-discrete, overlay 320ms allow-discrete; opacity: 1; }
  .lk:not([open]) { opacity: 0; }
  .lk__foto { transition: scale 420ms cubic-bezier(0.2, 0.9, 0.25, 1); scale: 1; }
  .lk:not([open]) .lk__foto { scale: 0.96; }
  @starting-style {
    .lk[open] { opacity: 0; }
    .lk[open] .lk__foto { scale: 0.96; }
  }
  @keyframes lk-ein { from { opacity: 0.15; } to { opacity: 1; } }
  .lk__bild.ist-neu { animation: lk-ein 380ms ease both; }
}

/* Ausloeser ueber dem Foto: ganze Flaeche ist Tippziel, ein kleines Zeichen oben rechts zeigt, dass es groesser geht */
.lk-ausloeser {
  position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit;
  background: transparent; cursor: zoom-in;
}
.lk-ausloeser:focus-visible { outline: 3px solid var(--salbei-tief, #112F4D); outline-offset: -3px; box-shadow: inset 0 0 0 6px rgb(255 253 248 / 0.9); }
.lk-ausloeser__zeichen {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px;
  display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%;
  background: rgb(20 14 8 / 0.78); color: #FFF8EC; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: scale 300ms cubic-bezier(0.2, 0.9, 0.25, 1), background-color 300ms;
}
.lk-ausloeser__zeichen svg { inline-size: 22px; block-size: 22px; }
@media (hover: hover) and (pointer: fine) {
  .lk-ausloeser:hover .lk-ausloeser__zeichen { scale: 1.08; background: rgb(17 47 77 / 0.92); }
}
