@charset "UTF-8";

/* ============================================================
   gallery.css — Kontaktbogen-Raster + PhotoSwipe-Nahansicht
   Nur auf den Galerie-Seiten (index, index_eng, index_fr).
   Setzt Tokens aus style.css und das Menü aus menu.css voraus.
   ============================================================ */

/* ---- Raster (mehrspaltig, responsiv) ------------------------------ */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 18px calc(96px + env(safe-area-inset-bottom));
}

@media (max-width: 600px) {

  .wrap {
    padding: 14px 10px calc(84px + env(safe-area-inset-bottom));
  }

}

#gallery {
  column-count: 5;
  column-gap: 14px;
}

@media (max-width: 1200px) {

  #gallery {
    column-count: 4;
  }

}

@media (max-width: 900px) {

  #gallery {
    column-count: 3;
  }

}

@media (max-width: 600px) {

  #gallery {
    column-count: 2;
    column-gap: 10px;
  }

}

.tile {
  display: block;
  break-inside: avoid;
  margin: 0 0 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease;
}

@media (max-width: 600px) {

  .tile {
    margin-bottom: 10px;
  }

}

.tile:hover {
  transform: translateY(-2px);
}

.tile:hover .frame {
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.tile:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.frame {
  display: block;
  position: relative;
  width: 100%;
  background: var(--sheet,#bbb);
  border: .5px solid var(--line);
  overflow: hidden;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity .35s ease;
}

.frame.loaded img {
  opacity: 1;
}

/* ---- PhotoSwipe-Nahansicht ---------------------------------------- */
/* Bild-Freiraum (oben Schließen, unten Titelband, seitlich Pfeile) wird
   in viewer.js per paddingFn reserviert – am Handy schmaler.            */
.pswp {
  --pswp-bg: #989188;
  --pswp-icon-color: #111;
  --pswp-icon-color-secondary: rgba(255,255,255,.5);
}

.pswp__bg {
  background: radial-gradient(circle closest-side,#A59D8F,#989188) !important;
}

.pswp__button--zoom,
.pswp__counter {
  display: none !important;
}

/* feine Glyphen (×, ‹, ›) statt der Standard-Icons – Werte aus der Lupen-Version */
.pswp__button {
  width: 54px;
  height: 64px;
  opacity: 1;
}

.pswp-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--sans);
  line-height: 1;
  color: #111;
  text-shadow: 0 1px 2px rgba(255,255,255,.55);
}

.pswp__button--close .pswp-glyph {
  font-size: 34px;
}

.pswp__button--arrow .pswp-glyph {
  font-size: 48px;
}

.pswp__button:hover .pswp-glyph {
  color: #000;
}

@media (max-width: 768px) {

  .pswp__button--arrow {
    display: none !important;
  }

}

.pswp__custom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
  transition: opacity .2s ease;
}

.capbox {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: #000;
  background: #ccc;
  border: 1px solid #000;
  padding: 8px 22px;
  max-width: 92%;
  text-align: center;
}

@media (max-width: 600px) {

  .capbox {
    font-size: 13px;
    padding: 8px 18px;
  }

}

.capbox b {
  font-weight: 600;
}

.pswp__custom-caption:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {

  .tile,
  .frame img {
    transition: none;
  }

}
