@media (prefers-color-scheme: dark) {
  .project-card {
    background: var(--card-bg-dark);
    color: var(--text-color-dark);
  }

  .project-card h3 {
    background: transparent;
    color: black;
  }
}

@media (prefers-color-scheme: light) {
  .project-card {
    background: var(--card-bg-light);
    color: var(--text-color-light);
  }

  .project-card h3 {
    background: transparent;
    color: white;
  }
}

.projects-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 100%; /*90vw*/
  padding: 20px;
}

.card-wrapper {
  width: 1 1 300px;
  max-width: 31%;
  position: relative; /* Enables absolute positioning for child elements */
}

@media (max-width: 640px) {
  .card-wrapper {
    max-width: 100%;
  }
}

.project-card {
  background: #2b2b2b; /* card background */
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Keeps content balanced */

  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  transition: background 0.3s, color 0.3s;
  text-align: center;
  position: relative;
}

.project-card:hover {
  transform: scale(1.05);
  background: #173f96 ; /* hover color */
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  padding: 15px;
  background: transparent;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  margin: 10px 0;
}

/* Invisible link overlay that covers the whole card */
.card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.container {
  max-width: 100% !important;
}
