.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  padding: 40px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  width: calc(33.333% - 30px);
  min-width: 280px;
  max-width: 400px;
  height: 250px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

.hover-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(220, 53, 69, 0.9);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
  border-radius: 12px;
}

.portfolio-item:hover .hover-box {
  opacity: 1;
}

.hover-box h5 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  z-index: 3;
}

.hover-box a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #fff;
  padding: 8px 18px;
  border-radius: 25px;
  display: inline-block;
  font-size: 0.95rem;
  transition: background 0.3s ease;
  z-index: 3;
}

.hover-box a:hover {
  background-color: #fff;
  color: #dc3545;
}

/* Responsive for tablets and mobile */

@media (max-width: 992px) {
  .portfolio-item {
    width: calc(50% - 20px);
  }
}

@media (max-width: 576px) {
  .portfolio-item {
    width: 100%;
  }
}

