/* ==========================================================================
   Portfolio page
   ========================================================================== */

.pf-hero {
  position: relative;
  height: 484px;
  overflow: hidden;
  background: #111;
}

.pf-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.29);
  pointer-events: none;
}

.pf-projects {
  background: var(--color-white);
  padding: 80px 0 100px;
}

.pf-projects__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 34px;
}

.pf-projects__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 65px;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin: 0 0 36px;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17.64px;
}

.pf-grid__item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e8e8e8;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 445.9 / 296.94;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.pf-grid__item:hover {
  transform: translateY(-3px);
  opacity: 0.92;
}

.pf-grid__item:focus-visible {
  outline: 2px solid var(--color-olive);
  outline-offset: 3px;
}

.pf-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.pf-lightbox[hidden] {
  display: none !important;
}

.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.pf-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-lightbox__figure {
  margin: 0;
  width: 100%;
  text-align: center;
}

.pf-lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
}

.pf-lightbox__img.is-loading {
  opacity: 0.35;
}

.pf-lightbox__caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
}

.pf-lightbox__title {
  font-weight: 600;
  text-align: left;
}

.pf-lightbox__counter {
  opacity: 0.75;
  white-space: nowrap;
}

.pf-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: 0;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
}

.pf-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pf-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pf-lightbox__nav--prev {
  left: -64px;
}

.pf-lightbox__nav--next {
  right: -64px;
}

body.pf-lightbox-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .pf-lightbox__nav--prev {
    left: 8px;
  }

  .pf-lightbox__nav--next {
    right: 8px;
  }

  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pf-hero {
    height: 200px;
  }

  .pf-projects {
    padding: 48px 0 64px;
  }

  .pf-projects__inner {
    padding: 0 20px;
  }

  .pf-projects__title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 24px;
  }

  .pf-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pf-lightbox__caption {
    flex-direction: column;
    align-items: flex-start;
  }
}
