.site-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.portfolio-hero {
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  padding: 170px clamp(18px, 3.4vw, 48px) 64px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.68) 42%, rgba(0, 0, 0, 0.28) 100%),
    url("img/Carports/IMG-20260715-WA0012.jpg") center 58% / cover no-repeat;
}

.portfolio-hero-content {
  max-width: 840px;
}

.portfolio-hero h1 {
  margin: 0;
  color: #d1c8bd;
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.72);
}

.portfolio-hero p:not(.eyebrow) {
  max-width: 640px;
  margin: 18px 0 0;
  color: rgba(235, 229, 221, 0.9);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.2;
}

.portfolio-section {
  padding: clamp(44px, 6vw, 74px) clamp(18px, 3.4vw, 48px);
  background: var(--off-white);
}

.portfolio-heading {
  max-width: 900px;
  margin: 0 auto 26px;
  text-align: center;
}

.portfolio-heading h2 {
  margin: 0;
  color: var(--black);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.35rem);
  line-height: 1;
  text-transform: uppercase;
}

.gallery-count {
  min-height: 24px;
  margin: 12px 0 0;
  color: #48515a;
  font-weight: 800;
}

.project-filters {
  max-width: 1180px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 34px;
}

.filter-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(7, 7, 7, 0.18);
  color: #161b20;
  background: rgba(255, 255, 255, 0.82);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.filter-btn:hover,
.filter-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(196, 22, 28, 0.58);
}

.filter-btn.active {
  color: var(--white);
  background: linear-gradient(180deg, #151c24, #070707);
  border-color: rgba(196, 22, 28, 0.76);
  box-shadow: inset 0 -3px 0 rgba(196, 22, 28, 0.9);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 26px);
  max-width: 1240px;
  margin: 0 auto;
}

.portfolio-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.portfolio-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #080a0d;
  cursor: zoom-in;
  overflow: hidden;
}

.portfolio-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease, filter 240ms ease;
}

.portfolio-card:hover .portfolio-media img,
.portfolio-media:focus-visible img {
  transform: scale(1.04);
  filter: contrast(1.05) saturate(1.04);
}

.portfolio-card-content {
  display: grid;
  gap: 10px;
  padding: 18px 18px 20px;
}

.portfolio-card h3 {
  margin: 0;
  color: var(--black);
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.portfolio-card p {
  margin: 0;
  color: #333a41;
  font-weight: 800;
  line-height: 1.24;
}

.portfolio-card button:not(.portfolio-media) {
  width: fit-content;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(7, 7, 7, 0.22);
  color: var(--black);
  background: transparent;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.portfolio-card button:not(.portfolio-media):hover,
.portfolio-card button:not(.portfolio-media):focus-visible {
  color: var(--white);
  background: var(--black);
}

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
  padding: 32px;
  background: rgba(0, 0, 0, 0.9);
}

.project-lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: min(78vh, 820px);
  object-fit: contain;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.6);
}

.lightbox-frame figcaption {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  text-align: center;
}

.lightbox-close,
.lightbox-arrow {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--white);
  background: rgba(10, 14, 18, 0.86);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-arrow:hover,
.lightbox-arrow:focus-visible {
  background: var(--red);
  transform: translateY(-2px);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  font-size: 1.55rem;
  line-height: 1;
}

.lightbox-arrow {
  width: 58px;
  height: 74px;
  font-size: 3rem;
  line-height: 1;
}

body.lightbox-open {
  overflow: hidden;
}

body.lightbox-open .jhm-bot-widget {
  display: none;
}

@media (max-width: 980px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-lightbox {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    padding: 24px 14px;
  }
}

@media (max-width: 620px) {
  .portfolio-hero {
    min-height: 360px;
    padding-top: 156px;
    padding-bottom: 44px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .project-filters {
    justify-content: stretch;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 8px);
  }

  .project-lightbox {
    grid-template-columns: 1fr 1fr;
    align-items: end;
    padding: 70px 14px 22px;
  }

  .lightbox-frame {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lightbox-prev,
  .lightbox-next {
    grid-row: 2;
    width: 100%;
    height: 52px;
    font-size: 2.2rem;
  }

  .lightbox-frame img {
    max-height: 68vh;
  }
}
