/* ═══════════════════════════════════════════════════════════
   trabalhos.css — Seção 4 (Prova Social ampliada) de /criacao-de-sites.
   Componente NOVO, dedicado a essa página (não reaproveita
   partials/depoimentos.php da home). Mistura demonstração visual
   (screenshot do site) com depoimento (foto + nome + cargo).
   Carrossel "trem" (cards em fileira, não centralizado por escala
   como o componente da home): 3 cards inteiros + fatia do 4º no
   desktop, 1 card por vez no mobile. Mesma lógica de opacidade em
   transição (slide + fade) do componente de Depoimentos da home,
   adaptada pra um carrossel comum em vez de um carrossel centralizado.
═══════════════════════════════════════════════════════════ */

.trabalhos {
  padding: 104px 0;
}

.trabalhos-wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 var(--pad);
  width: 90%;
}

.trabalhos-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.trabalhos-head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 14px;
  text-wrap: balance;
}

.trabalhos-head p {
  font-size: 16px;
  line-height: 1.68;
  color: var(--text2);
}

/* ── Palco: janela visível do carrossel (overflow hidden) ── */
.trabalhos-stage {
  --trab-gap: 24px;
  --trab-card-h: 560px;

  position: relative;
  overflow: hidden;
  width: 100%;
  height: var(--trab-card-h);
}

.trabalho-card {
  /* 3 cards inteiros + 20% de um 4º sempre visíveis, em qualquer
     largura de tela (cálculo resolve pra isso, ver comentário no
     JS sobre o "step" derivado do width real renderizado). */
  width: calc((100% - 3 * var(--trab-gap)) / 3.2);
  height: var(--trab-card-h);
  position: absolute;
  top: 0;
  left: 0;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .5s ease;
  background: #cadfde66;
  border-radius: 20px;
  padding: 24px 24px 26px;
  display: flex;
  flex-direction: column;
}

.trabalho-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.trabalho-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
  flex-shrink: 0;
}

.trabalho-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 5px 14px;
  flex-shrink: 0;
}

.trabalho-badge span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trabalho-badge svg {
  flex-shrink: 0;
  color: var(--muted);
}

.trabalho-shot {
  height: 126px;
  margin-bottom: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trabalho-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trabalho-quote-icon {
  width: 26px;
  height: auto;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.trabalho-text {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text2);
  flex: 1;
  margin-bottom: 20px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.trabalho-person {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.trabalho-name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.trabalho-role {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Controles (setas) — círculo preto, seta branca ── */
.trabalhos-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.trab-arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background .15s, transform .15s;
}

.trab-arrow:hover {
  background: #000;
  transform: translateY(-1px);
}

.trab-arrow:active {
  transform: translateY(0);
}

.trab-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Tablet: 2 cards visíveis (arrows aparecem sempre que houver
   mais cards do que slots visíveis — controlado via JS) ── */
@media (max-width: 870px) {
  .trabalhos-stage {
    --trab-gap: 20px;
    --trab-card-h: 520px;
  }

  .trabalho-card {
    width: calc((100% - 1 * var(--trab-gap)) / 2);
  }
}

/* ── Mobile: 1 card visível ── */
@media (max-width: 700px) {
  .trabalhos {
    padding: 64px 0;
  }

  .trabalhos-wrap {
    width: 100%;
  }

  .trabalhos-head {
    margin-bottom: 36px;
  }

  .trabalhos-stage {
    --trab-gap: 0px;
    --trab-card-h: 500px;
  }

  .trabalho-card {
    width: 100%;
  }

}

/* Posição muda na hora (sem slide); só o opacity ainda cruza suavemente. */
@media (prefers-reduced-motion: reduce) {
  .trabalho-card {
    transition: opacity .2s ease;
  }
}
