/* Galerie & Lightbox – externe CSS nur für die Altäre-Seite
   ---------------------------------------------------------
   Diese Datei styled ausschließlich die Galerie (#gallery) und die dazugehörigen
   Lightboxen (.lightbox). An anderen Seitenteilen wird nichts verändert.
*/

/* ===== Galerie-Grid ===== */
#gallery {
  scroll-margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1.25rem 0 2rem;
}

#gallery .tile {
  position: relative;
  border-radius: .6rem;
  overflow: hidden;
  background: #f2f2f2;
  border: 1px solid #eee;
}

#gallery .tile a { display: block; }

#gallery .tile img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

#gallery .tile:focus-within img,
#gallery .tile a:hover img { transform: scale(1.03); }

#gallery .tile figcaption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff;
  padding: .5rem .6rem;
  font-size: .95rem;
}

/* ===== Lightbox (CSS-only via :target) ===== */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 2rem;
  background: rgba(0,0,0,.85);
  z-index: 1000;
}
.lightbox:target { display: grid; }

.lightbox figure { margin: 0; max-width: min(100%, 1100px); }

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  width: auto;
  display: block;
  border-radius: .5rem;
}

.lightbox figcaption { color: #fff; margin-top: .5rem; text-align: center; }

.lightbox .close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
}

/* ===== Barrierefreiheit & Präferenzen ===== */
@media (prefers-reduced-motion: reduce) {
  #gallery .tile img { transition: none; }
}

@media (prefers-color-scheme: dark) {
  #gallery .tile { border-color: #333; background: #1a1a1a; }
}
