/* ═══════════════════════════════════════════════════════════════════
   ENTUSYASTA — página de trabalhos
   Herda tudo de ../src/styles/*.css. Aqui só o que é próprio da grade.
   ═══════════════════════════════════════════════════════════════════ */

/* ── cabeçalho da página ───────────────────────────────────────────── */
.trab-hero {
  position: relative;
  padding-top: clamp(140px, 22vh, 220px);
  padding-bottom: clamp(2.5rem, 6vh, 4.5rem);
  background: var(--g-abismo);
  overflow: hidden;
}

.trab-hero__titulo {
  max-width: 16ch;
}

.trab-hero .lead {
  margin-top: 1.4rem;
}

/* ── filtros ───────────────────────────────────────────────────────── */
.filtros {
  position: sticky;
  top: 84px;
  z-index: 60;
  padding-block: 1rem;
  background: rgba(4, 7, 7, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-line);
}

.filtros__linha {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.filtros__rotulo {
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-text-faint);
  margin-right: 0.4rem;
}

.filtro {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: none;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.35s var(--e-out), border-color 0.35s var(--e-out),
    background-color 0.35s var(--e-out);
  white-space: nowrap;
}

.filtro:hover {
  color: var(--c-text);
  border-color: var(--c-text-muted);
}

.filtro.is-ativo {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--preto);
  font-weight: 500;
}

.filtro__n {
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  margin-left: 0.35rem;
  font-size: 0.78em;
}

/* ── grade ─────────────────────────────────────────────────────────── */
.trabalhos {
  padding-block: clamp(2.5rem, 6vh, 5rem) var(--section-y);
}

.trab-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: clamp(1.2rem, 3vw, 2.6rem);
}

/* o primeiro item ocupa a linha inteira: dá hierarquia à página */
.trab-grade .trab:first-child {
  grid-column: 1 / -1;
}

.trab-grade .trab:first-child .trab__media {
  aspect-ratio: 21 / 9;
}

.trab-grade .trab:first-child .trab__nome {
  font-size: clamp(1.6rem, 3.4vw, 3rem);
}

.trab {
  display: block;
  position: relative;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--e-out), transform 0.7s var(--e-out);
}

.trab.is-visivel {
  opacity: 1;
  transform: none;
}

.trab.is-oculto {
  display: none;
}

/* são <span> dentro de um <a>: sem display:block o aspect-ratio e o
   max-width são ignorados e a imagem cresce sem limite */
.trab__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
}

.trab__cliente,
.trab__desc {
  display: block;
}

.trab__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.1s var(--e-out), filter 0.6s var(--e-out);
  filter: saturate(0.85) brightness(0.86);
}

.trab:hover .trab__img {
  transform: scale(1.04);
  filter: saturate(1) brightness(1);
}

.trab__veu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 7, 7, 0.1) 0%, rgba(4, 7, 7, 0.72) 100%);
  opacity: 0.9;
  transition: opacity 0.6s var(--e-out);
}

.trab:hover .trab__veu {
  opacity: 0.45;
}

/* selo "abrir site" que sobe no hover */
.trab__abrir {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-pill);
  background: var(--c-brand);
  color: var(--preto);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s var(--e-out), transform 0.45s var(--e-out);
}

.trab:hover .trab__abrir {
  opacity: 1;
  transform: none;
}

.trab__corpo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.1rem;
}

.trab__cliente {
  font-size: var(--t-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-brand);
}

.trab__nome {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 1.9vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  margin-top: 0.45rem;
  transition: color 0.35s var(--e-out);
}

.trab:hover .trab__nome {
  color: var(--c-brand);
}

.trab__desc {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--c-text-muted);
  max-width: 52ch;
}

.trab__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.trab__tag {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  color: var(--c-text-faint);
}

.trab__ano {
  flex: none;
  font-size: 0.82rem;
  color: var(--c-text-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 0.2rem;
}

/* ── estado vazio ──────────────────────────────────────────────────── */
.vazio {
  padding: clamp(3rem, 8vh, 6rem) 0;
  text-align: center;
  color: var(--c-text-faint);
  display: none;
}

.vazio.is-visivel {
  display: block;
}

/* ── chamada final ─────────────────────────────────────────────────── */
.trab-cta {
  position: relative;
  text-align: center;
  overflow: hidden;
  background: var(--g-abismo);
  border-top: 1px solid var(--c-line);
}

@media (max-width: 900px) {
  .filtros {
    top: 0;
  }
  .trab__corpo {
    flex-direction: column;
    gap: 0.4rem;
  }
  .trab-grade .trab:first-child .trab__media {
    aspect-ratio: 16 / 10;
  }
}

/* ── card como <article> ───────────────────────────────────────────
   O card deixou de ser um <a> para caber os links de código e deploy:
   âncora dentro de âncora é HTML inválido e o navegador desfaz.     */
.trab__capa {
  display: block;
}

.trab__nome a {
  color: inherit;
  text-decoration: none;
}

.trab__desc {
  margin: 0.5rem 0 0;
}

/* ── links secundários: deploy e repositório ───────────────────────── */
.trab__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.trab__link {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  color: var(--c-text-muted);
  transition: color 0.3s var(--e-out), border-color 0.3s var(--e-out),
    background-color 0.3s var(--e-out);
}

.trab__link:hover {
  color: var(--preto);
  background: var(--c-brand);
  border-color: var(--c-brand);
}
