/* =========================
   GRID DE PROJETOS
   ========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 340px);
  gap: 32px;
  justify-content: center;
  align-items: start;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  box-sizing: border-box;
}


/* =========================
   CAIXA DE PROJETO
   ========================= */
.caixa {
  aspect-ratio: 3/4;
  width: 100%;
  max-width: 340px;
  min-width: 220px;
  border-radius: 24px;
  overflow: hidden;
  background: #F7F5ED;
  box-shadow: 0 16px 32px 0 rgba(215,21,54,0.10), 0 2px 8px 0 rgba(63, 63, 63, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: box-shadow 0.3s, transform 0.3s;
}

/* =========================
   IMAGEM SEM BLUR NA BASE
   ========================= */
.caixa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* =========================
   TEXTO NO TOPO E BASE, CORES E SOMBRA
   ========================= */
.caixa .overlay {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  background: none;
  pointer-events: none;
  opacity: 1;
  transition: background 0.3s;
  padding: 20px;
  box-sizing: border-box;
}

.caixa .overlay h3 {
  position: absolute;
  bottom: 0; left: 0;
  margin: 0 0 1px 6%;
  color: #F7F5ED;
  background: none;
  font-size: 1.9vw;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(56, 19, 19, 0.3);
  padding: 6px 18px 6px 8px;
  border-radius: 8px;
  z-index: 5;
  transition: transform 0.35s ease;
  width: calc(100% - 12%);
}

.caixa .overlay p {
  text-align: left;
  margin: 0 0 10px 0%;
  font-size: 1rem;
  color: #F7F5ED;
  padding-right: 12%;
  color: #F7F5ED;
  border-radius: 8px;
  text-shadow: 0 1px 4px rgba(56, 19, 19, 0.3);
  font-weight: 400;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s, transform 0.35s;
  z-index: 5;
  width: calc(100% - 12%);
  line-height: 1.4;
}

/* =========================
   HOVER FLUIDO E ORGÂNICO (SEM ZOOM)
   ========================= */
.caixa:hover {
  transform: translateY(-10px);
  box-shadow: 0 32px 48px 0 rgba(215,21,54,0.18), 0 2px 8px 0 rgba(63, 63, 63, 0.2);
}

.caixa:hover .overlay h3 {
  transform: translateY(calc(-100% - 20px));
}

.caixa:hover .overlay p {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

.caixa:hover .text-with-icon {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

.caixa:hover .arrow-icon {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.18s;
}




.video-gif{
   position:absolute; 
   top:18px; 
   right:25px; 
   z-index:10; 
   width:70px; 
   border-radius:20px;

}
/* =========================
   RESPONSIVIDADE
   ========================= */
@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(2, 340px);
  }
}
.caixa .overlay h3 {
    margin: 0 0 5px 6%;
    font-size: 1.5rem;
    max-width: 340px;
}


@media (max-width: 768px) {
  .portifolio {
  width: 100%;
  margin: 0%;
  margin-top: -150px;
}

.video-gif{
   top:18px; 
   right:15px; 
}

  .grid {
    grid-template-columns: 340px;
    gap: 24px;
    padding: 0 0px;
  }

  .caixa {
    max-width: 340px;
    min-width: 0;
  }

  .caixa .overlay {
    padding: 16px;
  }

  .caixa .overlay h3 {
    top: 0;
    bottom: auto;
    margin: 12px 0 6%;
    font-size: 1.3rem;
    transform: none;
    width: calc(100% - 12%);
  }

  .caixa .overlay p {
    opacity: 1;
    transform: translateY(0);
    margin: 0 0 16px 6%;
    font-size: 0.98rem;
    width: calc(100% - 12%);
  }

  .caixa:hover .overlay h3 {
    transform: none;
  }

  .text-with-icon {
    opacity: 1;
    transform: translateY(0);
    margin: 0 0 20px 6%;
    font-size: 0.98rem;
    width: calc(100% - 12%);
  }

  .arrow-icon {
    opacity: 1;
    transform: translateY(0);
  }
}

.align-vertical {
  display: flex;
  align-items: center; /* Alinha verticalmente */
}

/* =========================
   ÍCONE DE SETA ANIMADO
   ========================= */
.text-with-icon {
  display: flex;
  align-items:end;         /* Alinha a seta verticalmente com o texto */
  gap: 1px;                    /* Espaço entre texto e seta */
  margin: 20px 0 0 3%;
  padding-right: 3%;
  color: #F7F5ED;
  font-size: 1rem;
  text-shadow: 0 1px 4px rgba(56, 19, 19, 0.3);
  font-weight: 400;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s, transform 0.35s;
  z-index: 5;
  pointer-events: none;
  right: 0;
}

.text-with-icon p {
  margin: 0;
  line-height: 1.4;
  flex: 1;                     /* Garante que ocupe o espaço restante */
}

.arrow-icon {
  position: absolute;
  bottom: 6%;               /* distância do fundo */
  right: 9%;                /* distância da borda direita */
  font-size: 1.3rem;
  color: #F7F5ED;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
  text-shadow: 0 1px 4px rgba(56, 19, 19, 0.3);
  pointer-events: none;
  z-index: 6;
}

.text-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.35) 25%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* =========================
   MOBILE: P E SETA SEMPRE VISÍVEIS
   ========================= */
@media (max-width: 700px) {
  .caixa {
    max-width: 98vw;
    min-width: 0;
    aspect-ratio: 3/4;
  }
  .caixa .overlay {
    width: 100%;
    padding: 0;
  }
  .caixa .overlay p {
    opacity: 1;
    transform: translateY(0);
    margin: 0 0 0px 0%;
    padding: 8px 10px;
    font-size: 0.98rem;
  }

  .caixa .overlay h3 {
    margin: 12px 0 0 12px;
    font-size: 1.5rem;
    padding: 4px 10px 4px 6%;
  }
  .text-with-icon {
    opacity: 1;
    transform: translateY(0);
    margin: 0 0 16px 12px;
    padding: 8px 10px;
    font-size: 0.98rem;
  }
  
  .arrow-icon {
    margin: 0 0 10px 7%;
    opacity: 1;
    transform: translateY(0);
  }
}
  