.div-projects {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers the child `.project` */
  row-gap: 12rem;
  margin-top: 4.8rem;
  width: 100%;
  padding: 0 2rem;
}

.project {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4.2rem;
  opacity: 1;
  width: 100%;
  max-width: 100vw;
}

.div-project-img {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.project-img {
  width: 100%;
  max-width: 50rem;
  height: auto;
  object-fit: cover;
  display: block;
}

.div-project-desc {
  display: grid;
  row-gap: 2.2rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.project-title {
  font-size: 5rem;
  color: var(--dark-text-color);
  word-wrap: break-word;
  width: 100%;
}

.project-text {
  font-family: poppins, sans-serif;
  font-size: 1.6rem;
  color: var(--sub-text-color);
  width: 100%;
}

.project-link {
  margin-top: 1.2rem;
  display: inline-block;
}


/* ---------------- Responsive ---------------- */

@media screen and (max-width: 769px) {
  .project {
    flex-direction: column;
    gap: 2rem;
    margin: 0 auto;
    text-align: center;
  }

  .project.project-right {
    flex-direction: column-reverse;
  }

  .div-project-img,
  .div-project-desc {
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .project-title {
    font-size: 2.4rem;
    margin: 0.8rem 0;
    text-align: center;
  }

  .div-projects {
    row-gap: 4rem;
    padding: 0 1rem;
    margin: 0 auto;
    width: 100%;
  }

  .project-text {
    font-size: 1.6rem;
    padding: 0 0.5rem;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
  }

  .project-link {
    margin: 1.2rem auto 0 auto;
    display: inline-block;
  }
}

@media screen and (max-width: 480px) {
  .project-title {
    font-size: 2.4rem; /* consistent with tablet */
  }

  .project-text {
    font-size: 1.4rem;
  }

  .div-projects {
    padding: 0 0.5rem;
    row-gap: 5rem;
  }

  .page-content {
    padding: 3.2rem 0.6rem;
  }

  .project-img {
    height: auto; /* keep proportional */
  }
}

/* Gallery grid */
.div-project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.div-project-img {
  overflow: hidden;
  border-radius: 0px;
  cursor: pointer;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 70px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(0,0,0,0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 10px;
}

.caption {
  margin: 15px auto;
  text-align: center;
  color: #ddd;
  font-size: 16px;
}

/* Close */
.close {
  position: absolute;
  top: 25px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* Arrows */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 15px;
  margin-top: -30px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  user-select: none;
  transition: 0.3s;
}

.prev { left: 10px; }
.next { right: 10px; }

.prev:hover, .next:hover {
  color: #f1f1f1;
}

/* Responsive */
/* @media screen and (max-width: 600px) {
  .project-img {
    height: 180px;
  }
  .modal-content {
    max-width: 95%;
  }
} */
