/* MODAL OVERLAY */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  background-color: rgba(0, 0, 0, 0.85);
  animation: popup-fade 0.4s ease-out;
}

/* MODAL INHALT */
.modal-content {
  background-color: #111;
  margin: 5% auto;
  padding: 0;
  border: 3px solid #d9aaff; /* flieder */
  width: 80%;
  max-width: 960px;
  animation: pixel-popup 0.5s ease-in-out;
  box-shadow: 0 0 30px #0f0;
  font-family: 'Audiowide', cursive;
}

/* HEADER CLOSE BUTTON */
.close {
  color: #fff;
  float: right;
  font-size: 24px;
  font-weight: bold;
  padding: 10px 20px;
  cursor: pointer;
}

.close:hover {
  color: #d9aaff;
}

/* MODAL BODY 2-SPALTIG */
.modal-body {
  display: flex;
  flex-direction: row;
  height: 400px;
  overflow: hidden;
}

/* LINKES BILD (FIXIERT) */
.modal-image {
  flex: 1;
  background-color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  max-width: 300px;
  border-right: 2px dashed #444;
  height: 100%; /* Damit der Container die volle Höhe hat */
  position: relative;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* Bild füllt Container, schneidet ggf. zu */
  image-rendering: pixelated;
}


/* RECHTER TEXT (SCROLLBAR) */
.modal-text {
  flex: 2;
  padding: 20px;
  overflow-y: auto;
  color: #fff;
  background-color: #111;
  font-size: 16px;
  line-height: 1.6;
}

.modal-text h2,
.modal-text .section-title {
  font-family: 'Audiowide', cursive;
  font-size: 20px;
  color: #d9aaff;
  margin-bottom: 10px;
}


.modal-text p {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: #fff;
  line-height: 1.6;
  margin-bottom: 16px;
}


/* RETRO ANIMATIONEN */
@keyframes pixel-popup {
  0% {
    transform: scale(0.1);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes popup-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* RESPONSIVE */
@media screen and (max-width: 600px) {
  .modal-content {
    flex-direction: column;
  }

  .modal-body {
    flex-direction: column;
    max-height: 80vh;
  }

  .modal-image {
    border-right: none;
    border-bottom: 2px dashed #444;
    width: 100%;
    max-height: 200px;
  }

  .modal-text {
    max-height: calc(80vh - 200px); /* Rest vom Platz */
  }
}


@media (max-width: 768px) {
  .modal-body {
    flex-direction: column;
    height: auto;
  }

  .modal-image {
    border-right: none;
    border-bottom: 2px dashed #444;
    justify-content: center;
  }

  .modal-text {
    height: 200px;
  }
}


