/* =========================================================
   Bildfolge – saubere Basis
   ========================================================= */

/* Grid */
body.archiv .bildfolge {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;   /* KEIN Stretch */
  
  container-type: inline-size;
}

/* <p>-Wrapper neutralisieren */
body.archiv .bildfolge > p {
  margin: 0;
}

/* Link füllt Grid-Zelle */
/* Bildkachel */
body.archiv .bildfolge a.glightbox {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Hochkant bewusst ruhiger */
body.archiv .bildfolge a.glightbox.portrait {
  aspect-ratio: 3 / 2;
}

/* iPad/Tablet: Portrait stabil (kein aspect-ratio-Bug in Grid) */
@media (min-width: 600px) and (max-width: 1100px) {
  body.archiv .bildfolge a.glightbox.portrait {
    width: 60%;
    justify-self: center;

    aspect-ratio: auto;         /* wichtig: iPad/WebKit umgehen */
    height: 260px;              /* fester Kachelraum -> kein Überlappen */
    overflow: hidden;           /* nichts darf aus der Kachel herausragen */
  }

  body.archiv .bildfolge a.glightbox.portrait img {
    max-height: 100%;
    max-width: 100%;
  }
}


/* =======================================================
   Navigationsbuttons
   ======================================================= */
.navigation-bildfolge {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  padding-top: 0.8rem;
  border-top: 1px solid #ccc;
  font-size: 0.9rem;
  clear: both;
}

.navigation-bildfolge a {
  display: inline-block;
  padding: 0.3em 0.6em;
  background-color: #555;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.navigation-bildfolge a:hover {
  background-color: #072d6b;
}

.navigation-bildfolge .platzhalter {
  display: inline-block;
  min-width: 6em;
}

/* Mobile: weiße Schrift auf dunklem Overlay */
.glightbox-container .gslide-desc,
.glightbox-container .gdesc-inner {
  color: #fff;
}
/* Desktop & Tablet: schwarze Schrift auf hellem Captionbereich */
@media (min-width: 768px) {
  .glightbox-container .gslide-desc,
  .glightbox-container .gdesc-inner {
    color: #000;
  }
}

/* Bilder */
body.archiv .bildfolge img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border: none;
}
/
