/* ═══════════════ bijpip — gallery.css ═══════════════
   27-10-2026. Fotogalerij op Inpakinspiratie: masonry (CSS columns) +
   lightbox. Alleen geladen door templates/page-inpakinspiratie.php.
   ════════════════════════════════════════════════════ */

.bp-gallery {
  column-count: 3;
  column-gap: 14px;
  margin-top: 26px;
}
.bp-gallery__item {
  display: block;
  break-inside: avoid;
  margin: 0 0 14px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--cream);
  position: relative;
}
.bp-gallery__zoom { cursor: zoom-in; }
.bp-gallery__zoom { display: block; overflow: hidden; }
.bp-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .6s var(--ease), opacity .3s;
}
.bp-gallery__item:hover img,
.bp-gallery__item:focus-visible img { transform: scale(1.03); }
.bp-gallery__item:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

@media (min-width: 1400px) {
  .bp-gallery { column-count: 4; }
}
@media (max-width: 760px) {
  .bp-gallery { column-count: 2; column-gap: 8px; margin-top: 18px; }
  .bp-gallery__item { margin-bottom: 8px; }
}

/* ── Lightbox ── */
.bp-lb {
  position: fixed; inset: 0; z-index: 100000;
  background: rgb(20 16 18 / 0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
  touch-action: pan-y;
}
.bp-lb.is-open { opacity: 1; }
.bp-lb[hidden] { display: none; }
.bp-lb__img {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  width: auto; height: auto;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgb(0 0 0 / .35);
  user-select: none;
}
.bp-lb button {
  position: absolute; appearance: none; border: 0; background: rgb(255 255 255 / .12);
  color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font: 300 28px/1 var(--font-body);
  transition: background .2s;
}
.bp-lb button:hover, .bp-lb button:focus-visible { background: rgb(255 255 255 / .26); outline: none; }
.bp-lb__close { top: 16px; right: 16px; }
.bp-lb__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.bp-lb__next { right: 18px; top: 50%; transform: translateY(-50%); }
.bp-lb__count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgb(255 255 255 / .8); font: 400 13px/1 var(--font-body); letter-spacing: .06em;
}
html.bp-lb-open { overflow: hidden; }

@media (max-width: 760px) {
  .bp-lb__img { max-width: 100vw; max-height: calc(100dvh - 120px); border-radius: 0; }
  .bp-lb__prev, .bp-lb__next { top: auto; bottom: 10px; transform: none; }
  .bp-lb__prev { left: 14px; }
  .bp-lb__next { right: 14px; }
  .bp-lb__count { bottom: 26px; }
}

/* ── 28-10-2026: winkellink onder elke foto ── */
.bp-gallery__item figcaption { margin: 0; }
.bp-gallery__shop {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: #fff; color: var(--wine);
  font: 500 14px/1.3 var(--font-body); text-decoration: none;
  border-top: 1px solid rgb(0 0 0 / .05);
  transition: background .2s, color .2s;
}
.bp-gallery__shop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-gallery__shop span::first-letter { text-transform: uppercase; }
.bp-gallery__shop b { font-weight: 400; flex: none; transition: transform .2s; }
.bp-gallery__shop:hover, .bp-gallery__shop:focus-visible { background: var(--blush); color: var(--wine); }
.bp-gallery__shop:hover b { transform: translateX(3px); }
@media (max-width: 760px) {
  .bp-gallery__shop { padding: 8px 10px; font-size: 12.5px; }
}

/* ── 28-10-2026 (wens klant): Instagram-foto's onderaan kleiner ── */
body.bijpip-p-inpakinspiratie .insta-grid {
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-width: 1100px;
}
@media (max-width: 1100px) {
  body.bijpip-p-inpakinspiratie .insta-grid { grid-template-columns: repeat(5, 1fr); max-width: 640px; }
}
@media (max-width: 760px) {
  body.bijpip-p-inpakinspiratie .insta-grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
}

/* ── 29-10-2026 (wens klant): inpakfilmpjes, op de plek van "Drie combinaties" ──
   Staande filmpjes (9:16) naast elkaar op desktop, onder elkaar op mobiel.
   Het raster groeit vanzelf mee als er een derde filmpje bij komt. */
.bp-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 340px));
  justify-content: center;
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: 26px;
}
.bp-video { margin: 0; }
.bp-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--blush);
  border-radius: var(--r);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgb(44 44 44 / 0.08);
}
.bp-video figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 640px) {
  .bp-videos { grid-template-columns: minmax(0, 1fr); max-width: 400px; margin-inline: auto; margin-top: 18px; }
}

/* ── 29-10-2026 (wens klant): eigen foto's "achter de schermen" ──
   Zeven foto's, allemaal even groot (4:5, bijgesneden met object-fit).
   Desktop: alle zeven op één rij. Kleiner: vier per rij, de laatste rij
   netjes gecentreerd (flex) zodat er geen los gat ontstaat. */
body.bijpip-p-inpakinspiratie .insta-grid--behind {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  max-width: 1100px;
}
body.bijpip-p-inpakinspiratie .insta-grid--behind > a,
body.bijpip-p-inpakinspiratie .insta-grid--behind > img { aspect-ratio: 4 / 5; }
body.bijpip-p-inpakinspiratie .insta-grid--behind img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center;
}
@media (max-width: 1100px) {
  body.bijpip-p-inpakinspiratie .insta-grid--behind {
    display: flex; flex-wrap: wrap; justify-content: center; max-width: 760px;
  }
  body.bijpip-p-inpakinspiratie .insta-grid--behind > * { flex: 0 0 calc((100% - 30px) / 4); }
}
@media (max-width: 760px) {
  body.bijpip-p-inpakinspiratie .insta-grid--behind { gap: 6px; }
  body.bijpip-p-inpakinspiratie .insta-grid--behind > * { flex-basis: calc((100% - 18px) / 4); }
}
