/* ============================================
   Galerie Kacheln im Querformat-Proportionsverhältnis
   Querformat füllt komplett, Hochformat bündig oben/unten
   ============================================ */

/* ============================================
   Grid Layout
   ============================================ */

.gallery_grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
	column-gap: 20px;  /* nur zwischen Spalten */
  row-gap: 20px;       /* Abstand zwischen Reihen */
  align-items: start;
  margin-top: 12px;
	
	/* NEU: minimaler Innenabstand */
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* ============================================
   Galerie Items (Kacheln)
   ============================================ */

.gallery_item {
  margin: 0;
  padding: 0;
  background: #fff;
  overflow: hidden;

/* Kachel im Querformat (z. B. 3:2) */
  aspect-ratio: 1.414 / 1;
  /* border: 1px solid rgba(0, 0, 0, 0.15); */
  box-sizing: border-box;
}


/* Link füllt die ganze Kachel und zentriert das Bild */
.gallery_item > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Grundstil fÃ¼rs Bild */
.gallery_item img {
  display: block;
  transition: transform 0.3s ease;
}

/* Querformatbilder: füllen die Kachel komplett */
.gallery_item.is-landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* entspricht deiner linken Skizze */
}

/* Hochformatbilder:
   Höhe = Kachelhöhe, oben/unten bündig,
   links/rechts Weissraum */
.gallery_item.is-portrait img {
  height: 100%;
  width: auto;
  object-fit: contain; /* entspricht deiner rechten Skizze */
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox_backdrop.lightbox-light {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 245, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox_backdrop.is_open {
  display: flex;
}

.lightbox_frame {
  position: relative;
  width: min(80vw, 950px);
  padding: 0 12px;
  box-sizing: border-box;
}

.lightbox_frame.landscape {
  width: min(90vw, 1400px);
}

.lightbox_media_wrap {
  position: relative;
}

.lightbox_img {
  width: 100%;
  height: auto;
  max-height: 85vh;   /* diese Zeile ist entscheidend */
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lightbox_caption {
  color: #111;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 10px;
  text-align: center;        /* Text zentrieren */
  display: flex;
  flex-direction: column;    /* Titel & Meta untereinander */
  align-items: center;       /* horizontal mittig */
  gap: 4px;                  /* kleiner Abstand zwischen Zeilen */
}

/* ============================================
   Lightbox Controls
   ============================================ */

.lightbox_controls button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #111;
   font-size: 26px;       
  font-weight: 300;      /* dünner Strich */
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  z-index: 10000;
}

.btn_prev {
  left: 60px;
}

.btn_next {
  right: 60px;
}

.btn_close {
  position: fixed;
  top: 24px;
  right: 32px;
  background: transparent;
  border: 0;
  color: #111;
  font-size: 28px;
  cursor: pointer;
  z-index: 10000;
}

/* Buttons leicht transparent + Hover-Effekt */
.lightbox_controls button,
.btn_close {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lightbox_controls button:hover,
.btn_close:hover {
  opacity: 1; 
}
