/* Galerie-Raster, Filter und Großansicht */
.galerie-text { color: var(--text-2); max-width: 760px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.filter button { font-family: var(--head); font-size: 17px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 16px;
  background: transparent; color: var(--text); border: 1px solid var(--linie); border-radius: 2px; cursor: pointer; }
.filter button:hover { border-color: var(--akzent); }
.filter button.aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.raster { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.raster li[hidden] { display: none; }
.raster a { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-3); }
.raster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.raster a:hover img { transform: scale(1.04); }
.unterschrift { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; color: #fff; font-size: 15px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0)); opacity: 0; transition: opacity .3s; }
.unterschrift b { color: var(--akzent); font-weight: 600; margin-right: 4px; }
.raster a:hover .unterschrift, .raster a:focus-visible .unterschrift { opacity: 1; }
@media (hover: none) { .unterschrift { opacity: 1; } }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,8,9,.96); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: calc(100vh - 130px); object-fit: contain; }
.lightbox figcaption { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: center; color: #ddd; padding: 14px 10px 0; font-size: 16px; }
.lightbox figcaption b { color: #fff; }
.lb-zu { position: absolute; top: 10px; right: 14px; font-size: 40px; line-height: 1; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px 12px; }
.lb-pfeil { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 28px; cursor: pointer; }
.lb-pfeil:hover { background: rgba(255,255,255,.25); }
.lb-zurueck { left: 12px; } .lb-weiter { right: 12px; }
@media (max-width: 640px) { .lb-pfeil { display: none; } }

.materialien { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 36px; }

/* Variante "wand": Bilder behalten ihr Seitenverhältnis, Reihen schließen bündig ab */
.raster.wand { display: flex; flex-wrap: wrap; gap: 6px; }
.raster.wand::after { content: ""; flex-grow: 1000000; }
.raster.wand li { flex: calc(var(--r) * 100) 1 calc(var(--r) * 220px); }
.raster.wand a { aspect-ratio: var(--r); }
@media (max-width: 560px) { .raster.wand li { flex-basis: calc(var(--r) * 140px); } }
