/* =========================================================
   Projekte Wrapper – Layout
   ========================================================= */
.projekte-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--block-margin) / 2); /* Abstand zwischen den Projekt-Blöcken */
}

/* Direktes Flex-Kind: der Link */
.projekte-wrapper a.projekt-link {
  display: block;  /* damit Flex funktioniert */
  width: calc(33.333% - calc(var(--block-margin)/3)); /* 3 Spalten + Abstand */
  text-decoration: none;
  color: inherit;
}

/* Projekt-Block füllt den Link komplett */
.projekt {
  position: relative;
  width: 100%;         /* füllt den Link komplett */
  aspect-ratio: 1 / 1; /* quadratisch */
  overflow: hidden;
}

/* Bild */
.projekt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

/* Overlay: Weiß → Dunkelblau */
.projekt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #181f32;
  mix-blend-mode: color;
  opacity: 1;           /* standardmäßig Overlay sichtbar */
  pointer-events: none; /* Klicks gehen ans Bild durch */
  transition: opacity 0.3s ease;
}

/* Hover: Overlay ausblenden */
.projekt:hover::after {
  opacity: 0;
}

/* Overlay-Text */
.projekt .overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  text-align: right;
  color: #fff; /* nur weiße Schrift, kein Hintergrund */
}

.projekt .overlay .title {
  margin: 0;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto; /* optional: Bindestriche bei Umbruch */
}

.projekt .overlay h3 {
  font-size: 15px;
}

.projekt .overlay h2 {
  font-weight: 300 !important;
}

/* Farbvarianten */
.projekt.weiss .overlay .title {
  color: #fff;
}

.projekt.dunkelblau .overlay .title {
  color: var(--primary-color);
}

/* Schlagschatten bei Text */
.projekt.textschatten .overlay .title {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* Sicherstellen, dass Link den ganzen Block abdeckt */
.projekt-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* =========================================================
   Responsive Anpassungen
   ========================================================= */
@media (max-width: 921px) {
  .projekte-wrapper a.projekt-link {
    width: calc(50% - calc(var(--block-margin)/4)); /* 2 Spalten + Abstand */
  }
}

@media (max-width: 600px) {
  .projekte-wrapper a.projekt-link {
    width: 100%; /* Link nimmt ganze Breite */
  }
}
