/* lightbox.css — Großansicht für Fotos (.thl-lightbox, gesteuert von lightbox.js).
   ---------------------------------------------------------------------------
   Eigenständig & themen-neutral (wie share.css): dunkler Marken-Hintergrund,
   funktioniert auf der Startseite (styles.css/community.css) wie auf den
   Artikelseiten (article.css). Nutzt nur --accent und --font-mono als Tokens,
   mit Fallbacks. Kein Eingriff in styles.css oder article.css. */

/* Auslöser: jedes angemeldete Bild */
.thl-lightbox-trigger {
  cursor: zoom-in;
}
.thl-lightbox-trigger:focus-visible {
  outline: 2px solid var(--accent, #0fa3a3);
  outline-offset: 3px;
}

/* Seite hinter dem Dialog nicht scrollen lassen */
html.thl-lightbox-open,
html.thl-lightbox-open body {
  overflow: hidden;
}

/* Der Dialog füllt den Viewport, der Hintergrund ist der ::backdrop */
.thl-lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  color: #f2fbf6;
  overflow: hidden;
}
.thl-lightbox::backdrop {
  background: rgba(7, 24, 18, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.thl-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: thl-lightbox-fade 0.18s ease;
}
@keyframes thl-lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bild + Unterschrift: zusammen nie höher als der Viewport */
.thl-lightbox__figure {
  margin: 0;
  padding: 0 72px;                 /* Platz für die Pfeile links/rechts */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: min(100vw, 1400px);
  max-height: 100vh;
  max-height: 100dvh;
}
.thl-lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  max-height: 78dvh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.7);
  display: block;
  object-fit: contain;
  cursor: default;
}
.thl-lightbox__caption {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(242, 251, 246, 0.8);
  text-align: center;
  max-width: 80ch;
  max-height: 14vh;
  max-height: 14dvh;
  overflow-y: auto;
  padding: 0 4px;
}
.thl-lightbox__caption:empty {
  display: none;
}
.thl-lightbox__caption a {
  color: inherit;
  text-decoration: underline;
}

/* Schließen-Kreuz und Pfeile */
.thl-lightbox__close,
.thl-lightbox__nav {
  position: fixed;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 31, 22, 0.7);
  color: #f2fbf6;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}
.thl-lightbox__close {
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
}
.thl-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
}
.thl-lightbox__nav--prev { left: 16px; }
.thl-lightbox__nav--next { right: 16px; }
.thl-lightbox__nav[hidden] { display: none; }
.thl-lightbox__close:hover,
.thl-lightbox__close:focus-visible,
.thl-lightbox__nav:hover,
.thl-lightbox__nav:focus-visible {
  background: var(--accent-deep, #0a7a7a);
  border-color: var(--accent, #0fa3a3);
  outline: none;
}
.thl-lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.thl-lightbox__close:hover { transform: scale(1.06); }
.thl-lightbox__close svg,
.thl-lightbox__nav svg { display: block; }

@media (max-width: 600px) {
  .thl-lightbox__figure { padding: 0 8px; gap: 10px; }
  .thl-lightbox__img { max-height: 72vh; max-height: 72dvh; border-radius: 10px; }
  .thl-lightbox__caption { font-size: 12px; max-height: 16vh; max-height: 16dvh; }
  .thl-lightbox__close { top: 12px; right: 12px; width: 42px; height: 42px; }
  .thl-lightbox__nav { width: 40px; height: 40px; top: auto; bottom: 14px; transform: none; }
  .thl-lightbox__nav--prev { left: 12px; }
  .thl-lightbox__nav--next { right: 12px; }
  .thl-lightbox__nav:hover { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .thl-lightbox[open] { animation: none; }
  .thl-lightbox__close,
  .thl-lightbox__nav { transition: none; }
  .thl-lightbox__nav:hover { transform: translateY(-50%); }
  .thl-lightbox__close:hover { transform: none; }
}
