/* ============================================================
   PORTFOLIO / IMPRESSIES
   Overzicht (raster + filterknoppen) en vergrote weergave (lightbox)
   ============================================================ */

/* --- Filterknoppen --- */
.pf-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 28px;
}
.pf-filter button {
  font-family: "Josefin Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  padding: 10px 18px 8px;
  border: 1px solid #e00404;
  border-radius: 30px;
  background: #fff;
  color: #e00404;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.pf-filter button:hover,
.pf-filter button.active {
  background: #e00404;
  color: #fff;
}
.pf-filter button:focus-visible {
  outline: 2px solid #3b4045;
  outline-offset: 2px;
}

/* --- Raster met miniaturen --- */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 768px) {
  .pf-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1200px) {
  .pf-grid { grid-template-columns: repeat(4, 1fr); }
}
.pf-item {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  border-radius: 4px;
}
.pf-item[hidden] { display: none; }
.pf-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.pf-item:hover img,
.pf-item:focus-visible img { transform: scale(1.05); }
.pf-item:focus-visible { outline: 3px solid #e00404; outline-offset: 2px; }

/* --- Vergrote weergave (lightbox) --- */
.pf-lb {
  position: fixed;
  inset: 0;
  z-index: 100000;              /* boven de cookiebalk (99999) */
  background: #000;             /* volledig dekkend: voorkomt restbeelden in Safari (iOS) */
  touch-action: pan-y;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.pf-lb[hidden] { display: none; }

/* Vast vlak over het hele scherm waarin de foto staat */
.pf-lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.pf-lb-img {
  display: block;
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.pf-lb button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s;
}
.pf-lb button:hover { background: #e00404; }
.pf-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pf-lb button svg { width: 24px; height: 24px; }
.pf-lb-close { top: 14px; right: 14px; }
.pf-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.pf-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

.pf-lb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: #ddd;
  font-family: "Josefin Sans", sans-serif;
  font-size: 16px;
  pointer-events: none;
}

/* Smartphone: foto over de volle breedte, knoppen onderin */
@media (max-width: 767px) {
  .pf-lb-img {
    max-width: 100vw;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }
  .pf-lb-prev,
  .pf-lb-next { top: auto; bottom: 14px; transform: none; }
  .pf-lb-prev { left: 14px; }
  .pf-lb-next { right: 14px; }
  .pf-lb-caption { bottom: 28px; font-size: 15px; }
}

/* Pagina niet laten meescrollen achter de lightbox */
body.pf-lb-open { overflow: hidden; }
