/* galerie.css – Slideshow für Bilder und Videos im Artikel + Vollbildansicht */

/* ── Slider ── */
.gal { position: relative; margin: 1.8em 0; }
.gal-spur {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  border-radius: 16px; outline: none;
}
.gal-spur::-webkit-scrollbar { display: none; }
.gal-spur:focus-visible { box-shadow: 0 0 0 3px rgba(74,111,152,.45); }

.gal-s, .art-text .gal-s { flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0; }
.gal-box {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 16px;
  background: #16243a; display: grid; place-items: center;
  box-shadow: 0 14px 34px -20px rgba(31,58,92,.6);
}
.gal-box img, .gal-box video { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
/* Hochformat & Co.: Bild ganz zeigen, Rand mit unscharfer Kopie füllen statt schwarzer Balken */
.gal-box::before { content: ''; position: absolute; inset: -30px; background: var(--bild, none) center / cover no-repeat;
  filter: blur(24px) saturate(1.2) brightness(.8); pointer-events: none; }
.gal-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gal-s figcaption { margin-top: 8px; font-size: .84rem; color: #5b7189; text-align: center; padding: 0 44px; min-height: 1.3em; }
.art-text .gal-s figcaption { margin-top: 8px; }

/* Video-Platzhalter (lädt YouTube/Vimeo erst nach Klick) */
.gal-play {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; color: #fff; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, #33557d 0%, #16243a 70%);
}
.gal-play-ic { width: 74px; height: 74px; border-radius: 50%; background: rgba(255,255,255,.92); position: relative; box-shadow: 0 8px 26px rgba(0,0,0,.35); transition: transform .15s; }
.gal-play-ic::after { content: ''; position: absolute; left: 30px; top: 22px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent #1f3a5c; }
.gal-play:hover .gal-play-ic { transform: scale(1.07); }
.gal-play-t { font-weight: 700; font-size: 1.02rem; }
.gal-play small { font-size: .74rem; opacity: .75; }
.gal-play small a { color: inherit; }

/* Pfeile, Punkte, Zähler (setzt galerie.js) */
.gal-pf {
  position: absolute; top: calc(50% - 22px); transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #1f3a5c; font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(20,35,60,.25); transition: opacity .2s, transform .15s; z-index: 2;
}
.gal-pf:hover { transform: translateY(-50%) scale(1.06); }
.gal-pf[disabled] { opacity: 0; pointer-events: none; }
.gal-zur { left: 10px; } .gal-vor { right: 10px; }
.gal-nr {
  position: absolute; top: 10px; right: 10px; z-index: 2; font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  color: #fff; background: rgba(15,25,40,.55); padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.gal-punkte { display: flex; justify-content: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.gal-punkte button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(31,58,92,.22); cursor: pointer; transition: width .2s, background .2s; }
.gal-punkte button.an { width: 22px; border-radius: 4px; background: #4a6f98; }
.gal-eins .gal-s figcaption { padding: 0; }

@media (hover: none) { .gal-pf { width: 36px; height: 36px; font-size: 1.25rem; } }
@media (max-width: 560px) { .gal-box { aspect-ratio: 4 / 3; } .gal-s figcaption { padding: 0 6px; } }

/* einzelne Bilder im Text sind ebenfalls anklickbar */

/* ── Vollbild ── */
.gal-lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8,14,24,.94); color: #fff; }
.gal-lb::backdrop { background: rgba(8,14,24,.94); }
.gal-lb[open] { display: grid; grid-template-rows: 1fr auto; }
.gal-lb-bild { display: grid; place-items: center; min-height: 0; padding: 56px 64px 8px; touch-action: pan-y; }
.gal-lb-bild img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.gal-lb-fuss { text-align: center; padding: 10px 16px 18px; font-size: .9rem; color: rgba(255,255,255,.85); min-height: 1.4em; }
.gal-lb-fuss span { opacity: .6; margin-left: 10px; font-size: .8rem; }
.gal-lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.gal-lb button:hover { background: rgba(255,255,255,.24); }
.gal-lb-zu { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 1.6rem; }
.gal-lb-zur, .gal-lb-vor { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.8rem; }
.gal-lb-zur { left: 10px; } .gal-lb-vor { right: 10px; }
.gal-lb-zur[hidden], .gal-lb-vor[hidden] { display: none; }
@media (max-width: 600px) { .gal-lb-bild { padding: 56px 8px 8px; } .gal-lb-zur, .gal-lb-vor { top: auto; bottom: 8px; transform: none; } }

/* Einzelbilder im Text: Hochformat nicht bildschirmhoch */
.art-text figure:not(.gal-s) img { max-height: 80vh; width: auto; max-width: 100%; margin: 0 auto; }
/* gegen die allgemeine Regel „.art-text figure img { height:auto }“ – sonst wird Hochformat abgeschnitten */
.gal .gal-box img, .art-text .gal .gal-box img, .gal .gal-box video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; box-shadow: none; margin: 0;
}

/* Bilder schützen (kein Speichern per Rechtsklick/langem Drücken, kein Markieren) */
.gal img, .art-text img, .ar-titelbild img {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
.gal .gal-box img { pointer-events: none; }   /* Klick/Wischen geht an die Galerie, nicht ans Bild */

/* Copyright-Hinweis auf den Bildern (Galerie und eigene Titelbilder) */
.gal-s:not(.gal-v) .gal-box[data-cr]::after, .ar-titelbild.cr[data-cr]::after {
  content: attr(data-cr); position: absolute; right: 10px; bottom: 8px; z-index: 2; pointer-events: none;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em; color: rgba(255,255,255,.88);
  text-shadow: 0 1px 3px rgba(0,0,0,.6); padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.18);
}
.ar-titelbild.cr { position: relative; }
.ar-copyright { margin: 18px 0 0; font-size: .76rem; line-height: 1.5; color: var(--g-muted, #5b7189); }
.ar-copyright a { color: inherit; }
