.portfolio-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 380px !important;
  align-items: stretch !important;
}

.portfolio-grid > article {
  width: 100%;
  min-width: 0;
}

/* Cartões do Portfólio: rodapé mais compacto e ação no canto inferior direito. */
.portfolio-grid > article:not(.feature) {
  min-height: 0 !important;
  height: 380px !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.portfolio-grid > article:not(.feature) > img {
  flex: none !important;
  display: block !important;
  width: 100% !important;
  height: 270px !important;
  min-height: 270px !important;
  object-fit: contain !important;
  background: #171717;
}

.portfolio-grid > article:not(.feature) > span {
  margin-top: 14px !important;
}

.portfolio-grid > article:not(.feature) > h3 {
  min-height: 0 !important;
  margin-top: 7px !important;
  margin-bottom: 0 !important;
  padding-right: 140px;
  font-size: 22px !important;
  line-height: 1.08 !important;
  letter-spacing: -0.035em !important;
  font-weight: 700 !important;
}

/* Todos os títulos seguem a mesma métrica de “Vidro & Produto”. */
.portfolio-grid > article:not(.feature) > h3,
.portfolio-grid > article:not(.feature) > h3 * {
  word-spacing: normal !important;
  font-kerning: normal !important;
}

.portfolio-grid > article:not(.feature) .project-detail-link {
  position: absolute !important;
  right: 20px !important;
  bottom: 16px !important;
  margin: 0 !important;
  align-self: auto !important;
  white-space: nowrap;
}

/* O filtro usa o atributo hidden; este override tem de vencer o display do layout. */
.portfolio-grid > article[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .portfolio-grid {
    grid-template-columns: 1fr !important;
  }

  .portfolio-grid > article:not(.feature) > h3 {
    padding-right: 125px;
  }

  .portfolio-grid > article:not(.feature) {
    height: 350px !important;
  }

  .portfolio-grid > article:not(.feature) > img {
    height: 250px !important;
    min-height: 250px !important;
  }
}
