/* Grid layout */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* Card wrapper */
.portfolio-card {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  position: relative;
  height: 200px; /* horizontal rectangle */
}

/* Inner content */
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Image fills the card */
.card-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* cover the entire card */
  display: block;
  transition: transform 0.5s ease;
}

/* Overlay description */
.card-overlay {
  position: absolute;
  bottom: -100%; /* hidden below card */
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: bottom 0.5s ease;
}

/* Overlay content */
.card-overlay h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.card-overlay p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 12px;
}

.card-overlay a.view-btn {
  background: #fff;
  color: #007bff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  width: fit-content;
}

/* Hover animation */
.portfolio-card:hover img {
  transform: scale(1.05); /* slight zoom */
}

.portfolio-card:hover .card-overlay {
  bottom: 0; /* slide overlay up */
}