/* PORTFOLIO GRID */
.portfolio {
  max-width: 1100px;
  margin: 40px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 14px;
}

/* CARD BASE */
.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* FEATURED: 2 colunas × 2 linhas */
.portfolio-item.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.portfolio-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  pointer-events: none;
}

.portfolio-item h3 {
  position: absolute;
  bottom: 12px;
  left: 14px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.portfolio-item.featured h3 {
  font-size: 1.15rem;
}

.portfolio-item h3 i {
  font-size: 1em;
  opacity: 0.85;
}

/* OVERLAY */
.portfolio-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  opacity: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  transition: opacity 0.35s ease;
}

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

.portfolio-item .overlay p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
}

.portfolio-item .overlay a {
  padding: 8px 20px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 99;
  transition: background 0.2s;
}

.portfolio-item .overlay a:hover {
  background: #e8e8e8;
}

/* RESPONSIVE */
@media (max-width: 860px) {
  .portfolio {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
  .portfolio-item .overlay p {
    display: none;
  }
  .portfolio-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
   .portfolio-item.featured {
    grid-column: span 1;
    grid-row: span 2;
    background-size: contain;
  }
}

@media (max-width: 560px) {

  .portfolio {
    grid-template-columns: auto auto;
    grid-auto-rows: 220px;
    gap: 6px;
  }

  .portfolio-item:hover {
  transform: translateY(0px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

  .portfolio-item.featured {
    grid-column: span 1;
    grid-row: span 2;
    background-size: contain;
  }
  .portfolio-item .overlay {
    display: none;
  }
}
