.project-item {
    border: 0px solid #ddd;
    padding: 0px;
    background-color: var(--green);
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.project-item a {
    text-decoration: none;
    color: inherit;
}

.project-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-item h3 {
    font-family: var(--h1Font);
    font-size:clamp(2rem, 2.5vw, 2.5rem) !important;
    margin-top: 10px;
    text-align: center;
    color:#fff;
}

.project-title {
    color: var(--green);
    font-size: var(--h1FontSize) !important;
    font-family: var(--h1Font);
}

/*gallery.css*/
/* NUR BILD */
.gallery-card:hover .gallery-img-wrapper img {
    transform: scale(1.07);
}

.gallery-img-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.55),
        rgba(0,0,0,0) 60%
    );
}

/* Container erzeugt "Masonry"-Spalten */
.masonry {
  column-count: 2;           /* Mobil: 1 Spalte */
  column-gap: 1rem;          /* Abstand zwischen Spalten */
}
.masonry.remote-ls {
  column-count: 1;           /* Mobil: 1 Spalte */
  column-gap: 1rem;          /* Abstand zwischen Spalten */
}

/* Karten sollen nicht auseinanderbrechen */
.masonry-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 0.8rem;       /* vertikaler Abstand */
}

/* Karten/Bilder sauber skalieren */
.masonry .card {
  display: inline-block;     /* wichtig, damit Card in Spalte "fließt" */
  width: 100%;
  border: 0;
}

.masonry img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive: mehr Spalten auf größeren Screens */
@media (min-width: 576px) { .masonry { column-count: 2; } }
@media (min-width: 992px) { .masonry { column-count: 3; } }
@media (min-width: 1400px) { .masonry { column-count: 4; } }

/* Remote Live-Style Gallery Override */
@media (min-width: 276px) { .masonry.remote-ls { column-count: 2; } }
@media (min-width: 992px) { .masonry.remote-ls { column-count: 3; } }
@media (min-width: 1400px) { .masonry.remote-ls { column-count: 7; } }

/* LIGTHTBOX OVERRIDE */
/* ===== Lightbox ===== */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: grid;
  grid-template-areas:
    "prev img  next"
    "prev cap  next";
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 1rem;
  z-index: 1050;            /* über Bootstrap Modals */
  padding: 2rem 1rem;
}
.lb.hidden { display: none; }

.lb-img {
  grid-area: img;
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  border-radius: .5rem;
}

.lb-caption {
  grid-area: cap;
  color: #fff;
  font-size: .95rem;
  opacity: .9;
  max-width: 95vw;
  text-align: center;
}

.lb-btn {
  position: relative;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  user-select: none;
}

.lb-btn:hover { background: rgba(255,255,255,.18); transform: scale(1.05); }

.lb-prev { grid-area: prev; }
.lb-next { grid-area: next; }
.lb-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  font-size: 1.4rem;
}

/* Klick auf dunklen Bereich schließt (nur Optik-Hinweis, Funktion macht JS) */
#lb { cursor: zoom-out; }
.lb-img, .lb-btn, .lb-caption { cursor: default; }

@media (max-width: 576px) {
  .lb { grid-template-columns: 44px 1fr 44px; padding: 1rem .5rem; }
  .lb-img { max-height: 70vh; }
  .lb-btn {
    display: none;
  }

  .lb {
    grid-template-areas:
      "img"
      "cap";
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;

    padding: 1rem;        /* weniger Rand */
    justify-items: stretch; /* <<< WICHTIG */
  }

  .lb img {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: auto;
  }
}