.portfolio-filters {
  text-align: center;
  margin: 30px 0 40px;
}

.filter-button {
    background: none;
    border: none;
    padding: 10px 0px 0;
    margin: 0 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    line-height: 40px;
    letter-spacing: 0.15em;
    font-weight: 700;
    font-style: normal;
    font-size: 14px;
    color: #999;
    position: relative;
}
@media (max-width: 550px) {
  .filter-button {
    letter-spacing: 0.1em;
  }
}
.filter-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #000;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.filter-button:hover,
.filter-button.active {
  color: #000;
}

.filter-button:hover::after,
.filter-button.active::after {
  width: 100%;
}

.portfolio-grid {
  position: relative;
  width: 100%;
}

.wh-portfolio-grid-block .portfolio-grid {
  margin-left: 0;
  margin-right: 0;
}

.portfolio-item {
  position: absolute;
  box-sizing: border-box;
  width: calc(33.333% - 20px);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.portfolio-thumbnail {
  overflow: hidden;
  background-color: #000;
  position: relative;
  width: 100%;
}

.portfolio-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.00) 62.61%,
    rgba(0, 0, 0, 0.50) 83.17%
  );
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* .portfolio-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
  z-index: 2;
} */
.portfolio-content {
  position: absolute;
  bottom: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 2;
  display: flex;
  width: 100%;
  height: 77.977px;
  padding: 10.25px;
  justify-content: center;
  align-items: center;
  gap: 4.6%;
  box-sizing: border-box;
}

.portfolio-content .entry-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  display: flex;
  width: 38.1%;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
}

.portfolio-excerpt {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
}

.portfolio-excerpt p {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 130%;
  margin-bottom: 0;
  padding-left:23px;
  border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.portfolio-placeholder {
  width: 100%;
  padding-top: 75%;
  position: relative;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-text {
  color: #fff;
  text-align: center;
  padding: 0 15px;
  font-size: 1.2em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Mouse/desktop only: hide overlay + content until hover, and enable image zoom.
   Touch devices (phones, all iPads in either orientation) keep the default
   opacity: 1 so the title/excerpt overlay is always visible. */
@media (hover: hover) and (pointer: fine) {
  .portfolio-overlay,
  .portfolio-content {
    opacity: 0;
  }

  .portfolio-link:hover .portfolio-overlay,
  .portfolio-link:hover .portfolio-content {
    opacity: 1;
  }

  .portfolio-link:hover .portfolio-image {
    transform: scale(1.15);
  }
}

/* Override for touch devices that misreport as desktop (e.g. iPadOS Safari in
   "Request Desktop Website" mode reports hover: hover / pointer: fine). The JS
   in custom.js adds .is-touch; higher specificity keeps content visible. */
html.is-touch .portfolio-overlay,
html.is-touch .portfolio-content {
  opacity: 1;
}

/* Tablet - 2 columns */
@media (max-width: 991px) {
  .portfolio-item {
    width: calc(50% - 15px);
  }

  .filter-button {
    margin:0 20px;
  }
}

/* Mobile - 1 column */
@media (max-width: 767px) {
  .portfolio-item {
    width: 100%;
    max-width: none;
  }
  .portfolio-filters {
    text-align: left;
    margin:15px 0;
  }
  .filter-button {
      padding: 0px;
      margin: 0px;
      line-height: 16px;
      font-size: 12px;
  }
}
@media (max-width: 550px) {
  .filter-button {
    margin: 0 6px 8px;
  }
}