/* ========================================
   MODAL GALLERY STYLES
   ======================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  /* Increased z-index */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: block;
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #fff;
  /* Set font color to white */
  background-color: transparent;
  /* Removed white background */
  animation: fadeIn 0.3s ease;
}

#modal-img {
  max-width: 90%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  margin-top: 140px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-info {
  text-align: center;
  max-width: 800px;
  margin-top: 20px;
}

#modal-title {
  position: relative;
  font-size: 1.6rem;
  font-weight: 500;
  font-family: 'Geist Pixel Square', serif;
  color: #fff;
  text-align: center;
  margin-top: -20px;
  margin-bottom: 20px;
}

.close {
  position: absolute;
  top: 100px;
  right: 40px;
  color: #fff;
  font-size: 3rem;
  font-weight: 200;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #bbb;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  font-weight: 200;
  color: white;
  padding: 20px;
  transition: background-color 0.3s ease;
  user-select: none;
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #fff;
  /* Changed from #ddd to #fff */
}

.metadata p {
  margin: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .modal-content {
    width: 90%;
    height: auto;
    top: 10%;
    transform: translateY(0);
    padding: 20px;
  }

  #modal-title {
    font-size: 1.2rem;
    margin-top: -15px;
  }

  .close {
    top: 120px;
    right: 20px;
    font-size: 24px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
  }

  .prev,
  .next {
    font-size: 2.5rem;
    padding: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  .prev {
    left: 10px;
  }

  .next {
    right: 10px;
  }

  #modal-img {
    max-height: calc(100vh - 180px);
    /* Adjusted for mobile */
  }

  .modal-description {
    line-height: 0.8;
    font-size: 14px;
  }
}